Apache OpenOffice (AOO) Bugzilla – Issue 50186
API: deadlock while try to get property "Title" from frame
Last modified: 2013-02-24 21:08:39 UTC
Mastertask. Please see subtasks. Stack: Switching to thread 2 (Thread 1196329904 (LWP 1540))]#0 0x419fc8f9 in __lll_mutex_lock_wait () from /lib/tls/libpthread.so.0 (gdb) where #0 0x419fc8f9 in __lll_mutex_lock_wait () from /lib/tls/libpthread.so.0 #1 0x419f98e9 in _L_mutex_lock_89 () from /lib/tls/libpthread.so.0 #2 0x419f9b70 in pthread_mutex_unlock () from /lib/tls/libpthread.so.0 #3 0x40c6c645 in osl_acquireMutex () from /local/dev/office/unxlngi/src680_m106/program/libuno_sal.so.3 #4 0x409a7440 in vos::OMutex::acquire () from /local/dev/office/unxlngi/src680_m106/program/libvos3gcc3.so #5 0x42ee2099 in SalYieldMutex::acquire () from /local/dev/office/unxlngi/src680_m106/program/libvclplug_gen680li.so #6 0x42d7b2df in framework::LockHelper::acquireReadAccess (this=0x41a00ff4) at /net/jumbo.germany/sol1/SRC680/src/framework/source/threadhelp/lockhelper.cxx:308 #7 0x44be4f30 in framework::ReadGuard::lock (this=0x474e85c0) at readguard.hxx:189 #8 0x44be4f0b in ReadGuard (this=0x474e85c0, rLock=@0x4948d188) at readguard.hxx:155 #9 0x44c0e247 in framework::Frame::implts_getTitleFromWindow (this=0x4948d150) at /local/dev/cws/m106/SRC680/framework/source/services/frame.cxx:3035 #10 0x44c0d4ba in framework::Frame::getFastPropertyValue (this=0x4948d150, aValue=@0x474e8700, nHandle=3) at /local/dev/cws/m106/SRC680/framework/source/services/frame.cxx:2758 #11 0x409d2218 in cppu::OPropertySetHelper::getFastPropertyValue () from /local/dev/office/unxlngi/src680_m106/program/libuno_cppuhelpergcc3.so.3 #12 0x409d1c1a in cppu::OPropertySetHelper::getPropertyValue () from /local/dev/office/unxlngi/src680_m106/program/libuno_cppuhelpergcc3.so.3 #13 0x44e5a260 in ?? () from /local/dev/office/unxlngi/src680_m106/program/libgcc3_uno.so #14 0x44e5a5b2 in ?? () from /local/dev/office/unxlngi/src680_m106/program/libgcc3_uno.so #15 0x44e5a951 in ?? () from /local/dev/office/unxlngi/src680_m106/program/libgcc3_uno.so #16 0x472df657 in component_canUnload () from /local/dev/office/unxlngi/src680_m106/program/liburp_uno.so #17 0x472d06a1 in component_canUnload () from /local/dev/office/unxlngi/src680_m106/program/liburp_uno.so #18 0x472d0bc9 in component_canUnload () from /local/dev/office/unxlngi/src680_m106/program/liburp_uno.so #19 0x40a2e67c in uno_threadpool_destroy () cd: Problem: The property helper implementation locks an internal mutex when someone accesses a property. The code tries to access toolkit/vcl code while holding the property mutex, which violates the golden rule: Don't hold a mutex when you call external code!
cd->as: Please have a look. Your code in Frame::getFastPropertyValue directly calls implts_getTitleFromWindow() which locks the solar mutex! So it's not LO code to blame, but yours!
To reproduce this behavior just start your office with parameter "-accept=socket,host=0,port=8100;urp;" Then create a scenario file "test.sce" whith the following content: -o fwl.TypeDetection -o fwk.Frame::com::sun::star::frame::Frame and call inside a solar shell: checkapi -sce test.sce
Now the frame uses an own helper implementation for XPropertySet, which lock's the same mutex the the frame it does. So the chance for a deadlock was decreased.
Retargetted due to the importance of the issue
AS->CN: Please verify this task on the cws fwk16. THX. re-open issue and reassign to cn@openoffice.org
reassign to cn@openoffice.org
reset resolution to FIXED
verified in fwk16
no deadlock in src680_m119 => zu