Bug 123481 - Threads get deadlocked in jurt
Summary: Threads get deadlocked in jurt
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: sdk (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Samuel Mehrbrodt (allotropia)
URL:
Whiteboard: target:6.3.0 target:6.2.2 target:6.1.6
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-15 10:30 UTC by Samuel Mehrbrodt (allotropia)
Modified: 2019-03-04 09:44 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 Samuel Mehrbrodt (allotropia) 2019-02-15 10:30:09 UTC
Thread waiting for itself (deadlocked), will not be cleaned up, leading to massive amount of threads created until memory full.


 Thread: AsynchronousFinalizer : priority:5, demon:false, threadId:1845, threadState:WAITING

java.lang.Object.wait(Native Method)

java.lang.Thread.join(Thread.java:1281)

java.lang.Thread.join(Thread.java:1355)

com.sun.star.lib.util.AsynchronousFinalizer.drain(AsynchronousFinalizer.java:94)

com.sun.star.lib.uno.bridges.java_remote.ProxyFactory.dispose(ProxyFactory.java:62)

com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.dispose(java_remote_bridge.java:521)

com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.release(java_remote_bridge.java:470)

com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.sendRequest(java_remote_bridge.java:622)

com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.request(ProxyFactory.java:144)

com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.access$900(ProxyFactory.java:93)

com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler$1.run(ProxyFactory.java:137)

com.sun.star.lib.util.AsynchronousFinalizer$1.run(AsynchronousFinalizer.java:63)
Comment 1 Stephan Bergmann 2019-02-15 10:54:23 UTC
What's the scenario where this (suddenly started to?) happen?
Comment 2 Samuel Mehrbrodt (allotropia) 2019-02-15 13:56:04 UTC
Discussion on IRC:
<samuel_m> sberg: re #123481, I don't have an exact reproducer scenario, but the report I have is that there is some server application running under jboss which process libreoffice documents, and the number of threads increases steadily and they don't exit. With this "fix", that problem is gone
<samuel_m> this fix == https://gerrit.libreoffice.org/#/c/67861/
<samuel_m> sberg: I have a heap dump though where you can see all those threads being stuck
<sberg> samuel_m, ok, so you don't know whether this started to happen e.g. with a specific Java version (wondered whether older versions maybe silently supported join-with-self to do nothing); was surprised that this deadlock would only to start now, seemingly out of the blue
<sberg> samuel_m, but anyway, what noelgrandin suggests looks like a good fix to me
Comment 3 Commit Notification 2019-02-18 07:05:36 UTC
Samuel Mehrbrodt committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/ea3c25358e3136cf900bc4e7d1bd6387dcca7883%5E%21

tdf#123481 jurt: Avoid thread deadlocking

It will be available in 6.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2019-02-18 17:59:05 UTC
Samuel Mehrbrodt committed a patch related to this issue.
It has been pushed to "libreoffice-6-2":

https://git.libreoffice.org/core/+/f249cb6e142e9fcc771cc8a40e347a13b201760e%5E%21

tdf#123481 jurt: Avoid thread deadlocking

It will be available in 6.2.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Oliver Brinzing 2019-03-01 17:24:42 UTC
is there a chance to backport this fix for lo 6.1.6?
Comment 6 Commit Notification 2019-03-04 09:44:59 UTC
Samuel Mehrbrodt committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

https://git.libreoffice.org/core/+/188fe404ba3157f739ee3e3dd65b42f8013ce39e%5E%21

tdf#123481 jurt: Avoid thread deadlocking

It will be available in 6.1.6.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.