Bug 96387 - deadlock in HSQLDB
Summary: deadlock in HSQLDB
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
5.1.0.0.alpha0+ Master
Hardware: x86-64 (AMD64) Linux (All)
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Database-HSQLDB
  Show dependency treegraph
 
Reported: 2015-12-10 13:38 UTC by Michael Stahl (allotropia)
Modified: 2022-09-27 03:32 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Stahl (allotropia) 2015-12-10 13:38:57 UTC
just got a deadlock inside HSQLDB code, in JunitTest_dbaccess_complex with few days old master.

probably it's pretty obscure so not sure if it's worth fixing...

jstack says:


2015-12-10 14:34:34
Full thread dump OpenJDK 64-Bit Server VM (25.65-b01 mixed mode):

"Attach Listener" #278239 daemon prio=9 os_prio=0 tid=0x00000000024ac800 nid=0x2061 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Thread-278228" #278238 prio=5 os_prio=0 tid=0x0000000002364000 nid=0x6203 waiting for monitor entry [0x00002b2ddf2ba000]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at org.hsqldb.lib.HsqlTimer$TaskQueue.signalTaskCancelled(HsqlTimer.java:926)
	- waiting to lock <0x00000005c9e11e98> (a org.hsqldb.lib.HsqlTimer$TaskQueue)
	at org.hsqldb.lib.HsqlTimer$Task.cancel(HsqlTimer.java:728)
	at org.hsqldb.lib.HsqlTimer$Task.setPeriod(HsqlTimer.java:803)
	- locked <0x000000077ebd9d78> (a org.hsqldb.lib.HsqlTimer$Task)
	at org.hsqldb.lib.HsqlTimer.setPeriod(HsqlTimer.java:428)
	at org.hsqldb.scriptio.ScriptWriterBase.setWriteDelay(ScriptWriterBase.java:418)
	at org.hsqldb.persist.Log.setWriteDelay(Log.java:529)
	at org.hsqldb.persist.Logger.setWriteDelay(Logger.java:386)
	- locked <0x00000005ca892608> (a org.hsqldb.persist.Logger)
	at org.hsqldb.DatabaseCommandInterpreter.processSet(DatabaseCommandInterpreter.java:2361)
	at org.hsqldb.DatabaseCommandInterpreter.executePart(DatabaseCommandInterpreter.java:308)
	at org.hsqldb.DatabaseCommandInterpreter.execute(DatabaseCommandInterpreter.java:170)
	at org.hsqldb.Session.sqlExecuteDirectNoPreChecks(Session.java:1037)
	- locked <0x00000005ca845200> (a org.hsqldb.Database)
	at org.hsqldb.Session.execute(Session.java:899)
	- locked <0x00000005ca845200> (a org.hsqldb.Database)
	at org.hsqldb.jdbc.jdbcStatement.fetchResult(jdbcStatement.java:1581)
	at org.hsqldb.jdbc.jdbcStatement.execute(jdbcStatement.java:628)

"HSQLDB Timer @287caa38" #11 daemon prio=5 os_prio=0 tid=0x0000000002295000 nid=0x6237 waiting for monitor entry [0x00002b2e08b61000]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at org.hsqldb.lib.HsqlTimer$Task.getNextScheduled(HsqlTimer.java:763)
	- waiting to lock <0x000000077ebd9d78> (a org.hsqldb.lib.HsqlTimer$Task)
	at org.hsqldb.lib.HsqlTimer.compare(HsqlTimer.java:108)
	at org.hsqldb.lib.HsqlArrayHeap.add(HsqlArrayHeap.java:122)
	- locked <0x00000005c9e11e98> (a org.hsqldb.lib.HsqlTimer$TaskQueue)
	at org.hsqldb.lib.HsqlTimer$TaskQueue.addTask(HsqlTimer.java:841)
	at org.hsqldb.lib.HsqlTimer.nextTask(HsqlTimer.java:558)
	at org.hsqldb.lib.HsqlTimer$TaskRunner.run(HsqlTimer.java:610)
	at java.lang.Thread.run(Thread.java:745)

"Service Thread" #9 daemon prio=9 os_prio=0 tid=0x00000000020ac000 nid=0x6232 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C1 CompilerThread3" #8 daemon prio=9 os_prio=0 tid=0x0000000002056000 nid=0x6231 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread2" #7 daemon prio=9 os_prio=0 tid=0x0000000002053800 nid=0x6230 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread1" #6 daemon prio=9 os_prio=0 tid=0x0000000002051000 nid=0x622f waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread0" #5 daemon prio=9 os_prio=0 tid=0x0000000002043800 nid=0x622e waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Signal Dispatcher" #4 daemon prio=9 os_prio=0 tid=0x0000000002041800 nid=0x622d runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Finalizer" #3 daemon prio=8 os_prio=0 tid=0x000000000200f000 nid=0x622b in Object.wait() [0x00002b2e06e41000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x00000005c9e3b998> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
	- locked <0x00000005c9e3b998> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:164)
	at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:209)

"Reference Handler" #2 daemon prio=10 os_prio=0 tid=0x0000000002007800 nid=0x622a in Object.wait() [0x00002b2e06640000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	at java.lang.Object.wait(Object.java:502)
	at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:157)
	- locked <0x00000005c9e3bbb0> (a java.lang.ref.Reference$Lock)

"VM Thread" os_prio=0 tid=0x0000000002002000 nid=0x6229 runnable 

"GC task thread#0 (ParallelGC)" os_prio=0 tid=0x0000000001f8e000 nid=0x621f runnable 

"GC task thread#1 (ParallelGC)" os_prio=0 tid=0x0000000001f8f800 nid=0x6220 runnable 

"GC task thread#2 (ParallelGC)" os_prio=0 tid=0x0000000001f91800 nid=0x6221 runnable 

"GC task thread#3 (ParallelGC)" os_prio=0 tid=0x0000000001f93000 nid=0x6222 runnable 

"GC task thread#4 (ParallelGC)" os_prio=0 tid=0x0000000001f95000 nid=0x6223 runnable 

"GC task thread#5 (ParallelGC)" os_prio=0 tid=0x0000000001f96800 nid=0x6224 runnable 

"GC task thread#6 (ParallelGC)" os_prio=0 tid=0x0000000001f98800 nid=0x6225 runnable 

"GC task thread#7 (ParallelGC)" os_prio=0 tid=0x0000000001f9a800 nid=0x6226 runnable 

"GC task thread#8 (ParallelGC)" os_prio=0 tid=0x0000000001f9c000 nid=0x6227 runnable 

"GC task thread#9 (ParallelGC)" os_prio=0 tid=0x0000000001f9e000 nid=0x6228 runnable 

"VM Periodic Task Thread" os_prio=0 tid=0x00000000020ae800 nid=0x6233 waiting on condition 

JNI global references: 184


Found one Java-level deadlock:
=============================
"Thread-278228":
  waiting to lock monitor 0x000000000200d448 (object 0x00000005c9e11e98, a org.hsqldb.lib.HsqlTimer$TaskQueue),
  which is held by "HSQLDB Timer @287caa38"
"HSQLDB Timer @287caa38":
  waiting to lock monitor 0x000000000200dc88 (object 0x000000077ebd9d78, a org.hsqldb.lib.HsqlTimer$Task),
  which is held by "Thread-278228"

Java stack information for the threads listed above:
===================================================
"Thread-278228":
	at org.hsqldb.lib.HsqlTimer$TaskQueue.signalTaskCancelled(HsqlTimer.java:926)
	- waiting to lock <0x00000005c9e11e98> (a org.hsqldb.lib.HsqlTimer$TaskQueue)
	at org.hsqldb.lib.HsqlTimer$Task.cancel(HsqlTimer.java:728)
	at org.hsqldb.lib.HsqlTimer$Task.setPeriod(HsqlTimer.java:803)
	- locked <0x000000077ebd9d78> (a org.hsqldb.lib.HsqlTimer$Task)
	at org.hsqldb.lib.HsqlTimer.setPeriod(HsqlTimer.java:428)
	at org.hsqldb.scriptio.ScriptWriterBase.setWriteDelay(ScriptWriterBase.java:418)
	at org.hsqldb.persist.Log.setWriteDelay(Log.java:529)
	at org.hsqldb.persist.Logger.setWriteDelay(Logger.java:386)
	- locked <0x00000005ca892608> (a org.hsqldb.persist.Logger)
	at org.hsqldb.DatabaseCommandInterpreter.processSet(DatabaseCommandInterpreter.java:2361)
	at org.hsqldb.DatabaseCommandInterpreter.executePart(DatabaseCommandInterpreter.java:308)
	at org.hsqldb.DatabaseCommandInterpreter.execute(DatabaseCommandInterpreter.java:170)
	at org.hsqldb.Session.sqlExecuteDirectNoPreChecks(Session.java:1037)
	- locked <0x00000005ca845200> (a org.hsqldb.Database)
	at org.hsqldb.Session.execute(Session.java:899)
	- locked <0x00000005ca845200> (a org.hsqldb.Database)
	at org.hsqldb.jdbc.jdbcStatement.fetchResult(jdbcStatement.java:1581)
	at org.hsqldb.jdbc.jdbcStatement.execute(jdbcStatement.java:628)
"HSQLDB Timer @287caa38":
	at org.hsqldb.lib.HsqlTimer$Task.getNextScheduled(HsqlTimer.java:763)
	- waiting to lock <0x000000077ebd9d78> (a org.hsqldb.lib.HsqlTimer$Task)
	at org.hsqldb.lib.HsqlTimer.compare(HsqlTimer.java:108)
	at org.hsqldb.lib.HsqlArrayHeap.add(HsqlArrayHeap.java:122)
	- locked <0x00000005c9e11e98> (a org.hsqldb.lib.HsqlTimer$TaskQueue)
	at org.hsqldb.lib.HsqlTimer$TaskQueue.addTask(HsqlTimer.java:841)
	at org.hsqldb.lib.HsqlTimer.nextTask(HsqlTimer.java:558)
	at org.hsqldb.lib.HsqlTimer$TaskRunner.run(HsqlTimer.java:610)
	at java.lang.Thread.run(Thread.java:745)

Found 1 deadlock.
Comment 1 Stephan Bergmann 2016-11-21 11:29:27 UTC
Ran into that same problem during JunitTest_dbaccess_complex on <https://wiki.documentfoundation.org/Development/Tinderbox#14> now, too; <http://tinderbox.libreoffice.org/cgi-bin/gunzip.cgi?tree=MASTER&full-log=1479724201.29823>.
Comment 2 QA Administrators 2017-11-22 15:41:25 UTC Comment hidden (obsolete)
Comment 3 QA Administrators 2019-12-03 14:52:06 UTC Comment hidden (obsolete)
Comment 4 QA Administrators 2022-09-27 03:32:32 UTC
Dear Michael Stahl (CIB),

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug