GNOME Bugzilla – Bug 578452
rhythmbox core dump when enable THREAD_ERROR_DETECTION
Last modified: 2009-04-09 08:42:05 UTC
Please describe the problem: Error Message as below " *** _THREAD_ERROR_DETECTION: lock usage error detected *** mutex_unlock(0x1eaca8): calling thread does not own the lock calling thread is 0xfab21a00 thread-id 5 the lock is unowned " Steps to reproduce: 1. export LIBTHREAD_ERROR_DETECTION="3" 2. start rhythmbox 3. it core dump Actual results: Expected results: Does this happen every time? Other information:
call stack: ff2c5604 _lwp_kill (f46fb9b8, 4fc8, 5, ff35bd94, ff354000, ff35c5e8) + 8 ff2acb0c lock_error (1d47, 1c00, 0, 0, ff34013c, ff3581d0) + 34c ff2b9b70 mutex_unlock_internal (1eaca8, 0, ff358300, 0, fab21a00, ff354000) + 78 ff14168c process_added_entries_cb (9ec080, 0, 232030, 0, 17af30, ff18f070) + 114 fe835468 g_hash_table_foreach_remove_or_steal (1, ff141578, 232030, 1, 1, c) + 3c ff141984 rhythmdb_commit_internal (232030, fffb27a8, 3c3ee8, fe8eeb50, 4d800, 232048) + a8 ff154358 rhythmdb_tree_load (232030, 1ac760, f46fbf3c, 3ac00, 949600, 3b800) + 140 ff144828 rhythmdb_load_thread_main (232030, ff2b98b0, fe8eeb54, fe8eeb50, ff18f070, 22ee20) + 64 fe86fa90 g_thread_create_proxy (3c3ee8, fe8eebc8, 2404, fe8eeb4c, fe8eeb88, fe8eebc8) + 160 ff2c09a8 _lwp_start (0, 0, 0, 0, 0, 0)
In rhythmdb.c line 1314, it call g_mutex_lock (db->priv->stat_mutex) and call g_mutex_unlock on line 1321, but in line 1316, it calls rhythmdb_add_to_stat_list to unlock stat_mutex already see line 3001 call g_mutext_unlock twice cause this core dump remove the second one will fix this bug.
Created attachment 132389 [details] [review] patch
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find. I already fixed this a while ago. *** This bug has been marked as a duplicate of 576238 ***
yeah, you fix it. but I prefer that g_mutex_lock and g_mutex_unlock come in pair, not one is in function A, another is in function B.