Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 41238 - xmms-1.2.9-r2 crashed while loading or have to play musepack files
Summary: xmms-1.2.9-r2 crashed while loading or have to play musepack files
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Jeremy Huddleston (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-11 05:57 UTC by Stefan Koegl
Modified: 2004-03-30 02:37 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
musepack-titles-0.94.patch (musepack-titles-0.94.patch,3.04 KB, patch)
2004-02-18 12:02 UTC, Stephan Kapfinger
Details | Diff
xmms-musepack-0.98.patch (xmms-musepack-0.98.patch,8.75 KB, patch)
2004-02-19 08:08 UTC, Stephan Kapfinger
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Koegl 2004-02-11 05:57:37 UTC
When I try to load/ play musepack files, xmms-1.2.9-r2 crashes. I tried xmms-musepack-0.98/ $-0.94.
I get following error message:

xmms: charset.c:980: xmms_charset_recode_id3: Assertion `buf' failed. 
 Aborted

Reproducible: Always
Steps to Reproduce:
1. start xmms (on xterm to see error message)
2. -> load file(s) or load directory (*.mpc)
3. 
Actual Results:  
xmms is crashing 

Expected Results:  
playing the tracks 

see 
http://forums.gentoo.org/viewtopic.php?t=134307&sid=f3eb869ac89928724065cd63d235bc3f 
 
We reemerged xmms-1.2.9-r1, and that version can play musepack files
Comment 1 Jeremy Huddleston (RETIRED) gentoo-dev 2004-02-11 23:24:33 UTC
Looks like the updated recode patch is introducing some borkage...  Can you give me a .mpc file that causes the problem.  Please post a link and don't post the whole file here.

Also, please provide the output of running 'emerge info'.

Thanks.
Comment 2 kfm 2004-02-15 16:49:41 UTC
Yep, I've just started experiencing this problem having used it for a long time without any issues whatsoever :(

I'm not sure what gave in my case, but just to confirm that I too am now experiencing the problem. Jeremy: I'll do some digging ASAP and supply you with th other stuff you requested above, if you still wish.
Comment 3 Jeremy Huddleston (RETIRED) gentoo-dev 2004-02-15 18:24:58 UTC
hmm... is this only happening with the .mpc files?  The xmms_charset_recode_id3 function is in libxmms/charset.c and was updated quite a bit when we went from 1.2.9-r1 to 1.2.9-r2 (it's from rusxmms.sf.net)...  the assertion is logical... here's the relevant part from the patch:

+char *xmms_charset_recode_id3(char *buf, int len, int *rlen) {
+    iconv_t icnv;
+
+#ifdef _CHARSET_DEBUG
+    fprintf(stderr,"xmms_charset_recode_id3\n");
+#endif
+    
+    assert(buf);
+    if (!buf) return NULL;
+

I really need to know how/who is calling it, so if you could give me a .mpc which breaks this or provide good gdb output (compile xmms and musepack with '-g' in CFLAGS and 'nostrip' in FEATURES) that would help alot.
Comment 4 Stephan Kapfinger 2004-02-18 12:00:51 UTC
I made a patch for musepack 0.94 which hopefully solves this bug. There were severel places in the file in_mpc.c where a title string with the value NULL was returned.
I will also see if i can fix it for musepack 0.98.
Comment 5 Stephan Kapfinger 2004-02-18 12:02:04 UTC
Created attachment 25871 [details, diff]
musepack-titles-0.94.patch
Comment 6 Jeremy Huddleston (RETIRED) gentoo-dev 2004-02-19 01:58:22 UTC
I've added the patch into portage in xmms-musepack-0.94-r2  Could youplease test it out and I'll move it into stable...

Thanks for the patch.  Clean and simple with no memory leaks... just the way I like it... I'll leave the bug open until we get 0.98 taken care of too...
Comment 7 Stephan Kapfinger 2004-02-19 08:08:44 UTC
Created attachment 25926 [details, diff]
xmms-musepack-0.98.patch

ok, it's done. xmms-musepack 0.98 is finally usable :)

Besides resolving the incompatibilities with the new recode patch i also fixed
the following issues:
* The plugin used to generate titles from tags only if a file was played, but
not as a result of a "read extended info" operation. Now it always reads the
APE tags if the appropriate option is enabled. To format the tag information,
xmms' common title format is used.
* Song durations were sometimes calculated wrong, because a "default" sample
rate of 8000 kHz was used.

BTW, the patches are from me, not from Stefan Koegl as stated in the ChangeLog.
Comment 8 Jeremy Huddleston (RETIRED) gentoo-dev 2004-02-19 11:06:26 UTC
Thanks... man that old code was unpleasant... They didn't even use strncpy() to avoid a buffer overrun...

char               displayed_info [512];
...
strcpy ( displayed_info, eval_tag_format ( filename, artist, album, title, year, comment, genre, track ) );

Thanks again, I'm testing now and will add if it works.

--Jeremy
Comment 9 Jeremy Huddleston (RETIRED) gentoo-dev 2004-02-19 11:11:09 UTC
Out of curriosity, why was this neccessary:

-        gtk_widget_show            ( tag_description_label2 );
-        gtk_widget_show            ( format_box );
+//        gtk_widget_show            ( tag_description_label2 );
+//        gtk_widget_show            ( format_box );

IO'll wait to hear back before committing...
Comment 10 Stephan Kapfinger 2004-02-19 12:09:14 UTC
-        gtk_widget_show            ( titleformat_entry );
-        gtk_widget_show            ( title_box );
-        gtk_widget_show            ( tag_description_label2 );
-        gtk_widget_show            ( format_box );

this is the text box where you can enter a title format in musepack's configuration dialog. mith my patch it is no longer used, as the format is taken from the value you specify in the xmms configuration:
_title = xmms_get_titlestring(xmms_get_gentitle_format(), input);
i could add an option to override the global title format, like in the ogg and mpeg plugins, if this is desired. but then i could really create a new project and actively continue the plugin's development, as there are so many things which don't work yet (you'd better not use the built in tag editor, just opening the dialog can corrupt your playlist). well, maybe i'll do this if i get more time.
Comment 11 Jeremy Huddleston (RETIRED) gentoo-dev 2004-02-19 19:48:28 UTC
Thanks for the patches... I wish this project was better maintained... =(
Comment 12 kfm 2004-03-30 02:37:19 UTC
Fascinating bug! Thanks a lot to all concerned. I also wish the project were better maintained (/me lives in hope that a well devised gstreamer plugin will one day exist for this codec).