Derby
  1. Derby
  2. DERBY-4873

NullPointerException in testBoundaries with ibm jvm 1.6

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.7.1.1
    • Fix Version/s: 10.5.3.2, 10.6.2.4, 10.7.1.1
    • Component/s: Test
    • Labels:
      None
    • Environment:
      Windows XP with ibm jvm 1.6 SR8
    • Bug behavior facts:
      Regression Test Failure

      Description

      With the line skipping the testBoundaries fixture of the InternationalConnectTest commented out, I get the following stack when I run the test with ibm 1.6:

      1) testBoundaries(org.apache.derbyTesting.functionTests.tests.jdbcapi.InternationalConnectTest)java.sql.SQLException: DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ001, SQLERRMC: java.lang.NullPointerExceptionXJ001.U
      at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:96)
      at org.apache.derby.client.am.SqlException.getSQLException(SqlException.java:358)
      at org.apache.derby.jdbc.ClientDriver.connect(ClientDriver.java:149)
      at java.sql.DriverManager.getConnection(DriverManager.java:322)
      at java.sql.DriverManager.getConnection(DriverManager.java:273)
      at org.apache.derbyTesting.functionTests.tests.jdbcapi.InternationalConnectTest.testBoundaries(InternationalConnectTest.java:111)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
      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.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.extensions.TestSetup.run(TestSetup.java:23)
      at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
      Caused by: org.apache.derby.client.am.SqlException: DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ001, SQLERRMC: java.lang.NullPointerExceptionXJ001.U
      at org.apache.derby.client.am.Connection.completeSqlca(Connection.java:2117)
      at org.apache.derby.client.net.NetConnectionReply.parseRdbAccessFailed(NetConnectionReply.java:541)
      at org.apache.derby.client.net.NetConnectionReply.parseAccessRdbError(NetConnectionReply.java:434)
      at org.apache.derby.client.net.NetConnectionReply.parseACCRDBreply(NetConnectionReply.java:297)
      at org.apache.derby.client.net.NetConnectionReply.readAccessDatabase(NetConnectionReply.java:121)
      at org.apache.derby.client.net.NetConnection.readSecurityCheckAndAccessRdb(NetConnection.java:846)
      at org.apache.derby.client.net.NetConnection.flowSecurityCheckAndAccessRdb(NetConnection.java:769)
      at org.apache.derby.client.net.NetConnection.flowUSRIDONLconnect(NetConnection.java:601)
      at org.apache.derby.client.net.NetConnection.flowConnect(NetConnection.java:408)
      at org.apache.derby.client.net.NetConnection.<init>(NetConnection.java:218)
      at org.apache.derby.client.net.NetConnection40.<init>(NetConnection40.java:77)
      at org.apache.derby.client.net.ClientJDBCObjectFactoryImpl40.newNetConnection(ClientJDBCObjectFactoryImpl40.java:269)
      at org.apache.derby.jdbc.ClientDriver.connect(ClientDriver.java:140)
      ... 35 more

      This is after the latest check in for DERBY-4836 (revision 1028035).

      I'll attach derby.log.

      1. logMsg.diff
        0.6 kB
        Knut Anders Hatlen
      2. derby.log
        10 kB
        Myrna van Lunteren

        Issue Links

          Activity

          Myrna van Lunteren created issue -
          Hide
          Myrna van Lunteren added a comment -

          I obtained this derby.log after also changing all fixture names except testBoundaries to have an extra 't', thus only testBoundaries is run this way.

          my classpath includes derby.jar, derbyclient.jar, derbyrun.jar, derbyTesting.jar, junit.jar and jakarta-oro-2.0.8.jar.

          I don't see this behavior with sun's 1.6 jvm.

          Show
          Myrna van Lunteren added a comment - I obtained this derby.log after also changing all fixture names except testBoundaries to have an extra 't', thus only testBoundaries is run this way. my classpath includes derby.jar, derbyclient.jar, derbyrun.jar, derbyTesting.jar, junit.jar and jakarta-oro-2.0.8.jar. I don't see this behavior with sun's 1.6 jvm.
          Myrna van Lunteren made changes -
          Field Original Value New Value
          Attachment derby.log [ 12458290 ]
          Myrna van Lunteren made changes -
          Link This issue is related to DERBY-4836 [ DERBY-4836 ]
          Hide
          Knut Anders Hatlen added a comment -

          The NPE is raised at BaseDataFileFactory.java:471, which looks like this:

          istream.println(LINE);

          I don't know why istream is null here with the IBM VM, but I think this line is buggy, or at least not consistent with how printing to istream happens in the rest of the file. Normally, the helper method logMsg() is used, which checks if istream is null before calling println(), and initializes the field if necessary.

          The attached patch logMsg.diff makes BaseDataFileFactory.stop() use the helper method too.
          Committed revision 1028633.

          This should at least take care of the NPE, but I don't know if it is enough to make the test pass on that platform.

          Show
          Knut Anders Hatlen added a comment - The NPE is raised at BaseDataFileFactory.java:471, which looks like this: istream.println(LINE); I don't know why istream is null here with the IBM VM, but I think this line is buggy, or at least not consistent with how printing to istream happens in the rest of the file. Normally, the helper method logMsg() is used, which checks if istream is null before calling println(), and initializes the field if necessary. The attached patch logMsg.diff makes BaseDataFileFactory.stop() use the helper method too. Committed revision 1028633. This should at least take care of the NPE, but I don't know if it is enough to make the test pass on that platform.
          Knut Anders Hatlen made changes -
          Attachment logMsg.diff [ 12458310 ]
          Hide
          Myrna van Lunteren added a comment -

          Thanks for fixing the NPE...
          I now get the issue with the delete / access denied error of DERBY-4836, which I've reported as a jvm issue, so I think this issue can be closed.

          Show
          Myrna van Lunteren added a comment - Thanks for fixing the NPE... I now get the issue with the delete / access denied error of DERBY-4836 , which I've reported as a jvm issue, so I think this issue can be closed.
          Myrna van Lunteren made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Assignee Knut Anders Hatlen [ knutanders ]
          Fix Version/s 10.7.1.0 [ 12314971 ]
          Resolution Fixed [ 1 ]
          Rick Hillegas made changes -
          Affects Version/s 10.7.1.1 [ 12315564 ]
          Affects Version/s 10.7.1.0 [ 12314971 ]
          Fix Version/s 10.7.1.1 [ 12315564 ]
          Fix Version/s 10.7.1.0 [ 12314971 ]
          Hide
          Mamta A. Satoor added a comment -

          Backported to 10.6 with revision 1394225

          Show
          Mamta A. Satoor added a comment - Backported to 10.6 with revision 1394225
          Hide
          Mamta A. Satoor added a comment -

          reopening for backporting

          Show
          Mamta A. Satoor added a comment - reopening for backporting
          Mamta A. Satoor made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          Assignee Knut Anders Hatlen [ knutanders ] Mamta A. Satoor [ mamtas ]
          Mamta A. Satoor made changes -
          Fix Version/s 10.6.2.3 [ 12315434 ]
          Hide
          Mamta A. Satoor added a comment -

          Backported to 10.5 with revision 1394319

          Show
          Mamta A. Satoor added a comment - Backported to 10.5 with revision 1394319
          Mamta A. Satoor made changes -
          Fix Version/s 10.5.3.2 [ 12315436 ]
          Mamta A. Satoor made changes -
          Assignee Mamta A. Satoor [ mamtas ] Knut Anders Hatlen [ knutanders ]
          Knut Anders Hatlen made changes -
          Status Reopened [ 4 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Gavin made changes -
          Workflow jira [ 12525517 ] Default workflow, editable Closed status [ 12801101 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Closed Closed
          3d 20h 32m 1 Myrna van Lunteren 01/Nov/10 20:17
          Closed Closed Reopened Reopened
          702d 23h 34m 1 Mamta A. Satoor 04/Oct/12 20:52
          Reopened Reopened Closed Closed
          26d 14h 9m 1 Knut Anders Hatlen 31/Oct/12 10:01

            People

            • Assignee:
              Knut Anders Hatlen
              Reporter:
              Myrna van Lunteren
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development