Dbus calls interlock issue

Kaustubh Atrawalkar kaustubh.ra at gmail.com
Fri Feb 13 04:20:32 PST 2009


I have a server running with SIGCHILD handler. In sig_child handler i am
cleaning up child information and sending a dbus call with pid of the child
died. In the same server there a dbus call to launch a child from client.
Now the scenario is if there is a launching call processing (dbus call) by
server and at the same time another child dies, as the dbus has some lock
hold with it for server sig_child cannot send out the dbus call and it waits
for the launch call to release the lock. and the system goes in dead lock.
Is there any way to solve the issue?
Attached the backtrace for deadlock scenario.

0x400c65ac in _dbus_condvar_wait (cond=0xabcdef2, mutex=0xabcdef)
    at dbus-threads.c:253
253     dbus-threads.c: No such file or directory.
        in dbus-threads.c
(gdb)
(gdb) bt
*#0  0x400c65ac in _dbus_condvar_wait (cond=0xabcdef2, mutex=0xabcdef)
    at dbus-threads.c:253*
#1  0x400b3a68 in _dbus_connection_acquire_io_path (connection=0x3f560,
    timeout_milliseconds=-1) at dbus-connection.c:1040
#2  0x400b3e34 in _dbus_connection_do_iteration_unlocked (
    connection=0xabcdef2, flags=7, timeout_milliseconds=11259375)
    at dbus-connection.c:1134
#3  0x400b4e88 in _dbus_connection_flush_unlocked (connection=0xabcdef2)
    at dbus-connection.c:3230
#4  0x400b5df8 in _dbus_connection_block_pending_call (pending=0x53ca0)
    at dbus-connection.c:2234
#5  0x400b52e0 in dbus_connection_send_with_reply_and_block (
    connection=0x3f560, message=<value optimized out>,
    timeout_milliseconds=-1, error=0xbecfc978) at dbus-connection.c:3186
#6  0x4004fa68 in gconf_engine_all_dirs () from
/usr/local/lib/libgconf-2.so.4
#7  0x4004a5bc in gconf_client_all_dirs () from
/usr/local/lib/libgconf-2.so.4
#8  0x404e972c in azingo_app_mgr_daemon_clear_appinfo (pp=329464)
    at azingo-app-plugin.c:776
*#9  <signal handler called>
#10 0x402c1b50 in poll () from /lib/libc.so.6
#11 0x400c83a0 in socket_do_iteration (transport=0x3f1c8, flags=6,
    timeout_milliseconds=25000) at dbus-transport-socket.c:1028*
#12 0x400c6db8 in _dbus_transport_do_iteration (transport=0x3f1c8, flags=6,
    timeout_milliseconds=25000) at dbus-transport.c:778
#13 0x400b3e4c in _dbus_connection_do_iteration_unlocked
(connection=0x3f560,
    flags=6, timeout_milliseconds=25000) at dbus-connection.c:1139
#14 0x400b5eb0 in _dbus_connection_block_pending_call (pending=0x52ce0)
    at dbus-connection.c:2263
#15 0x400b52e0 in dbus_connection_send_with_reply_and_block (
    connection=0x3f560, message=<value optimized out>,
    timeout_milliseconds=-1, error=0xbecfcee4) at dbus-connection.c:3186
#16 0x4004f554 in gconf_engine_dir_exists ()
   from /usr/local/lib/libgconf-2.so.4
#17 0x4004a478 in gconf_client_dir_exists ()
   from /usr/local/lib/libgconf-2.so.4
#18 0x0000bae4 in __app_get_type_and_path (app_id=1028,
    model_type=0xbecfd76c " :\005", exec_path=0xbecfd66c "\204�\f@��\003",
    error_code=0x517e0) at app-server.c:238
#19 0x0000bf34 in Server_Object_app_launch_call (
    pObject=<value optimized out>, app_id=1028, param=0x4d0a0 "",
    app_model_data=<value optimized out>, inst_id=0x517d8,
error_code=0x517e0)
    at app-server.c:788
#20 0x0000a2dc in
dbus_glib_marshal_Server_Object_BOOLEAN__INT_STRING_UINT_POINTER_POINTER_POINTER
(closure=0xbecfd9b8, return_value=0xbecfd988,
    n_param_values=<value optimized out>, param_values=0x539f0,
    invocation_hint=0x0, marshal_data=0xbe94) at app-server.h:99
#21 0x40079fe8 in gobject_message_function ()
   from /usr/local/lib/libdbus-glib-1.so.2
#22 0x400c1614 in _dbus_object_tree_dispatch_and_unlock (tree=0x3b528,
    message=0x51b28) at dbus-object-tree.c:842
#23 0x400b450c in dbus_connection_dispatch (connection=0x3b6f8)
    at dbus-connection.c:4308
#24 0x40076f08 in message_queue_dispatch ()
   from /usr/local/lib/libdbus-glib-1.so.2
#25 0x4016527c in g_main_dispatch (context=<value optimized out>)
    at gmain.c:2009
#26 IA__g_main_context_dispatch (context=0x35258) at gmain.c:2561
#27 0x401689c4 in g_main_context_iterate (context=0x35258, block=1,
    dispatch=1075847620, self=<value optimized out>) at gmain.c:2642
#28 0x40168cd0 in IA__g_main_loop_run (loop=0x3e308) at gmain.c:2850
#29 0x0000c514 in main (argc=<value optimized out>,
    argv=<value optimized out>) at app-server.c:1474

Mem: 75868K used, 11468K free, 0K shrd, 2364K buff, 29216K cached
CPU:  99% usr   0% sys   0% nice   0% idle   0% io   0% irq   0% softirq
Load average: 2.13 2.38 1.74
  PID  PPID USER     STAT   VSZ %MEM %CPU COMMAND
 1365   442 root     R    23244  27%  96% /usr/local/bin/app-server
 1636  1590 root     R     2944   3%   1% top
  277     2 root     RW       0   0%   1% [msmfb_refresh]
  516     1 root     S <   1468   2%   0% /sbin/udevd --daemon
 1520  1365 root     S    18588  21%   0% /usr/local/bin//call
1351     1 root     S     8528  10%   0%
/usr/local/bin/matchbox-window-manage
 1113     1 root     S     2872   3%   0% /sbin/syslogd -s 2000 -b 5 -O
/var/lo
  438     2 root     RW<      0   0%   0% [mmcqd]
  554     1 root     S    23912  27%   0%
/usr/local/bin/e_addressbook_factory
 1514  1365 root     S    21856  25%   0% /usr/local/bin//ampvkb
 1534     1 root     S    21708  25%   0% /usr/local/bin/cm_server
--plugin=lge
 1570  1365 root     S    19940  23%   0% /usr/local/bin//switcher
C328     1 root     S    17780  20%   0% /usr/local/bin/Xpxa270 -br -mouse
tsl


Cheers,
- Kaustubh (aka. Silverroots)
[www.kaustubh.org]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/dbus/attachments/20090213/2b247bcc/attachment.html 


More information about the dbus mailing list