Issue Details (XML | Word | Printable)

Key: DERBY-3244
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Mike Matrigali
Reporter: Ole Solberg
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby

NullPointerException in ....B2IRowLocking3.searchLeftAndLockPreviousKey

Created: 03/Dec/07 11:02 AM   Updated: 29/Jun/09 10:43 PM
Return to search
Component/s: Store
Affects Version/s: 10.3.2.1, 10.4.1.3
Fix Version/s: 10.3.3.0, 10.4.1.3

Time Tracking:
Not Specified

Environment: All ?
Issue Links:
Reference
 

Bug behavior facts: Regression Test Failure
Resolution Date: 13/Dec/07 07:19 PM


 Description  « Hide
The last week(48) we have seen a large number of this failure.

It was categorized as DERBY-2589 but these instances all have the NPE.


Exception while trying to insert row number: 52
ERROR XJ001: Java exception: ': java.lang.NullPointerException'.
java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.javaException(Unknown Source)
at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown Source)
at org.apache.derbyTesting.functionTests.tests.store.OnlineCompressTest.createAndLoadTable(OnlineCompressTest.java:140)
at org.apache.derbyTesting.functionTests.tests.store.OnlineCompressTest.deleteAllRows(OnlineCompressTest.java:494)
at org.apache.derbyTesting.functionTests.tests.store.OnlineCompressTest.test1(OnlineCompressTest.java:913)
at org.apache.derbyTesting.functionTests.tests.store.OnlineCompressTest.testList(OnlineCompressTest.java:1500)
at org.apache.derbyTesting.functionTests.tests.store.OnlineCompressTest.main(OnlineCompressTest.java:1520)
Caused by: java.lang.NullPointerException
at org.apache.derby.impl.store.access.btree.index.B2IRowLocking3.searchLeftAndLockPreviousKey(Unknown Source)
at org.apache.derby.impl.store.access.btree.index.B2IRowLocking3.lockNonScanPreviousRow(Unknown Source)
at org.apache.derby.impl.store.access.btree.BTreeController.doIns(Unknown Source)
at org.apache.derby.impl.store.access.btree.BTreeController.insert(Unknown Source)
at org.apache.derby.impl.store.access.btree.index.B2IController.insert(Unknown Source)
at org.apache.derby.impl.sql.execute.IndexChanger.insertAndCheckDups(Unknown Source)
at org.apache.derby.impl.sql.execute.IndexChanger.doInsert(Unknown Source)
at org.apache.derby.impl.sql.execute.IndexChanger.insert(Unknown Source)
at org.apache.derby.impl.sql.execute.IndexSetChanger.insert(Unknown Source)
at org.apache.derby.impl.sql.execute.RowChangerImpl.insertRow(Unknown Source)
at org.apache.derby.impl.sql.execute.InsertResultSet.normalInsertCore(Unknown Source)
at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown Source)
at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
... 8 more


The error statistics shows the occurrences:
(http://dbtg.thresher.com/derby/test/stats_today.html / http://dbtg.thresher.com/derby/test/stats_newest.html )

http://dbtg.thresher.com/derby/test/statistics/2589_48.html :
JIRA: 2589, Week: 48 600335-598009
598009 Daily jvm1.4 vista
598009 Daily jvm1.6 lin
598341 Daily jvm1.6 solN+1
598341 Daily jvm1.6 sparc
598354 10.3Branch jvm1.5 lin
598376 trunk16 jvmAll JDK16Jvm1.5SunOS-5.10_i86pc-i386
598692 Daily jvm1.6 sol
598729 trunk16 jvmAll JDK16Jvm1.6SunOS-5.10_i86pc-i386
599062 Daily jvm1.5 lin
599088 trunk15 jvm1.5 SunOS-5.10_i86pc-i386
599088 trunk15 jvm1.5 SunOS-5.10_sun4u-sparc
599088 trunk16 jvmAll JDK16Jvm1.5SunOS-5.10_i86pc-i386
600335 Daily jvm1.4 lin
Mon Dec 3 09:36:11 CET 2007

http://dbtg.thresher.com/derby/test/statistics/2589_47.html seems to be the first occurence:
JIRA: 2589, Week: 47 597885-597885
597885 Daily jvm1.6 lin
Mon Dec 3 09:36:13 CET 2007

All are seen on trunk except one on the 10.3 branch (598354 10.3Branch jvm1.5 lin).


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #603375 Tue Dec 11 21:58:25 UTC 2007 mikem DERBY-3244

In the case of a wait for a latch while traveling left at leaf level, and
a subsequent wait for either a lock or another latch while looking for row
to lock then one path through the code would get a null pointer. The code
was trying to release a latch that had already been released and was tracked
by "current_leaf == null".

I could not get this to fail in my environment, but did force it by code
inspection and changing the path through the code by hand to mimic latch
waits. My assumption is that intermittently on some platforms this single
threaded test is competing for these latches with background deleted row
cleaner thread, probably on a fast multiple processor machine.

-

M java/engine/org/apache/derby/impl/store/access/btree/index/B2IRowLocking3.java
M java/engine/org/apache/derby/impl/store/access/btree/BTreeLockingPolicy.java
Files Changed
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2IRowLocking3.java
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeLockingPolicy.java

Repository Revision Date User Message
ASF #603774 Wed Dec 12 23:14:59 UTC 2007 mikem DERBY-3244

backport svn 603375 from trunk to 10.3.

In the case of a wait for a latch while traveling left at leaf level, and
a subsequent wait for either a lock or another latch while looking for row
to lock then one path through the code would get a null pointer. The code
was trying to release a latch that had already been released and was tracked
by "current_leaf == null".

I could not get this to fail in my environment, but did force it by code
inspection and changing the path through the code by hand to mimic latch
waits. My assumption is that intermittently on some platforms this single
threaded test is competing for these latches with background deleted row
cleaner thread, probably on a fast multiple processor machine.
Files Changed
MODIFY /db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/store/access/btree/index/B2IRowLocking3.java
MODIFY /db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/store/access/btree/BTreeLockingPolicy.java