New commits:
http://git.directfb.org/?p=core/DirectFB.git;a=commit;h=689a97a85fa0c79c1ab2ff60803d950506d346de
commit 689a97a85fa0c79c1ab2ff60803d950506d346de
Author: Ville Syrjala <[email protected]>
Date: Sat May 16 00:31:45 2009 +0300
layers: Prevent deadlock when destroying context
A deadlock can happen between the input device shared reactor global
lock and the layer context lock if the layer context destruction and
input even processing happen at the same time since the code paths
acquire the locks in different order. Fix the problem by detaching the
input devices from the windowstack before taking the layer context lock
in the context destruction path. Nothing ever modifies the
windowstack's device list so AFAICS it should be safe to do this
without holding the layer context lock.
This is a backtrace of the deadlock:
Thread 13 (Thread 0x436a7950 (LWP 6158)):
0 0x00007f23b8125117 in ioctl () from /lib/libc.so.6
1 0x00007f23b95982ee in fusion_skirmish_prevail ()
from /usr/local/lib/libfusion-1.3.so.0
2 0x00007f23b9846604 in dfb_layer_context_lock ()
from /usr/local/lib/libdirectfb-1.3.so.0
3 0x00007f23b985690e in _dfb_windowstack_inputdevice_listener ()
from /usr/local/lib/libdirectfb-1.3.so.0
4 0x00007f23b959a12c in fusion_reactor_dispatch_channel ()
from /usr/local/lib/libfusion-1.3.so.0
5 0x00007f23b9843dff in dfb_input_dispatch ()
from /usr/local/lib/libdirectfb-1.3.so.0
6 0x00007f23b5a4b1f6 in linux_input_EventThread ()
from
/usr/local/lib/directfb-1.3-0/inputdrivers/libdirectfb_linux_input.so
7 0x00007f23b9387ec6 in direct_thread_main ()
from /usr/local/lib/libdirect-1.3.so.0
8 0x00007f23b904e087 in start_thread () from /lib/libpthread.so.0
9 0x00007f23b812bccd in clone () from /lib/libc.so.6
10 0x0000000000000000 in ?? ()
Thread 18 (Thread 0x40832950 (LWP 6153)):
0 0x00007f23b8125117 in ioctl () from /lib/libc.so.6
1 0x00007f23b95982ee in fusion_skirmish_prevail ()
from /usr/local/lib/libfusion-1.3.so.0
2 0x00007f23b959944a in fusion_reactor_detach_global ()
from /usr/local/lib/libfusion-1.3.so.0
3 0x00007f23b98574cd in dfb_windowstack_destroy ()
from /usr/local/lib/libdirectfb-1.3.so.0
4 0x00007f23b98476f8 in context_destructor ()
from /usr/local/lib/libdirectfb-1.3.so.0
5 0x00007f23b959900e in object_reference_watcher ()
from /usr/local/lib/libfusion-1.3.so.0
6 0x00007f23b9595026 in _fusion_call_process ()
from /usr/local/lib/libfusion-1.3.so.0
7 0x00007f23b9596d5a in fusion_dispatch_loop ()
from /usr/local/lib/libfusion-1.3.so.0
8 0x00007f23b9387ec6 in direct_thread_main ()
from /usr/local/lib/libdirect-1.3.so.0
9 0x00007f23b904e087 in start_thread () from /lib/libpthread.so.0
10 0x00007f23b812bccd in clone () from /lib/libc.so.6
11 0x0000000000000000 in ?? ()
src/core/layer_context.c | 7 +++++++
src/core/windowstack.c | 10 +++++++++-
src/core/windowstack.h | 2 ++
3 files changed, 18 insertions(+), 1 deletions(-)
_______________________________________________
directfb-cvs mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-cvs