Bug 47021 - [dbaccess] deadlock on closing base window
Summary: [dbaccess] deadlock on closing base window
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
Master old -3.6
Hardware: Other Linux (All)
: medium normal
Assignee: Stephan Bergmann
URL: http://nabble.documentfoundation.org/...
Whiteboard: target:3.6.0
Keywords: regression
Depends on:
Blocks:
 
Reported: 2012-03-06 14:23 UTC by Michael Stahl (allotropia)
Modified: 2013-05-13 17:01 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
patch (1.95 KB, patch)
2012-03-08 03:45 UTC, Michael Meeks
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Stahl (allotropia) 2012-03-06 14:23:08 UTC
Julien found this deadlock:

> On master only (I don't have the problem on 3.5 branch), Base hangs when I
> try to close it. I must select "Tables"/"Queries" or others to have the
> problem. If I just open a file and close, i don't have this problem.

i can reproduce this on current master from yesterday,
master 8829b7c9, master 46506f82, but not master 904d59fa or libreoffice-3-5.
so it looks like a recent regression.

the proposed patch by mmeeks probably does not fix the problem,
because the SolarMutex is locked some more up the stack of the main thread:

> void SAL_CALL OGenericUnoController::dispose() throw(::com::sun::star::uno::RuntimeException)
> {
>     SolarMutexGuard aSolarGuard;
>     OGenericUnoController_Base::dispose();
> }

http://permalink.gmane.org/gmane.comp.documentfoundation.libreoffice.devel/25838

i'd guess the deadlock was caused by this commit, which introduced the
+            m_pEventBroadcaster->join();
 81921bec4b81b7e3e87c24a6b4e3cfdd0cced47d
Comment 1 Michael Meeks 2012-03-08 03:45:58 UTC
Created attachment 58176 [details]
patch

Nice hunting Michael - what did you think of my patch ? :-) [ which I re-attach ]
Comment 2 Michael Stahl (allotropia) 2012-03-08 03:57:15 UTC
@mmeeks: if you had actually read the description you would have
noticed that i don't think the patch will work :)
Comment 3 Not Assigned 2012-03-09 00:19:01 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=490f83d4807a4223bae61d34913e5bd2bf952f3a

fdo#47021: the naive join attempt leads to deadlock
Comment 4 Stephan Bergmann 2012-03-09 00:33:10 UTC
...turns out the attempt of <http://cgit.freedesktop.org/libreoffice/core/commit/?id=81921bec4b81b7e3e87c24a6b4e3cfdd0cced47d> "Make sure spawned thread is joined again" was too naive.  So better avoid the deadlock and instead live with the occasional test failure for now (the problem leading to the naive join attempt had been some test failing during shutdown).
Comment 5 Rainer Bielefeld Retired 2012-04-05 08:12:09 UTC
I added Fix submitter as assignee because this will ease queries and bug tracking.