Bug 83716 - hang joining thread ...
Summary: hang joining thread ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Chart (show other bugs)
Version:
(earliest affected)
4.3.0.2 rc
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:4.4.0
Keywords:
Depends on:
Blocks: 81107 83518
  Show dependency treegraph
 
Reported: 2014-09-10 14:08 UTC by Michael Meeks
Modified: 2014-09-15 15:09 UTC (History)
0 users

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 Michael Meeks 2014-09-10 14:08:48 UTC
With a 3D GL chart a macro running, I get this hang:

(gdb) t a a bt

Thread 120 (Thread 0xadbc5b40 (LWP 19213)):
#0  0xb7fdc424 in __kernel_vsyscall ()
#1  0xb7d5abb9 in __lll_lock_wait () at ../nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S:144
#2  0xb7d56467 in _L_lock_961 () from /lib/libpthread.so.0
#3  0xb7d562e8 in __GI___pthread_mutex_lock (mutex=0x87a44a8) at ../nptl/pthread_mutex_lock.c:114
#4  0xb7e66ad4 in pthread_mutex_lock (mutex=0x87a44a8) at forward.c:192
#5  0xb7f9f4ef in osl_acquireMutex (pMutex=0x87a44a8) at /data/opt/libreoffice/master/sal/osl/unx/mutex.c:104
#6  0xa95b0d68 in osl::Mutex::acquire (this=0xa8bc7ec) at /data/opt/libreoffice/master/include/osl/mutex.hxx:58
#7  0xa95ac218 in Guard (t=..., this=0xadbc521c) at /data/opt/libreoffice/master/include/osl/mutex.hxx:144
#8  chart::RenderOneFrameThread::execute (this=0xa336550) at /data/opt/libreoffice/master/chart2/source/view/charttypes/GL3DBarChart.cxx:163
#9  0xb791422e in salhelper::Thread::run (this=0xa336550) at /data/opt/libreoffice/master/salhelper/source/thread.cxx:40
#10 0xb79143b3 in osl::threadFunc (param=0xa336558) at /data/opt/libreoffice/master/include/osl/thread.hxx:187
#11 0xb7fa20ea in osl_thread_start_Impl (pData=0xae38440) at /data/opt/libreoffice/master/sal/osl/unx/thread.c:237
#12 0xb7d5407a in start_thread (arg=0xadbc5b40) at pthread_create.c:309
#13 0xb7e5980e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:129

Thread 20 (Thread 0xa6535b40 (LWP 19093)):
#0  0xb7fdc424 in __kernel_vsyscall ()
#1  0xb7e503b9 in ioctl () at ../sysdeps/unix/syscall-template.S:81
#2  0xb2abdd15 in uki_firegl_MicroSleep () from /usr/lib/libatiuki.so.1
#3  0xa896dcd3 in ?? () from /usr/X11R6/lib/modules/dri/fglrx_dri.so
#4  0xb7e5980e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:129

Thread 12 (Thread 0xacfe6b40 (LWP 19083)):
#0  0xb7fdc424 in __kernel_vsyscall ()
#1  0xb7e4de3b in poll () at ../sysdeps/unix/syscall-template.S:81
#2  0xb2d914e5 in ICEConnectionWorker (data=0x8768480) at /data/opt/libreoffice/master/vcl/unx/generic/app/sm.cxx:637
#3  0xb7fa20ea in osl_thread_start_Impl (pData=0x86bc6b8) at /data/opt/libreoffice/master/sal/osl/unx/thread.c:237
#4  0xb7d5407a in start_thread (arg=0xacfe6b40) at pthread_create.c:309
#5  0xb7e5980e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:129

Thread 9 (Thread 0xafb23b40 (LWP 19078)):
#0  0xb7fdc424 in __kernel_vsyscall ()
#1  0xb7e4de3b in poll () at ../sysdeps/unix/syscall-template.S:81
#2  0xb2da2ac0 in x11::SelectionManager::dispatchEvent (this=0xb03fb240, millisec=-1)
    at /data/opt/libreoffice/master/vcl/unx/generic/dtrans/X11_selection.cxx:3639
#3  0xb2da2c24 in x11::SelectionManager::run (pThis=0xb03fb240) at /data/opt/libreoffice/master/vcl/unx/generic/dtrans/X11_selection.cxx:3676
---Type <return> to continue, or q <return> to quit---
#4  0xb7fa20ea in osl_thread_start_Impl (pData=0x878a5d0) at /data/opt/libreoffice/master/sal/osl/unx/thread.c:237
#5  0xb7d5407a in start_thread (arg=0xafb23b40) at pthread_create.c:309
#6  0xb7e5980e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:129

Thread 6 (Thread 0xb24bcb40 (LWP 19074)):
#0  0xb7fdc424 in __kernel_vsyscall ()
#1  0xb7e4de3b in poll () at ../sysdeps/unix/syscall-template.S:81
#2  0xb5dca28b in poll (__timeout=__timeout@entry=-1, __nfds=__nfds@entry=2, __fds=__fds@entry=0x86b62c0) at /usr/include/bits/poll2.h:46
#3  g_poll (fds=fds@entry=0x86b62c0, nfds=nfds@entry=2, timeout=timeout@entry=-1) at gpoll.c:124
#4  0xb5dbb408 in g_main_context_poll (priority=2147483647, n_fds=2, fds=0x86b62c0, timeout=-1, context=0x86ad6b0) at gmain.c:4028
#5  g_main_context_iterate (context=context@entry=0x86ad6b0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
    at gmain.c:3729
#6  0xb5dbb548 in g_main_context_iteration (context=0x86ad6b0, may_block=may_block@entry=1) at gmain.c:3795
#7  0xb5dbb59e in glib_worker_main (data=0x0) at gmain.c:5541
#8  0xb5de1c5a in g_thread_proxy (data=0x8509630) at gthread.c:764
#9  0xb7d5407a in start_thread (arg=0xb24bcb40) at pthread_create.c:309
#10 0xb7e5980e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:129

Thread 5 (Thread 0xb124fb40 (LWP 19073)):
#0  0xb7fdc424 in __kernel_vsyscall ()
#1  0xb7e4de3b in poll () at ../sysdeps/unix/syscall-template.S:81
#2  0xb5dca28b in poll (__timeout=__timeout@entry=-1, __nfds=__nfds@entry=2, __fds=__fds@entry=0x854cf90) at /usr/include/bits/poll2.h:46
#3  g_poll (fds=fds@entry=0x854cf90, nfds=nfds@entry=2, timeout=timeout@entry=-1) at gpoll.c:124
#4  0xb5dbb408 in g_main_context_poll (priority=2147483647, n_fds=2, fds=0x854cf90, timeout=-1, context=0x854c910) at gmain.c:4028
#5  g_main_context_iterate (context=0x854c910, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3729
#6  0xb5dbb78b in g_main_loop_run (loop=0x854ca30) at gmain.c:3928
#7  0xb5fb6d4a in gdbus_shared_thread_func (user_data=0x854c8f8) at gdbusprivate.c:273
#8  0xb5de1c5a in g_thread_proxy (data=0x8509430) at gthread.c:764
#9  0xb7d5407a in start_thread (arg=0xb124fb40) at pthread_create.c:309
#10 0xb7e5980e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:129

Thread 4 (Thread 0xb1cbbb40 (LWP 19072)):
#0  0xb7fdc424 in __kernel_vsyscall ()
#1  0xb7e5ac28 in accept () at ../sysdeps/unix/sysv/linux/i386/socket.S:95
#2  0xb7fa00fe in osl_acceptPipe (pPipe=0x84d16b0) at /data/opt/libreoffice/master/sal/osl/unx/pipe.c:452
#3  0xb7f70a01 in accept (Connection=..., this=0x84d0fe4) at /data/opt/libreoffice/master/include/osl/pipe.hxx:132
#4  desktop::OfficeIPCThread::execute (this=0x84d0fd0) at /data/opt/libreoffice/master/desktop/source/app/officeipcthread.cxx:678
#5  0xb791422e in salhelper::Thread::run (this=0x84d0fd0) at /data/opt/libreoffice/master/salhelper/source/thread.cxx:40
---Type <return> to continue, or q <return> to quit---
#6  0xb79143b3 in osl::threadFunc (param=0x84d0fd8) at /data/opt/libreoffice/master/include/osl/thread.hxx:187
#7  0xb7fa20ea in osl_thread_start_Impl (pData=0x84d09c0) at /data/opt/libreoffice/master/sal/osl/unx/thread.c:237
#8  0xb7d5407a in start_thread (arg=0xb1cbbb40) at pthread_create.c:309
#9  0xb7e5980e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:129

Thread 2 (Thread 0xb3f7bb40 (LWP 19070)):
#0  0xb7fdc424 in __kernel_vsyscall ()
#1  0xb7d5831e in pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:245
#2  0xb7e66924 in __pthread_cond_timedwait (cond=0xb7fd81a8 <g_cache_list+352>, mutex=0xb7fd8048 <g_cache_list>, abstime=0xb3f7b2b8)
    at forward.c:162
#3  0xb7fa6931 in rtl_cache_wsupdate_wait (seconds=10) at /data/opt/libreoffice/master/sal/rtl/alloc_cache.cxx:1348
#4  rtl_cache_wsupdate_all (arg=0xa) at /data/opt/libreoffice/master/sal/rtl/alloc_cache.cxx:1489
#5  0xb7d5407a in start_thread (arg=0xb3f7bb40) at pthread_create.c:309
#6  0xb7e5980e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:129

Thread 1 (Thread 0xb3f8d780 (LWP 19066)):
#0  0xb7fdc424 in __kernel_vsyscall ()
#1  0xb7d552f0 in pthread_join (threadid=2914802496, thread_return=0x0) at pthread_join.c:92
#2  0xb7fa2439 in osl_joinWithThread (Thread=0xae38440) at /data/opt/libreoffice/master/sal/osl/unx/thread.c:443
#3  0xa95b0a75 in osl::Thread::join (this=0xa336558) at /data/opt/libreoffice/master/include/osl/thread.hxx:114
#4  0xa95ac927 in chart::GL3DBarChart::moveToCorner (this=0xa8bc740)
    at /data/opt/libreoffice/master/chart2/source/view/charttypes/GL3DBarChart.cxx:1006
#5  0xa95acacb in chart::GL3DBarChart::mouseDragMove (this=0xa8bc740, rStartPos=Point = {...}, rEndPos=Point = {...})
    at /data/opt/libreoffice/master/chart2/source/view/charttypes/GL3DBarChart.cxx:955
#6  0xb040f24a in OpenGLWindow::MouseButtonUp (this=0xa3c6230, rMEvt=...) at /data/opt/libreoffice/master/vcl/source/window/openglwin.cxx:77
#7  0xb69bc0a0 in ImplHandleMouseEvent (pWindow=0x87f3120, nSVEvent=2, bMouseLeave=false, nX=871, nY=817, nMsgTime=37654929, nCode=1, 
    nMode=<optimized out>) at /data/opt/libreoffice/master/vcl/source/window/winproc.cxx:746
#8  0xb69bd7fc in ImplHandleSalMouseButtonUp (pWindow=0x87f3120, pEvent=0xbfffe7a0)
    at /data/opt/libreoffice/master/vcl/source/window/winproc.cxx:1997
#9  0xb69bc6bf in ImplWindowFrameProc (pWindow=0x87f3120, nEvent=4, pEvent=0xbfffe7a0)
    at /data/opt/libreoffice/master/vcl/source/window/winproc.cxx:2352
#10 0xb2db9bb5 in CallCallback (pEvent=0xbfffe7a0, nEvent=<optimized out>, this=<optimized out>)
    at /data/opt/libreoffice/master/vcl/inc/salframe.hxx:243
#11 X11SalObject::Dispatch (pEvent=0xbfffe94c) at /data/opt/libreoffice/master/vcl/unx/generic/window/salobj.cxx:473
#12 0xb36c1662 in GtkSalDisplay::filterGdkEvent (this=0x84fe000, sys_event=0xbfffe94c)
    at /data/opt/libreoffice/master/vcl/unx/gtk/app/gtkdata.cxx:167
#13 0xb30691ce in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#14 0xb306aadb in ?? () from /usr/lib/libgdk-x11-2.0.so.0
---Type <return> to continue, or q <return> to quit---
#15 0xb306ab8d in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#16 0xb5dbb203 in g_main_dispatch (context=0x84fcc58, context@entry=0x84fcb80) at gmain.c:3064
#17 g_main_context_dispatch (context=context@entry=0x84fcc58) at gmain.c:3663
#18 0xb5dbb488 in g_main_context_iterate (context=context@entry=0x84fcc58, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
    at gmain.c:3734
#19 0xb5dbb548 in g_main_context_iteration (context=0x84fcc58, may_block=1) at gmain.c:3795
#20 0xb36c2802 in GtkData::Yield (this=0x805f3a8, bWait=true, bHandleAllCurrentEvents=false)
    at /data/opt/libreoffice/master/vcl/unx/gtk/app/gtkdata.cxx:575
#21 0xb36c3244 in GtkInstance::Yield (this=0x805f358, bWait=true, bHandleAllCurrentEvents=false)
    at /data/opt/libreoffice/master/vcl/unx/gtk/app/gtkinst.cxx:423
#22 0xb6b1fc47 in ImplYield (i_bWait=true, i_bAllEvents=false) at /data/opt/libreoffice/master/vcl/source/app/svapp.cxx:360
#23 0xb6b1d97f in Application::Yield () at /data/opt/libreoffice/master/vcl/source/app/svapp.cxx:392
#24 0xb6b1d9b1 in Application::Execute () at /data/opt/libreoffice/master/vcl/source/app/svapp.cxx:341
#25 0xb7f5a327 in desktop::Desktop::Main (this=0xbfffed8c) at /data/opt/libreoffice/master/desktop/source/app/app.cxx:1682
#26 0xb6b21a0d in ImplSVMain () at /data/opt/libreoffice/master/vcl/source/app/svmain.cxx:160
#27 0xb6b21adf in SVMain () at /data/opt/libreoffice/master/vcl/source/app/svmain.cxx:193
#28 0xb7f72216 in soffice_main () at /data/opt/libreoffice/master/desktop/source/app/sofficemain.cxx:93
#29 0x080485ac in sal_main () at /data/opt/libreoffice/master/desktop/source/app/main.c:48
#30 main (argc=2, argv=0xbfffeeb4) at /data/opt/libreoffice/master/desktop/source/app/main.c:47
(gdb)
Comment 1 Michael Meeks 2014-09-10 15:22:57 UTC
(gdb) t 120
(gdb) up
...
(gdb) p *mutex
$2 = {__data = {__lock = 2, __count = 1, __owner = 19066, __kind = 1, __nusers = 1, {d = {__espins = 0, __elision = 0}, __list = {
        __next = 0x0}}}, __size = "\002\000\000\000\001\000\000\000zJ\000\000\001\000\000\000\001\000\000\000\000\000\000", __align = 2}

So - the main thread holds the mutex we want in thread 120; its not entirely clear how that can happen I guess - digging further & re-factoring the mess with thread launching / joining generally ...
Comment 2 Michael Meeks 2014-09-10 15:57:33 UTC
Fix pushed to master; threading is unpleasant like that...
Comment 3 Commit Notification 2014-09-10 16:08:39 UTC
Michael Meeks committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=778dd8f6f1b272c01e848235613d839b9c42b07b

fdo#83716 - fix deadlock holding mutex required by rendering thread.



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.