After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 578452 - rhythmbox core dump when enable THREAD_ERROR_DETECTION
rhythmbox core dump when enable THREAD_ERROR_DETECTION
Status: RESOLVED DUPLICATE of bug 576238
Product: rhythmbox
Classification: Other
Component: general
0.12.x
Other All
: Normal major
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-04-09 06:18 UTC by jerry tan
Modified: 2009-04-09 08:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (306 bytes, patch)
2009-04-09 06:37 UTC, jerry tan
none Details | Review

Description jerry tan 2009-04-09 06:18:34 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:
Comment 1 jerry tan 2009-04-09 06:18:57 UTC
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)
Comment 2 jerry tan 2009-04-09 06:36:34 UTC
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.

Comment 3 jerry tan 2009-04-09 06:37:24 UTC
Created attachment 132389 [details] [review]
patch
Comment 4 Jonathan Matthew 2009-04-09 07:28:40 UTC
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 ***
Comment 5 jerry tan 2009-04-09 08:42:05 UTC
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.