GNOME Bugzilla – Bug 334167
Rhythmbox crashes on startup, or while loading my music library.
Last modified: 2007-01-10 01:44:58 UTC
Distribution: Ubuntu 6.04 (dapper) Package: rhythmbox Severity: critical Version: GNOME2.13.92 unspecified Gnome-Distributor: Ubuntu Synopsis: Rhythmbox crashes on startup, or while loading my music library. Bugzilla-Product: rhythmbox Bugzilla-Component: Importing Bugzilla-Version: unspecified BugBuddy-GnomeVersion: 2.0 (2.13.90) Description: Description of the crash: I have been unable to use rhythmbox for quite some time now due to the fact that it crashes whenever it hits some file in my music library. I can't figure out which file it is, and it would be nice if instead of segfaulting, it simply told me what I was doing wrong. I hope this trace is useful in debugging the crash. I'm using ubuntu dapper and have built rhythmbox myself (from the 0.9.3.1 tarballs). Steps to reproduce the crash: 1. 2. 3. Expected Results: How often does this happen? Additional Information: Debugging Information: Backtrace was generated from '/usr/bin/rhythmbox' (no debugging symbols found) Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1". (no debugging symbols found) [Thread debugging using libthread_db enabled] [New Thread 1993963200 (LWP 12684)] [New Thread 1975765936 (LWP 12687)] [New Thread 1984158640 (LWP 12686)] 0xffffe410 in __kernel_vsyscall ()
+ Trace 66835
Thread 1 (Thread 1993963200 (LWP 12684))
------- Bug created by bug-buddy at 2006-03-10 21:42 -------
Bah. I guess it got the debugging symbols from the wrong executable. I'll remove my ubuntu rhythmbox package and run through gdb. Trace is forthcoming...
burner@firefighter:/tmp/rb-g/bin$ gdb ./rhythmbox GNU gdb 6.4-debian Copyright 2005 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i486-linux-gnu"...Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1". (gdb) run Starting program: /tmp/rb-g/bin/rhythmbox [Thread debugging using libthread_db enabled] [New Thread 1993791168 (LWP 29193)] [New Thread 1983986608 (LWP 29198)] [New Thread 1975593904 (LWP 29199)] (rhythmbox:29193): Rhythmbox-WARNING **: /apps/rhythmbox/state/play_order gconf key not found! (rhythmbox:29193): Rhythmbox-WARNING **: /apps/rhythmbox/state/play_order gconf key not found! [New Thread 1975188400 (LWP 29206)] [New Thread 1966795696 (LWP 29207)] [Thread 1975188400 (LWP 29206) exited] [Thread 1966795696 (LWP 29207) exited] [New Thread 1966795696 (LWP 29209)] (rhythmbox:29193): Rhythmbox-WARNING **: error: Failed to register the shell: (null) This probably means that you installed Rhythmbox in a different prefix than bonobo-activation; this warning is harmless, but IPC will not work. [Thread 1966795696 (LWP 29209) exited] [New Thread 1966795696 (LWP 29211)] [New Thread 1975188400 (LWP 29212)] [New Thread 1956641712 (LWP 29213)] [Thread 1975188400 (LWP 29212) exited] [Thread 1956641712 (LWP 29213) exited] [Thread 1966795696 (LWP 29211) exited] [New Thread 1966795696 (LWP 29215)] [Thread 1966795696 (LWP 29215) exited] [New Thread 1966795696 (LWP 29216)] [Thread 1966795696 (LWP 29216) exited] [New Thread 1966795696 (LWP 29217)] [New Thread 1956641712 (LWP 29218)] [New Thread 1975188400 (LWP 29219)] [New Thread 1943010224 (LWP 29221)] [Thread 1943010224 (LWP 29221) exited] [New Thread 1943010224 (LWP 29224)] [Thread 1975188400 (LWP 29219) exited] [Thread 1956641712 (LWP 29218) exited] [Thread 1943010224 (LWP 29224) exited] [Thread 1966795696 (LWP 29217) exited] [New Thread 1943010224 (LWP 29225)] [New Thread 1956641712 (LWP 29226)] [New Thread 1966795696 (LWP 29227)] Program received signal SIGSEGV, Segmentation fault.
+ Trace 66836
Thread 1983986608 (LWP 29198)
Here's another backtrace acquired after simply rerunning "gdb ./rhythmbox" burner@firefighter:/tmp/rb-g/bin$ gdb ./rhythmbox GNU gdb 6.4-debian Copyright 2005 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i486-linux-gnu"...Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1". (gdb) run Starting program: /tmp/rb-g/bin/rhythmbox [Thread debugging using libthread_db enabled] [New Thread 1993967296 (LWP 29319)] [New Thread 1984162736 (LWP 29323)] [New Thread 1975770032 (LWP 29324)] (rhythmbox:29319): Rhythmbox-WARNING **: /apps/rhythmbox/state/play_order gconf key not found! (rhythmbox:29319): Rhythmbox-WARNING **: /apps/rhythmbox/state/play_order gconf key not found! [New Thread 1975364528 (LWP 29331)] [Thread 1975364528 (LWP 29331) exited] [New Thread 1975364528 (LWP 29332)] [Thread 1975364528 (LWP 29332) exited] [New Thread 1975364528 (LWP 29334)] (rhythmbox:29319): Rhythmbox-WARNING **: error: Failed to register the shell: (null) This probably means that you installed Rhythmbox in a different prefix than bonobo-activation; this warning is harmless, but IPC will not work. [Thread 1975364528 (LWP 29334) exited] [New Thread 1975364528 (LWP 29336)] [New Thread 1965030320 (LWP 29337)] [New Thread 1956637616 (LWP 29338)] [Thread 1965030320 (LWP 29337) exited] [Thread 1975364528 (LWP 29336) exited] [Thread 1956637616 (LWP 29338) exited] [New Thread 1975364528 (LWP 29340)] [Thread 1975364528 (LWP 29340) exited] [New Thread 1975364528 (LWP 29341)] [New Thread 1965030320 (LWP 29342)] [New Thread 1956637616 (LWP 29343)] [New Thread 1946155952 (LWP 29344)] [Thread 1965030320 (LWP 29342) exited] [Thread 1975364528 (LWP 29341) exited] [New Thread 1965030320 (LWP 29345)] [New Thread 1975364528 (LWP 29346)] [New Thread 1933573040 (LWP 29347)] [Thread 1933573040 (LWP 29347) exited] [Thread 1965030320 (LWP 29345) exited] [Thread 1975364528 (LWP 29346) exited] [Thread 1956637616 (LWP 29343) exited] [Thread 1946155952 (LWP 29344) exited] [New Thread 1946155952 (LWP 29355)] [New Thread 1975364528 (LWP 29356)] [New Thread 1956637616 (LWP 29357)] [New Thread 1965030320 (LWP 29358)] [Thread 1965030320 (LWP 29358) exited] [New Thread 1965030320 (LWP 29360)] RhythmDB-ERROR **: file rhythmdb.c: line 2416 (rhythmdb_entry_set_internal): assertion failed: (g_utf8_validate (g_value_get_string (value), -1, NULL)) aborting... Program received signal SIGABRT, Aborted.
+ Trace 66837
Thread 1993967296 (LWP 29319)
CVS HEAD built with the --with-metadata-helper option (which will shortly become the default) won't crash when the GStreamer pipeline does. In general, if you catch the crash in gdb, you can find out which file caused it with 'ls -l /proc/`pidof rhythmbox`/fd'. The file name sometimes appears in the stack trace, too:
+ Trace 66840
This case may well be a duplicate of bug 332964, which is fixed in the latest gst-plugins-base release. Does it happen every time for this file, or is it more or less random? The stack trace in comment #3 shows a file with an invalid artist tag. We shouldn't abort when that happens. I'm not sure what we should do instead, but crashing like that never helps.
I moved that ogg out of the Albums directory, and I still get a backtrace. RE: looking in /proc, here's what I get: burner@firefighter:~/back$ ps ax |grep rhythm 15036 pts/0 S+ 0:03 gdb ./rhythmbox 15037 pts/0 Tl 0:38 /tmp/rb-g/bin/rhythmbox 15108 pts/1 R+ 0:00 grep rhythm burner@firefighter:~/back$ ls -l /proc/15037/fd/ total 30 lrwx------ 1 burner burner 64 2006-03-10 17:59 0 -> /dev/pts/0 lrwx------ 1 burner burner 64 2006-03-10 17:59 1 -> /dev/pts/0 l-wx------ 1 burner burner 64 2006-03-10 17:59 10 -> pipe:[2611133] lr-x------ 1 burner burner 64 2006-03-10 17:59 11 -> pipe:[2611134] l-wx------ 1 burner burner 64 2006-03-10 17:59 12 -> pipe:[2611134] lrwx------ 1 burner burner 64 2006-03-10 17:59 13 -> socket:[2611135] lrwx------ 1 burner burner 64 2006-03-10 17:59 14 -> socket:[2611137] lrwx------ 1 burner burner 64 2006-03-10 17:59 15 -> socket:[2611140] lrwx------ 1 burner burner 64 2006-03-10 17:59 16 -> socket:[2611152] lrwx------ 1 burner burner 64 2006-03-10 17:59 17 -> socket:[2611162] lrwx------ 1 burner burner 64 2006-03-10 17:59 18 -> socket:[2611159] lrwx------ 1 burner burner 64 2006-03-10 17:59 19 -> socket:[2611163] lrwx------ 1 burner burner 64 2006-03-10 17:59 2 -> /dev/pts/0 lr-x------ 1 burner burner 64 2006-03-10 17:59 20 -> pipe:[2611173] l-wx------ 1 burner burner 64 2006-03-10 17:59 21 -> pipe:[2611173] lr-x------ 1 burner burner 64 2006-03-10 17:59 22 -> pipe:[2611174] l-wx------ 1 burner burner 64 2006-03-10 17:59 23 -> pipe:[2611174] lrwx------ 1 burner burner 64 2006-03-10 17:59 24 -> socket:[2611204] lrwx------ 1 burner burner 64 2006-03-10 17:59 25 -> socket:[2611207] lrwx------ 1 burner burner 64 2006-03-10 17:59 26 -> socket:[2611218] lrwx------ 1 burner burner 64 2006-03-10 17:59 27 -> socket:[2611222] lr-x------ 1 burner burner 64 2006-03-10 17:59 29 -> inotify lr-x------ 1 burner burner 64 2006-03-10 17:59 3 -> pipe:[2611083] lrwx------ 1 burner burner 64 2006-03-10 17:59 30 -> socket:[2611238] l-wx------ 1 burner burner 64 2006-03-10 17:59 4 -> pipe:[2611083] lr-x------ 1 burner burner 64 2006-03-10 17:59 5 -> /tmp/rb-g/bin/rhythmbox lrwx------ 1 burner burner 64 2006-03-10 17:59 6 -> socket:[2611150] lr-x------ 1 burner burner 64 2006-03-10 17:59 7 -> pipe:[2611132] l-wx------ 1 burner burner 64 2006-03-10 17:59 8 -> pipe:[2611132] lr-x------ 1 burner burner 64 2006-03-10 17:59 9 -> pipe:[2611133] And here's my new trace (looks like the trace in comment #3, I think) burner@firefighter:/tmp/rb-g/bin$ gdb ./rhythmbox GNU gdb 6.4-debian Copyright 2005 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i486-linux-gnu"...Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1". (gdb) run Starting program: /tmp/rb-g/bin/rhythmbox [Thread debugging using libthread_db enabled] [New Thread 1993483968 (LWP 15037)] [New Thread 1983679408 (LWP 15041)] [New Thread 1975286704 (LWP 15042)] (rhythmbox:15037): Rhythmbox-WARNING **: /apps/rhythmbox/state/play_order gconf key not found! (rhythmbox:15037): Rhythmbox-WARNING **: /apps/rhythmbox/state/play_order gconf key not found! [New Thread 1974881200 (LWP 15049)] [Thread 1974881200 (LWP 15049) exited] [New Thread 1974881200 (LWP 15050)] [Thread 1974881200 (LWP 15050) exited] [New Thread 1974881200 (LWP 15052)] (rhythmbox:15037): Rhythmbox-WARNING **: error: Failed to register the shell: (null) This probably means that you installed Rhythmbox in a different prefix than bonobo-activation; this warning is harmless, but IPC will not work. [New Thread 1962933168 (LWP 15054)] [Thread 1974881200 (LWP 15052) exited] [New Thread 1974881200 (LWP 15055)] [New Thread 1950350256 (LWP 15056)] [Thread 1962933168 (LWP 15054) exited] [New Thread 1962933168 (LWP 15057)] [Thread 1950350256 (LWP 15056) exited] [Thread 1962933168 (LWP 15057) exited] [Thread 1974881200 (LWP 15055) exited] [New Thread 1974881200 (LWP 15059)] [Thread 1974881200 (LWP 15059) exited] [New Thread 1974881200 (LWP 15060)] [Thread 1974881200 (LWP 15060) exited] [New Thread 1974881200 (LWP 15061)] [Thread 1974881200 (LWP 15061) exited] [New Thread 1974881200 (LWP 15062)] [New Thread 1962933168 (LWP 15063)] [New Thread 1950350256 (LWP 15064)] [New Thread 1939864496 (LWP 15065)] [Thread 1939864496 (LWP 15065) exited] [New Thread 1939864496 (LWP 15066)] [New Thread 1927281584 (LWP 15067)] [Thread 1927281584 (LWP 15067) exited] RhythmDB-ERROR **: file rhythmdb.c: line 2416 (rhythmdb_entry_set_internal): assertion failed: (g_utf8_validate (g_value_get_string (value), -1, NULL)) aborting... Program received signal SIGABRT, Aborted.
+ Trace 66841
Thread 1993483968 (LWP 15037)
BTW: I also have trouble with banshee (and muine, but muine doesn't use bug-buddy). Reported as bug #334174
I guess the only way to find out what file is causing that problem is running 'rhythmbox -d 2>&1 | grep RHYTHMDB_ACTION_LOAD'. The file causing the problem will be the last one listed in the debug output. I can think of two reasonable options for how to handle invalid UTF-8 in tags: truncate the string at the end of the valid data, setting it to 'unknown' if it's empty, or report an import error for the file.
I don't think we should get tags containing invalid UTF-8 at all, gstreamer should make sure this doesn't happen (whether it's actually the case or not, I dunno, but this is what I'd expect it to do). And we obviously should make sure not to corrupt valid UTF-8 tags when writing them to rhythmdb.xml ;)
Finally found the one track that was killing rhythmbox. I'm not sure I should share it in the gnome bugzilla because I don't own the copyright on it, but email me at my bugzilla email address and I can provide it. BTW: the 'rhythmbox -d 2>&1 | grep RHYTHMDB_ACTION_LOAD' trick didn't work so well because the thread that was crashing was no the thread that was reading the files (or so I believe), so the last songs printed out didn't contain the offending song. What I eventually did was to have rhythmbox import (and watch) a folder and slowly added my songs to that folder using a shell for loop with an 8 second sleep. When rb eventually crashed, I was able to see which song had last been copied in and removed it from my library. mike
This bug was also reported here: https://launchpad.net/distros/ubuntu/+source/rhythmbox/+bug/33680
*** Bug 332623 has been marked as a duplicate of this bug. ***
Created attachment 61220 [details] [review] totally untested patch I don't have any broken files to test with, but this should convert invalid utf8 characters to question marks, rather than aborting when one is encountered. If anyone experiencing this problem could test this patch, it would be much appreciated.
Hmm.. I tried the patch against RB 0.9.3.1 and some hunks failed. Which version is the patch against? burner@phoenix:~/Desktop/rhythmbox-0.9.3.1$ cat ../rb.patch | patch can't find file to patch at input line 3 Perhaps you should have used the -p or --strip option? The text leading up to this was: -------------------------- |--- old-argh/lib/rb-util.h 2006-03-14 21:04:18.000000000 +1000 |+++ new-argh/lib/rb-util.h 2006-03-14 21:04:18.000000000 +1000 -------------------------- File to patch: lib/rb-util.h patching file lib/rb-util.h Hunk #1 succeeded at 52 with fuzz 2 (offset -7 lines). can't find file to patch at input line 15 Perhaps you should have used the -p or --strip option? The text leading up to this was: -------------------------- | |--- old-argh/lib/rb-util.c 2006-03-14 21:04:18.000000000 +1000 |+++ new-argh/lib/rb-util.c 2006-03-14 21:04:18.000000000 +1000 -------------------------- File to patch: lib/rb-util.c patching file lib/rb-util.c Hunk #1 FAILED at 667. 1 out of 1 hunk FAILED -- saving rejects to file lib/rb-util.c.rej can't find file to patch at input line 60 Perhaps you should have used the -p or --strip option? The text leading up to this was: -------------------------- | |--- old-argh/rhythmdb/rhythmdb.c 2006-03-14 21:04:18.000000000 +1000 |+++ new-argh/rhythmdb/rhythmdb.c 2006-03-14 21:04:18.000000000 +1000 -------------------------- File to patch: rhythmdb/rhythmdb.c patching file rhythmdb/rhythmdb.c Hunk #1 FAILED at 2456. Hunk #2 succeeded at 2580 (offset -56 lines). 1 out of 2 hunks FAILED -- saving rejects to file rhythmdb/rhythmdb.c.rej
Created attachment 61223 [details] [review] totally untested patch for 0.9.3.1 The previous patch is against CVS HEAD. This should apply to 0.9.3.1 cleanly. I haven't even run the resulting binary, though.
Is that normal that we end up with non-UTF-8 data in rhythmdb_entry_set_internal in the first place?
Ok, I tested the file Michael is having issues with, with the dapper packages, it crashes, with gstreamer/gst-plugins and rhythmbox from CVS, it doesn't crash.
GStreamer from dapper: $ gst-launch-0.10 -t playbin uri=file:///home/teuf/media-test/Jeru\ The\ Damaja-\ Verses\ Of\ Doom.mp3 Setting pipeline to PAUSED ... Pipeline is PREROLLING ... TAG DECOUVERT : decouvert par l'element "id3demux0". artiste: ���䨀攀爀甀 吀栀攀 䐀愀洀愀樀愀 album: Tony Hawk Pro Skater 4 Soundtrack commentaire: brought by WmC-PL numéro de piste: 0 GStreamer CVS: $ gst-launch-0.10 -t playbin uri=file:///home/teuf/media-test/Jeru\ The\ Damaja-\ Verses\ Of\ Doom.mp3 Setting pipeline to PAUSED ... Pipeline is PREROLLING ... TAG DECOUVERT : decouvert par l'element "id3demux0". artiste: Jeru The Damaja album: Tony Hawk Pro Skater 4 Soundtrack commentaire: brought by WmC-PL numéro de piste: 0 GStreamer was giving us a non-UTF-8 title. Jonathan, should we close that bug, or do you want to do somethign in case rhythmdb_entry_set_internal gets a non-UTF-8 string?
If this condition always means that GStreamer has returned junk data, then there's no point trying to convert it to something valid. We should either ignore the string, or make the file import fail and report an error to the user. I think it's better to ignore the string, since we can probably still play the file OK. We should probably leave the assert as it is, and add a check in the metadata reader, and anything else that takes external data to insert into the database (daap, musicbrainz, whatever else). Adding invalid utf-8 to rhythmdb.xml causes libxml2 to ignore the whole file, so we don't have to worry about that.
Created attachment 61430 [details] [review] ignore invalid utf-8 tag data Perhaps replacing the invalid string with '<invalid unicode>' or similar would be a good idea. I'm not sure whether musicbrainz already does utf8 validation, or where the check would go if it doesn't, so I haven't done anything about it for this patch.
*** Bug 334753 has been marked as a duplicate of this bug. ***
FWIW, I've added a check to GStreamer now that makes sure that strings in taglists are always valid UTF-8. The crash in mp3_type_find() looks like bug #332964 and should be fixed since the gst-plugins-base 0.10.4 release.
The patch looks good to commit, unless you wanted to make it replace the string with '<invalid unicode>'.
I've committed the patch as is. Since we still need to check data returned by musicbrainz, I'm leaving the bug open.
Created attachment 62508 [details] [review] check musicbrainz strings Makes the audio cd source check all strings before using them, replacing invlid ones with "<invalid unicode>"
*** Bug 337226 has been marked as a duplicate of this bug. ***
I've committed the patch to cvs, so that should fix the last part of this bug.
*** Bug 394833 has been marked as a duplicate of this bug. ***