Callback deadlock

Piet van Oostrum piet at vanoostrum.org
Mon Jun 29 00:47:19 PDT 2015


Matthew J. Francis wrote:

 > Hi,
 > 
 > I'm intermittently experiencing the attached deadlock in some Python code.
 > 
 > As far as I can tell, the deadlock appears to be between a call to an 
 > XTopWindowListener in thread 1 (the listener, also in Python code, 
 > doesn't yet do anything more than print "I am here" on a callback) and 
 > the main thread which is attempting to enumerate the paragraphs of a 
 > text document in thread 2.
 > 
 > Could anyone with more experience in UNO and locking matters help me to 
 > understand what's going on here? If what I'm trying to do is essentially 
 > not going to work, there is the alternative of busy-waiting for windows 
 > to appear, but I'd like to avoid that if possible.

It is not completely clear if you are calling from a remote Python program, or from inside LO.
Assuming that it is remote, yes, there are problems with listeners in this situation. It can easily deadlock. I have posted a similar situation on this list some months ago, where I did a paragraph enumeration in a listener callback and it also deadlocked. See lists.freedesktop.org/archives/libreoffice/2015-April/067601.html

Basically the conclusion was the LO does too much locking here, but that it could not be avoided because of severe problems if it wouldn't lock.
-- 
Piet van Oostrum <piet at vanoostrum.org>
WWW: http://pietvanoostrum.com/
PGP key: [8DAE142BE17999C4]



More information about the LibreOffice mailing list