Bug 57569 - PyUNO deadlock when setting attributes
Summary: PyUNO deadlock when setting attributes
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: sdk (show other bugs)
Version:
(earliest affected)
3.5.7.2 release
Hardware: All Linux (All)
: highest critical
Assignee: Not Assigned
URL:
Whiteboard: BSA target:4.1.0 target:4.0.0.0.beta2
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-26 19:15 UTC by Miklós Prisznyák (MultiRáció Kft)
Modified: 2012-12-11 21:54 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
patch to LibreOffice 3.5.7.2 which fixed the deadlock in PyUNO (1.02 KB, patch)
2012-11-26 19:15 UTC, Miklós Prisznyák (MultiRáció Kft)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Miklós Prisznyák (MultiRáció Kft) 2012-11-26 19:15:26 UTC
Created attachment 70610 [details]
patch to LibreOffice 3.5.7.2 which fixed the deadlock in PyUNO

Problem description: 

Setting any writable attributes of a PyUNO component (in my case a custom PyUNO component implementing the service 'com.sun.star.sheet.Solver')  results in a dead-lock on Linux when the built-in GUI tries to set any attribute on the implemented PyUNO component. 

A detailed Apache OpenOffice bug report which points to a working fix to the problem:

https://issues.apache.org/ooo/show_bug.cgi?id=118798 

Using the above, I have applied a patch on LibreOffice 3.5.7.2 and it has solved the problem.  
I believe this patch should be applied in all released versions of LibreOffice. 

Current behavior:

LibreOffice hangs completely.

Expected behavior:

Writing Python attributes   from other languages (like C++) should not freeze the whole office package and it ought to work.
              
Operating System: Ubuntu
Comment 1 Michael Stahl (allotropia) 2012-12-11 19:04:21 UTC
i take it the CPython GIL is not recursive?
that code is obviously broken in that case.

that patch you attached is identical to the ApacheOO SVN commit
cited in the AOO bug.  my understanding is that due to the messy
licensing situation we can only apply that on master and the 4.0 branch,
but not the 3.6 branch.

thanks for pointing out this problem and its solution.

http://cgit.freedesktop.org/libreoffice/core/commit/?id=374c9af20d93029d999ca21beb2b989e0a428b98

http://cgit.freedesktop.org/libreoffice/core/commit/?id=68086c59acd936d677dbc76473d34b484ec0b809
Comment 2 Miklós Prisznyák (MultiRáció Kft) 2012-12-11 21:54:29 UTC
"i take it the CPython GIL is not recursive?"

I suppose so... The patch has fixed my problem and it doesn't seem to cause problems.

"my understanding is that due to the messy licensing situation we can only apply that on master and the 4.0 branch, but not the 3.6 branch"

Well, given the very trivial nature of the fix (it's merely swapping code lines), I find this rather weird.
Please try to doublecheck you cannot apply this fix on earlier versions indeed.

Thanks for your consideration.