Deadlock in HSQLDB

Stephan Bergmann sbergman at
Thu Feb 18 12:13:05 UTC 2016

Running JunitTest_dbaccess_complex happened to deadlock the soffice.bin 
process for me once (non-reproducibly), and jstack shows that there is a 
deadlock in HSQLDB Java code in the in-process JVM:

> Found one Java-level deadlock:
> =============================
> "Thread-275584":
>   waiting to lock monitor 0x00002ac4e8004d78 (object 0x00000005e9008720, a org.hsqldb.lib.HsqlTimer$TaskQueue),
>   which is held by "HSQLDB Timer @5749ac52"
> "HSQLDB Timer @5749ac52":
>   waiting to lock monitor 0x00002ac4e8005508 (object 0x00000007959e9bb0, a org.hsqldb.lib.HsqlTimer$Task),
>   which is held by "Thread-275584"
> Java stack information for the threads listed above:
> ===================================================
> "Thread-275584":
> 	at org.hsqldb.lib.HsqlTimer$TaskQueue.signalTaskCancelled(
> 	- waiting to lock <0x00000005e9008720> (a org.hsqldb.lib.HsqlTimer$TaskQueue)
> 	at org.hsqldb.lib.HsqlTimer$Task.cancel(
> 	at org.hsqldb.lib.HsqlTimer$Task.setPeriod(
> 	- locked <0x00000007959e9bb0> (a org.hsqldb.lib.HsqlTimer$Task)
> 	at org.hsqldb.lib.HsqlTimer.setPeriod(
> 	at org.hsqldb.scriptio.ScriptWriterBase.setWriteDelay(
> 	at org.hsqldb.persist.Log.setWriteDelay(
> 	at org.hsqldb.persist.Logger.setWriteDelay(
> 	- locked <0x00000005e971ad68> (a org.hsqldb.persist.Logger)
> 	at org.hsqldb.DatabaseCommandInterpreter.processSet(
> 	at org.hsqldb.DatabaseCommandInterpreter.executePart(
> 	at org.hsqldb.DatabaseCommandInterpreter.execute(
> 	at org.hsqldb.Session.sqlExecuteDirectNoPreChecks(
> 	- locked <0x00000005e9703c98> (a org.hsqldb.Database)
> 	at org.hsqldb.Session.execute(
> 	- locked <0x00000005e9703c98> (a org.hsqldb.Database)
> 	at org.hsqldb.jdbc.jdbcStatement.fetchResult(
> 	at org.hsqldb.jdbc.jdbcStatement.execute(
> "HSQLDB Timer @5749ac52":
> 	at org.hsqldb.lib.HsqlTimer$Task.getNextScheduled(
> 	- waiting to lock <0x00000007959e9bb0> (a org.hsqldb.lib.HsqlTimer$Task)
> 	at
> 	at org.hsqldb.lib.HsqlArrayHeap.add(
> 	- locked <0x00000005e9008720> (a org.hsqldb.lib.HsqlTimer$TaskQueue)
> 	at org.hsqldb.lib.HsqlTimer$TaskQueue.addTask(
> 	at org.hsqldb.lib.HsqlTimer.nextTask(
> 	at org.hsqldb.lib.HsqlTimer$
> 	at

At least at first sight, this smells more like a bug in HSQLDB itself 
than like a problem caused by invalid use of HSQLDB from LO code. 
According to Wikipedia, the current stable release of HSQLDB is 2.3.3 
(from June 2015), while LO's external/hsqldb appears to be 1.8.0 (at 
least, the tarball we use is named

And LO's checks that the version is indeed 1.8,

   AC_MSG_ERROR([no, you need hsqldb >= but < 1.8.1])

so looks like we're stuck with that, for whatever reason?  Anybody knows?

More information about the LibreOffice mailing list