Hi, thanks for your quick reply. On 10/06/2011 10:18 AM, WAROQUIERS Philippe wrote: >> ... >> valgrind with --db-aatch I can Ctrl-C and print the backtrace. the >> ... >> where are the other threads? >> ... > The --db-attach has several limitations (a.o. it only shows one thread, > you can't put breaks, continue, etc). > > You can try the 3.7.0 SVN version : this has an integrated gdbserver > allowing to fully debug your executable under valgrind (including > looking at all threads etc). > > => you must download and compile the last version from SVN. > see http://www.valgrind.org/downloads/repository.html > > Then you give the option --vgdb-error=0, and you follow the on-screen > instructions (if you build the html doc, the Valgrind gdbserver > functionalities are documented in a specific section). > > Note that to investigate deadlocks and/or race conditions, > you might try helgrind or drd. (a.o., helgrind has a lock acquisition > order verification). Unfortunately the reports in Helgrind don't look useful to be. I don't know if there is something in glib that confuses helgrind. (btw. I am using valgrind 3.6.0). Like look at this report
==22748== Thread #1: lock order "0xF941080 before 0xF934DC0" violated ==22748== at 0x4C28B0C: pthread_mutex_lock (hg_intercepts.c:465) ==22748== by 0x84369DD: gst_pad_unlink (gstpad.c:1758) ==22748== by 0x4E60F60: unlink_wire (setup.c:564) ==22748== by 0x4E650FC: del_wire_in_pipeline (setup.c:811) ==22748== by 0x98E0D72: g_hash_table_foreach (ghash.c:1325) ==22748== by 0x4E62196: bt_setup_update_pipeline (setup.c:886) ==22748== by 0x4E6296F: bt_setup_remove_wire (setup.c:1098) ==22748== by 0x40F1D8: test_btcore_net_static4 (e-network.c:374) ==22748== by 0x43B285: srunner_run_all (in /home/ensonic/projects/buzztard/buzztard/tests/.libs/lt-bt_core) ==22748== by 0x409CC6: main (m-bt-core.c:102) ==22748== Required order was established by acquisition of lock at 0xF941080 ==22748== at 0x4C28B0C: pthread_mutex_lock (hg_intercepts.c:465) ==22748== by 0x842E05D: gst_pad_link_prepare (gstpad.c:1975) ==22748== by 0x84330BC: gst_pad_link_full (gstpad.c:2113) ==22748== by 0x4E64F12: add_wire_in_pipeline (setup.c:507) ==22748== by 0x98E0D72: g_hash_table_foreach (ghash.c:1325) ==22748== by 0x4E61B69: bt_setup_update_pipeline (setup.c:878) ==22748== by 0x4E6349F: bt_setup_add_wire (setup.c:1019) ==22748== by 0x4E7B8D5: bt_wire_constructed (wire.c:1219) ==22748== by 0x8F1FA57: g_object_newv (gobject.c:1289) ==22748== by 0x8F202AC: g_object_new_valist (gobject.c:1377) ==22748== by 0x8F204F0: g_object_new (gobject.c:1095) ==22748== by 0x4E79943: bt_wire_new (wire.c:723) ==22748== by 0x40EFB2: test_btcore_net_static4 (e-network.c:350) ==22748== by 0x43B285: srunner_run_all (in /home/ensonic/projects/buzztard/buzztard/tests/.libs/lt-bt_core) ==22748== by 0x409CC6: main (m-bt-core.c:102) ==22748== followed by a later acquisition of lock at 0xF934DC0 ==22748== at 0x4C28B0C: pthread_mutex_lock (hg_intercepts.c:465) ==22748== by 0x842DB66: gst_pad_get_caps_unlocked (gstpad.c:2245) ==22748== by 0x842E3D7: gst_pad_link_prepare (gstpad.c:1852) ==22748== by 0x84330BC: gst_pad_link_full (gstpad.c:2113) ==22748== by 0x4E64F12: add_wire_in_pipeline (setup.c:507) ==22748== by 0x98E0D72: g_hash_table_foreach (ghash.c:1325) ==22748== by 0x4E61B69: bt_setup_update_pipeline (setup.c:878) ==22748== by 0x4E6349F: bt_setup_add_wire (setup.c:1019) ==22748== by 0x4E7B8D5: bt_wire_constructed (wire.c:1219) ==22748== by 0x8F1FA57: g_object_newv (gobject.c:1289) ==22748== by 0x8F202AC: g_object_new_valist (gobject.c:1377) ==22748== by 0x8F204F0: g_object_new (gobject.c:1095) ==22748== by 0x4E79943: bt_wire_new (wire.c:723) ==22748== by 0x40EFB2: test_btcore_net_static4 (e-network.c:350) ==22748== by 0x43B285: srunner_run_all (in /home/ensonic/projects/buzztard/buzztard/tests/.libs/lt-bt_core) ==22748== by 0x409CC6: main (m-bt-core.c:102) gstpad.c: 1756 GST_OBJECT_LOCK (srcpad); 1757 1758 GST_OBJECT_LOCK (sinkpad); ... 1970 GST_OBJECT_LOCK (srcpad); 1971 1972 if (G_UNLIKELY (GST_PAD_PEER (srcpad) != NULL)) 1973 goto src_was_linked; 1974 1975 GST_OBJECT_LOCK (sinkpad); 1976 1977 if (G_UNLIKELY (GST_PAD_PEER (sinkpad) != NULL)) 1978 goto sink_was_linked; ... 2243 GST_OBJECT_UNLOCK (pad); 2244 result = GST_PAD_GETCAPSFUNC (pad) (pad); 2245 GST_OBJECT_LOCK (pad); The first two snippets use the same lock order and the third snipped temporarily releases a lock. At the point where the code locks up, I get no complaint from helgrind. Will try my luck with building 3.7 now. Stefan > > Philippe > > ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1 _______________________________________________ Valgrind-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/valgrind-users
