Derby
  1. Derby
  2. DERBY-4617

Sysinfo.testSysinfoLocale failed with IB47 M 1.6 on Windows 7 64bit

    Details

    • Urgency:
      Low
    • Issue & fix info:
      Newcomer

      Description

      Sysinfo.testSysinfoLocale failed with IB47 M 1.6 on Windows 7 64bit. This is the exception from running the test:
      1) testSysinfoLocale(org.apache.derbyTesting.functionTests.tests.derbynet.SysinfoTest)junit.framework.AssertionFailedError: expected:<14> but was:<1>
      at org.apache.derbyTesting.functionTests.tests.derbynet.SysinfoTest.assertMatchingStringExists(SysinfoTest.java:322)
      at org.apache.derbyTesting.functionTests.tests.derbynet.SysinfoTest.testSysinfoLocale(SysinfoTest.java:249)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
      at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109)

      When running with SysinfoTest along, you will see the following error:
      ...before sed
      2010-04-16 22:14:49.289 GMT : Ung?ltige Antwort von Network Server: Keine ausrei
      chenden Daten.

      after sed
      2010-04-16 22:14:49.289 GMT : Ung?ltige Antwort von Network Server: Keine ausrei
      chenden Daten.

      1. derby-4617_try_diff.txt
        3 kB
        Kathey Marsden
      2. derby.log
        9 kB
        Lily Wei

        Activity

        Hide
        Knut Anders Hatlen added a comment -

        [bulk update] Close all resolved issues that haven't been updated for more than one year.

        Show
        Knut Anders Hatlen added a comment - [bulk update] Close all resolved issues that haven't been updated for more than one year.
        Hide
        Kathey Marsden added a comment -

        This issue has already been fixed in 10.5. Adjusting the fixVersion

        Show
        Kathey Marsden added a comment - This issue has already been fixed in 10.5. Adjusting the fixVersion
        Hide
        Lily Wei added a comment -

        Thanks Kathey for the prompt reply. Yes, you are right about I see the access denied message from both IBM 1.6 and Sun jvm. And, it should be a different issue. +1 for the patch.

        Show
        Lily Wei added a comment - Thanks Kathey for the prompt reply. Yes, you are right about I see the access denied message from both IBM 1.6 and Sun jvm. And, it should be a different issue. +1 for the patch.
        Hide
        Kathey Marsden added a comment -

        Thanks Lily, do you see these just with IBM 1.6 or also with Sun? It seems to me at one point a decision was made to just print such access errors for classpath entries for which there was no read permission access.

        The property issues are filed as DERBY-4616. Jayaram is assigned to that one, but we haven't heard from him in a while.

        Show
        Kathey Marsden added a comment - Thanks Lily, do you see these just with IBM 1.6 or also with Sun? It seems to me at one point a decision was made to just print such access errors for classpath entries for which there was no read permission access. The property issues are filed as DERBY-4616 . Jayaram is assigned to that one, but we haven't heard from him in a while.
        Hide
        Lily Wei added a comment -

        Hi Kathey:
        I applied the patch. testSysinfoLocal passed on my Windows 7 system. However, there are still some access denied messages within the test.
        This is some output I got:
        =================
        Java user name: Security Exception: java.security.AccessControlException: access denied (java.util.PropertyPermission user.name read)^M
        Java user home: Security Exception: java.security.AccessControlException: access denied (java.util.PropertyPermission user.home read)^M
        Java user dir: Security Exception: java.security.AccessControlException: access denied (java.util.PropertyPermission user.dir read)^M
        java.specification.name: Java Platform API Specification^M
        java.specification.version: 1.6^M
        java.runtime.version: 1.6.0_13-b03^M
        --------- Derby Information --------^M
        JRE - JDBC: Java SE 6 - JDBC 4.0^M
        [C:\derby5\trunk\jars\sane\derby.jar] 10.9.0.0 alpha - (1091990M)^M
        [Java Security Exception: access denied (java.io.FilePermission . read)] <null>
        [Java Security Exception: access denied (java.io.FilePermission c:\derby5\trunk\
        tools\java\junit.jar read)] <null>
        [Java Security Exception: access denied (java.io.FilePermission c:\derby5\trunk\
        jars\sane\derbyrun.jar read)] <null>
        [Java Security Exception: access denied (java.io.FilePermission c:\derby5\trunk\
        jars\sane\derbyTesting.jar read)] <null>
        [Java Security Exception: access denied (java.io.FilePermission c:\derby5\trunk\
        tools\java\jakarta-oro-2.0.8.jar read)] <null>

        Show
        Lily Wei added a comment - Hi Kathey: I applied the patch. testSysinfoLocal passed on my Windows 7 system. However, there are still some access denied messages within the test. This is some output I got: ================= Java user name: Security Exception: java.security.AccessControlException: access denied (java.util.PropertyPermission user.name read)^M Java user home: Security Exception: java.security.AccessControlException: access denied (java.util.PropertyPermission user.home read)^M Java user dir: Security Exception: java.security.AccessControlException: access denied (java.util.PropertyPermission user.dir read)^M java.specification.name: Java Platform API Specification^M java.specification.version: 1.6^M java.runtime.version: 1.6.0_13-b03^M --------- Derby Information --------^M JRE - JDBC: Java SE 6 - JDBC 4.0^M [C:\derby5\trunk\jars\sane\derby.jar] 10.9.0.0 alpha - (1091990M)^M [Java Security Exception: access denied (java.io.FilePermission . read)] <null> [Java Security Exception: access denied (java.io.FilePermission c:\derby5\trunk\ tools\java\junit.jar read)] <null> [Java Security Exception: access denied (java.io.FilePermission c:\derby5\trunk\ jars\sane\derbyrun.jar read)] <null> [Java Security Exception: access denied (java.io.FilePermission c:\derby5\trunk\ jars\sane\derbyTesting.jar read)] <null> [Java Security Exception: access denied (java.io.FilePermission c:\derby5\trunk\ tools\java\jakarta-oro-2.0.8.jar read)] <null>
        Hide
        Kathey Marsden added a comment -

        The unwrapped getCanonicalPath() call would appear to be it. Lily could you try this patch on Windows 7 derby-4617_try_diff.txt?

        I have not run the full test suite yet. I am not sure about a specific test for this. It seems some java versions need to do something requiring direct file access to derby.jar and thus the access check and others do not.

        Show
        Kathey Marsden added a comment - The unwrapped getCanonicalPath() call would appear to be it. Lily could you try this patch on Windows 7 derby-4617_try_diff.txt? I have not run the full test suite yet. I am not sure about a specific test for this. It seems some java versions need to do something requiring direct file access to derby.jar and thus the access check and others do not.
        Hide
        Kathey Marsden added a comment -

        I saw this occur on a different JDK I was testing on XP. The message in the derby.log was:

        2011-04-13 22:21:07.511 GMT : Apache Derby Network Server - 10.5.3.2 - (1089552M) started and ready to accept connections on port 1527

        2011-04-13 22:21:55.482 GMT : Access denied ("java.io.FilePermission" "C:\cygwin\svn4\10.5\jars\sane\derby.jar" "read")

        java.security.AccessControlException: Access denied ("java.io.FilePermission" "C:\cygwin\svn4\10.5\jars\sane\derby.jar" "read")

        at java.security.AccessController.checkPermission(AccessController.java:108)

        at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)

        at java.lang.SecurityManager.checkRead(SecurityManager.java:888)

        at java.io.File.exists(File.java:772)

        at java.io.Win32FileSystem.canonicalize(Win32FileSystem.java:420)

        at java.io.File.getCanonicalPath(File.java:591)

        at org.apache.derby.impl.tools.sysinfo.Main.formatURL(Main.java:1224)

        at org.apache.derby.impl.tools.sysinfo.Main.loadZipFromResource(Main.java:892)

        at org.apache.derby.impl.tools.sysinfo.Main.getAllInfo(Main.java:796)

        at org.apache.derby.impl.tools.sysinfo.Main.reportDerby(Main.java:241)

        at org.apache.derby.impl.tools.sysinfo.Main.getMainInfo(Main.java:141)

        at org.apache.derby.impl.drda.NetworkServerControlImpl.getCLSSysInfo(NetworkServerControlImpl.java:2184)

        at org.apache.derby.impl.drda.NetworkServerControlImpl.sendSysInfo(NetworkServerControlImpl.java:2072)

        at org.apache.derby.impl.drda.NetworkServerControlImpl.processCommands(NetworkServerControlImpl.java:1751)

        at org.apache.derby.impl.drda.DRDAConnThread.sessionInitialState(DRDAConnThread.java:645)

        at org.apache.derby.impl.drda.DRDAConnThread.run(DRDAConnThread.java:279)

        Looking at the offending code in Main.formatURL I see:
        try

        { result = new File(filename).getCanonicalPath().replace('/', File.separatorChar); }

        catch (IOException e)

        { result = e.getMessage(); }

        getCanonicalPath() can throw a Security exception so should be wrapped I think in a priv block.
        I will try that and see if it resolves the issue.

        Show
        Kathey Marsden added a comment - I saw this occur on a different JDK I was testing on XP. The message in the derby.log was: 2011-04-13 22:21:07.511 GMT : Apache Derby Network Server - 10.5.3.2 - (1089552M) started and ready to accept connections on port 1527 2011-04-13 22:21:55.482 GMT : Access denied ("java.io.FilePermission" "C:\cygwin\svn4\10.5\jars\sane\derby.jar" "read") java.security.AccessControlException: Access denied ("java.io.FilePermission" "C:\cygwin\svn4\10.5\jars\sane\derby.jar" "read") at java.security.AccessController.checkPermission(AccessController.java:108) at java.lang.SecurityManager.checkPermission(SecurityManager.java:549) at java.lang.SecurityManager.checkRead(SecurityManager.java:888) at java.io.File.exists(File.java:772) at java.io.Win32FileSystem.canonicalize(Win32FileSystem.java:420) at java.io.File.getCanonicalPath(File.java:591) at org.apache.derby.impl.tools.sysinfo.Main.formatURL(Main.java:1224) at org.apache.derby.impl.tools.sysinfo.Main.loadZipFromResource(Main.java:892) at org.apache.derby.impl.tools.sysinfo.Main.getAllInfo(Main.java:796) at org.apache.derby.impl.tools.sysinfo.Main.reportDerby(Main.java:241) at org.apache.derby.impl.tools.sysinfo.Main.getMainInfo(Main.java:141) at org.apache.derby.impl.drda.NetworkServerControlImpl.getCLSSysInfo(NetworkServerControlImpl.java:2184) at org.apache.derby.impl.drda.NetworkServerControlImpl.sendSysInfo(NetworkServerControlImpl.java:2072) at org.apache.derby.impl.drda.NetworkServerControlImpl.processCommands(NetworkServerControlImpl.java:1751) at org.apache.derby.impl.drda.DRDAConnThread.sessionInitialState(DRDAConnThread.java:645) at org.apache.derby.impl.drda.DRDAConnThread.run(DRDAConnThread.java:279) Looking at the offending code in Main.formatURL I see: try { result = new File(filename).getCanonicalPath().replace('/', File.separatorChar); } catch (IOException e) { result = e.getMessage(); } getCanonicalPath() can throw a Security exception so should be wrapped I think in a priv block. I will try that and see if it resolves the issue.
        Hide
        Lily Wei added a comment -

        With the patch, this is the error trace I see in Windows 7 64 bits:
        [Error/failure logged at Tue Feb 08 09:49:23 GMT 2011]
        junit.framework.AssertionFailedError: cannot find --------- Derby Network Server
        Information -------- in actualOutput:Tue Feb 08 01:49:23 PST 2011 : Invalid rep
        ly from network server: Insufficient data.

        at junit.framework.Assert.fail(Assert.java:47)
        at junit.framework.Assert.assertTrue(Assert.java:20)
        at org.apache.derbyTesting.functionTests.tests.derbynet.SysinfoTest.asse
        rtMatchingStringExists(SysinfoTest.java:285)
        at org.apache.derbyTesting.functionTests.tests.derbynet.SysinfoTest.test
        Sysinfo(SysinfoTest.java:202)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
        java:48)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
        sorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:600)
        at junit.framework.TestCase.runTest(TestCase.java:154)
        at junit.framework.TestCase.runBare(TestCase.java:127)
        at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:
        112)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.extensions.TestSetup.run(TestSetup.java:23)
        at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57
        )
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.extensions.TestSetup.run(TestSetup.java:23)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.extensions.TestSetup.run(TestSetup.java:23)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.extensions.TestSetup.run(TestSetup.java:23)
        at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57
        )
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.extensions.TestSetup.run(TestSetup.java:23)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.extensions.TestSetup.run(TestSetup.java:23)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.extensions.TestSetup.run(TestSetup.java:23)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at junit.textui.TestRunner.doRun(TestRunner.java:116)
        at junit.textui.TestRunner.start(TestRunner.java:172)
        at junit.textui.TestRunner.main(TestRunner.java:138)

        Show
        Lily Wei added a comment - With the patch, this is the error trace I see in Windows 7 64 bits: [Error/failure logged at Tue Feb 08 09:49:23 GMT 2011] junit.framework.AssertionFailedError: cannot find --------- Derby Network Server Information -------- in actualOutput:Tue Feb 08 01:49:23 PST 2011 : Invalid rep ly from network server: Insufficient data. at junit.framework.Assert.fail(Assert.java:47) at junit.framework.Assert.assertTrue(Assert.java:20) at org.apache.derbyTesting.functionTests.tests.derbynet.SysinfoTest.asse rtMatchingStringExists(SysinfoTest.java:285) at org.apache.derbyTesting.functionTests.tests.derbynet.SysinfoTest.test Sysinfo(SysinfoTest.java:202) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:48) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:600) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java: 112) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22) at junit.extensions.TestSetup$1.protect(TestSetup.java:19) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.extensions.TestSetup.run(TestSetup.java:23) at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57 ) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22) at junit.extensions.TestSetup$1.protect(TestSetup.java:19) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.extensions.TestSetup.run(TestSetup.java:23) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22) at junit.extensions.TestSetup$1.protect(TestSetup.java:19) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.extensions.TestSetup.run(TestSetup.java:23) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22) at junit.extensions.TestSetup$1.protect(TestSetup.java:19) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.extensions.TestSetup.run(TestSetup.java:23) at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57 ) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22) at junit.extensions.TestSetup$1.protect(TestSetup.java:19) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.extensions.TestSetup.run(TestSetup.java:23) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22) at junit.extensions.TestSetup$1.protect(TestSetup.java:19) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.extensions.TestSetup.run(TestSetup.java:23) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22) at junit.extensions.TestSetup$1.protect(TestSetup.java:19) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.extensions.TestSetup.run(TestSetup.java:23) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at junit.textui.TestRunner.doRun(TestRunner.java:116) at junit.textui.TestRunner.start(TestRunner.java:172) at junit.textui.TestRunner.main(TestRunner.java:138)
        Hide
        Kathey Marsden added a comment -

        With the fix below I am guessing the error message for this issue will change. I am guessing it will say something like:
        could not find "derby.drda.maxThreads=0" in sysinfo ouptut : Ung?ltige Antwort von Network Server: Keine ausrei
        Lily, could you try the test on the failing platform and post the new trace.

        r1067250 | kmarsden | 2011-02-04 10:21:13 -0800 (Fri, 04 Feb 2011) | 3 lines

        DERBY-4997 SysinfoTest version output filtering is fragile with new java version

        Also Myrna says: Ung?ltige Antwort von Network Server: Keine ausrei means nvalid Answer from Network Server; insufficient Data so sysinfo is not actually running in this scenario.

        Show
        Kathey Marsden added a comment - With the fix below I am guessing the error message for this issue will change. I am guessing it will say something like: could not find "derby.drda.maxThreads=0" in sysinfo ouptut : Ung?ltige Antwort von Network Server: Keine ausrei Lily, could you try the test on the failing platform and post the new trace. r1067250 | kmarsden | 2011-02-04 10:21:13 -0800 (Fri, 04 Feb 2011) | 3 lines DERBY-4997 SysinfoTest version output filtering is fragile with new java version Also Myrna says: Ung?ltige Antwort von Network Server: Keine ausrei means nvalid Answer from Network Server; insufficient Data so sysinfo is not actually running in this scenario.

          People

          • Assignee:
            Kathey Marsden
            Reporter:
            Lily Wei
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development