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? <br>
Attached the backtrace for deadlock scenario.<br><br>0x400c65ac in _dbus_condvar_wait (cond=0xabcdef2, mutex=0xabcdef)<br>&nbsp;&nbsp;&nbsp; at dbus-threads.c:253<br>253&nbsp;&nbsp;&nbsp;&nbsp; dbus-threads.c: No such file or directory.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in dbus-threads.c<br>
(gdb) <br>(gdb) bt<br><b>#0&nbsp; 0x400c65ac in _dbus_condvar_wait (cond=0xabcdef2, mutex=0xabcdef)<br>&nbsp;&nbsp;&nbsp; at dbus-threads.c:253</b><br>#1&nbsp; 0x400b3a68 in _dbus_connection_acquire_io_path (connection=0x3f560, <br>&nbsp;&nbsp;&nbsp; timeout_milliseconds=-1) at dbus-connection.c:1040<br>
#2&nbsp; 0x400b3e34 in _dbus_connection_do_iteration_unlocked (<br>&nbsp;&nbsp;&nbsp; connection=0xabcdef2, flags=7, timeout_milliseconds=11259375)<br>&nbsp;&nbsp;&nbsp; at dbus-connection.c:1134<br>#3&nbsp; 0x400b4e88 in _dbus_connection_flush_unlocked (connection=0xabcdef2)<br>
&nbsp;&nbsp;&nbsp; at dbus-connection.c:3230<br>#4&nbsp; 0x400b5df8 in _dbus_connection_block_pending_call (pending=0x53ca0)<br>&nbsp;&nbsp;&nbsp; at dbus-connection.c:2234<br>#5&nbsp; 0x400b52e0 in dbus_connection_send_with_reply_and_block (<br>&nbsp;&nbsp;&nbsp; connection=0x3f560, message=&lt;value optimized out&gt;, <br>
&nbsp;&nbsp;&nbsp; timeout_milliseconds=-1, error=0xbecfc978) at dbus-connection.c:3186<br>#6&nbsp; 0x4004fa68 in gconf_engine_all_dirs () from /usr/local/lib/libgconf-2.so.4<br>#7&nbsp; 0x4004a5bc in gconf_client_all_dirs () from /usr/local/lib/libgconf-2.so.4<br>
#8&nbsp; 0x404e972c in azingo_app_mgr_daemon_clear_appinfo (pp=329464)<br>&nbsp;&nbsp;&nbsp; at azingo-app-plugin.c:776<br><b>#9&nbsp; &lt;signal handler called&gt;<br>#10 0x402c1b50 in poll () from /lib/libc.so.6<br>#11 0x400c83a0 in socket_do_iteration (transport=0x3f1c8, flags=6, <br>
&nbsp;&nbsp;&nbsp; timeout_milliseconds=25000) at dbus-transport-socket.c:1028</b><br>#12 0x400c6db8 in _dbus_transport_do_iteration (transport=0x3f1c8, flags=6, <br>&nbsp;&nbsp;&nbsp; timeout_milliseconds=25000) at dbus-transport.c:778<br>#13 0x400b3e4c in _dbus_connection_do_iteration_unlocked (connection=0x3f560, <br>
&nbsp;&nbsp;&nbsp; flags=6, timeout_milliseconds=25000) at dbus-connection.c:1139<br>#14 0x400b5eb0 in _dbus_connection_block_pending_call (pending=0x52ce0)<br>&nbsp;&nbsp;&nbsp; at dbus-connection.c:2263<br>#15 0x400b52e0 in dbus_connection_send_with_reply_and_block (<br>
&nbsp;&nbsp;&nbsp; connection=0x3f560, message=&lt;value optimized out&gt;, <br>&nbsp;&nbsp;&nbsp; timeout_milliseconds=-1, error=0xbecfcee4) at dbus-connection.c:3186<br>#16 0x4004f554 in gconf_engine_dir_exists ()<br>&nbsp;&nbsp; from /usr/local/lib/libgconf-2.so.4<br>
#17 0x4004a478 in gconf_client_dir_exists ()<br>&nbsp;&nbsp; from /usr/local/lib/libgconf-2.so.4<br>#18 0x0000bae4 in __app_get_type_and_path (app_id=1028, <br>&nbsp;&nbsp;&nbsp; model_type=0xbecfd76c &quot; :\005&quot;, exec_path=0xbecfd66c &quot;\204�\f@��\003&quot;, <br>
&nbsp;&nbsp;&nbsp; error_code=0x517e0) at app-server.c:238<br>#19 0x0000bf34 in Server_Object_app_launch_call (<br>&nbsp;&nbsp;&nbsp; pObject=&lt;value optimized out&gt;, app_id=1028, param=0x4d0a0 &quot;&quot;, <br>&nbsp;&nbsp;&nbsp; app_model_data=&lt;value optimized out&gt;, inst_id=0x517d8, error_code=0x517e0)<br>
&nbsp;&nbsp;&nbsp; at app-server.c:788<br>#20 0x0000a2dc in dbus_glib_marshal_Server_Object_BOOLEAN__INT_STRING_UINT_POINTER_POINTER_POINTER (closure=0xbecfd9b8, return_value=0xbecfd988, <br>&nbsp;&nbsp;&nbsp; n_param_values=&lt;value optimized out&gt;, param_values=0x539f0, <br>
&nbsp;&nbsp;&nbsp; invocation_hint=0x0, marshal_data=0xbe94) at app-server.h:99<br>#21 0x40079fe8 in gobject_message_function ()<br>&nbsp;&nbsp; from /usr/local/lib/libdbus-glib-1.so.2<br>#22 0x400c1614 in _dbus_object_tree_dispatch_and_unlock (tree=0x3b528, <br>
&nbsp;&nbsp;&nbsp; message=0x51b28) at dbus-object-tree.c:842<br>#23 0x400b450c in dbus_connection_dispatch (connection=0x3b6f8)<br>&nbsp;&nbsp;&nbsp; at dbus-connection.c:4308<br>#24 0x40076f08 in message_queue_dispatch ()<br>&nbsp;&nbsp; from /usr/local/lib/libdbus-glib-1.so.2<br>
#25 0x4016527c in g_main_dispatch (context=&lt;value optimized out&gt;)<br>&nbsp;&nbsp;&nbsp; at gmain.c:2009<br>#26 IA__g_main_context_dispatch (context=0x35258) at gmain.c:2561<br>#27 0x401689c4 in g_main_context_iterate (context=0x35258, block=1, <br>
&nbsp;&nbsp;&nbsp; dispatch=1075847620, self=&lt;value optimized out&gt;) at gmain.c:2642<br>#28 0x40168cd0 in IA__g_main_loop_run (loop=0x3e308) at gmain.c:2850<br>#29 0x0000c514 in main (argc=&lt;value optimized out&gt;, <br>&nbsp;&nbsp;&nbsp; argv=&lt;value optimized out&gt;) at app-server.c:1474<br>
<br>Mem: 75868K used, 11468K free, 0K shrd, 2364K buff, 29216K cached<br>CPU:&nbsp; 99% usr&nbsp;&nbsp; 0% sys&nbsp;&nbsp; 0% nice&nbsp;&nbsp; 0% idle&nbsp;&nbsp; 0% io&nbsp;&nbsp; 0% irq&nbsp;&nbsp; 0% softirq<br>Load average: 2.13 2.38 1.74<br>&nbsp; PID&nbsp; PPID USER&nbsp;&nbsp;&nbsp;&nbsp; STAT&nbsp;&nbsp; VSZ %MEM %CPU COMMAND<br>
&nbsp;1365&nbsp;&nbsp; 442 root&nbsp;&nbsp;&nbsp;&nbsp; R&nbsp;&nbsp;&nbsp; 23244&nbsp; 27%&nbsp; 96% /usr/local/bin/app-server <br>&nbsp;1636&nbsp; 1590 root&nbsp;&nbsp;&nbsp;&nbsp; R&nbsp;&nbsp;&nbsp;&nbsp; 2944&nbsp;&nbsp; 3%&nbsp;&nbsp; 1% top <br>&nbsp; 277&nbsp;&nbsp;&nbsp;&nbsp; 2 root&nbsp;&nbsp;&nbsp;&nbsp; RW&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp; 0%&nbsp;&nbsp; 1% [msmfb_refresh]<br>&nbsp; 516&nbsp;&nbsp;&nbsp;&nbsp; 1 root&nbsp;&nbsp;&nbsp;&nbsp; S &lt;&nbsp;&nbsp; 1468&nbsp;&nbsp; 2%&nbsp;&nbsp; 0% /sbin/udevd --daemon <br>
&nbsp;1520&nbsp; 1365 root&nbsp;&nbsp;&nbsp;&nbsp; S&nbsp;&nbsp;&nbsp; 18588&nbsp; 21%&nbsp;&nbsp; 0% /usr/local/bin//call <br> 1351&nbsp;&nbsp;&nbsp;&nbsp; 1 root&nbsp;&nbsp;&nbsp;&nbsp; S&nbsp;&nbsp;&nbsp;&nbsp; 8528&nbsp; 10%&nbsp;&nbsp; 0% /usr/local/bin/matchbox-window-manage<br>&nbsp;1113&nbsp;&nbsp;&nbsp;&nbsp; 1 root&nbsp;&nbsp;&nbsp;&nbsp; S&nbsp;&nbsp;&nbsp;&nbsp; 2872&nbsp;&nbsp; 3%&nbsp;&nbsp; 0% /sbin/syslogd -s 2000 -b 5 -O /var/lo<br>
&nbsp; 438&nbsp;&nbsp;&nbsp;&nbsp; 2 root&nbsp;&nbsp;&nbsp;&nbsp; RW&lt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp; 0%&nbsp;&nbsp; 0% [mmcqd]<br>&nbsp; 554&nbsp;&nbsp;&nbsp;&nbsp; 1 root&nbsp;&nbsp;&nbsp;&nbsp; S&nbsp;&nbsp;&nbsp; 23912&nbsp; 27%&nbsp;&nbsp; 0% /usr/local/bin/e_addressbook_factory <br>&nbsp;1514&nbsp; 1365 root&nbsp;&nbsp;&nbsp;&nbsp; S&nbsp;&nbsp;&nbsp; 21856&nbsp; 25%&nbsp;&nbsp; 0% /usr/local/bin//ampvkb <br>&nbsp;1534&nbsp;&nbsp;&nbsp;&nbsp; 1 root&nbsp;&nbsp;&nbsp;&nbsp; S&nbsp;&nbsp;&nbsp; 21708&nbsp; 25%&nbsp;&nbsp; 0% /usr/local/bin/cm_server --plugin=lge<br>
&nbsp;1570&nbsp; 1365 root&nbsp;&nbsp;&nbsp;&nbsp; S&nbsp;&nbsp;&nbsp; 19940&nbsp; 23%&nbsp;&nbsp; 0% /usr/local/bin//switcher <br>C328&nbsp;&nbsp;&nbsp;&nbsp; 1 root&nbsp;&nbsp;&nbsp;&nbsp; S&nbsp;&nbsp;&nbsp; 17780&nbsp; 20%&nbsp;&nbsp; 0% /usr/local/bin/Xpxa270 -br -mouse tsl<br><br><br clear="all">Cheers,<br>- Kaustubh (aka. Silverroots)<br>[<a href="http://www.kaustubh.org">www.kaustubh.org</a>]<br>