You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unexpected behavior & segfault when adding two particular albums #417
There exist two very similar albums (same artist, similar album titles, similar track listing). When adding either of these albums to cmus, there is no issue. However, when adding both of them, only one shows up in the library, and upon attempting to quit, cmus segfaults without writing relevant information to cmus-debug.txt.
List of files in the two albums, with slight filename differences highlighted:
cmus after attempting to add both albums, showing only one in the library:
Segfault upon quitting cmus:
I have been able to reproduce this on Ubuntu (cmus v2.5.0) and Parabola (v2.7.1 and v2.7.0-67-g6704e78). An archive of the particular files which cause the problem is available here.
changed the title [-]Unexpected behavior & segfault when adding two albums[/-][+]Unexpected behavior & segfault when adding two particular albums[/+]on Mar 19, 2016
The problem is that glibc's handling of CJK characters is broken. Those albums and tracks compare equal and due to various other bugs in cmus this causes the crash. I've created a branch here that removes collation and thus the problem from cmus.
I don't know. But maybe you remember that some time ago there was a bug related to Hangul characters and glibc. I opened a bug back then and nothing has happened yet. So I don't think that such a bug which doesn't seem to affect many programs will be fixed anytime soon.
One solution would be to use ICU instead of the POSIX functions. This could be an optional dependency so that glibc is used if ICU isn't installed (at compile time.)
I am closing this as duplicate of #103. Regarding ICU — it might help, but it will effectively "fork" cmus installs in ICU-enabled and not. I am not sure I like that from the maintenance perspective (also, this is a departure from cmus' no-dependencies philosophy).
I don't think this issue should be closed. As it stands right now, OP cannot listen to his music in cmus which is certainly a serious cmus bug. Even if glibc returns an incorrect integer, this shouldn't cause cmus to crash. The related issue is closed too but wasn't as serious as this one.
Activity
[-]Unexpected behavior & segfault when adding two albums[/-][+]Unexpected behavior & segfault when adding two particular albums[/+]mahkoh commentedon Mar 19, 2016
The problem is that glibc's handling of CJK characters is broken. Those albums and tracks compare equal and due to various other bugs in cmus this causes the crash. I've created a branch here that removes collation and thus the problem from cmus.
flyingmutant commentedon Mar 19, 2016
@mahkoh, is there any open bug about glibc's broken CJK collation?
mahkoh commentedon Mar 19, 2016
I don't know. But maybe you remember that some time ago there was a bug related to Hangul characters and glibc. I opened a bug back then and nothing has happened yet. So I don't think that such a bug which doesn't seem to affect many programs will be fixed anytime soon.
One solution would be to use ICU instead of the POSIX functions. This could be an optional dependency so that glibc is used if ICU isn't installed (at compile time.)
mahkoh commentedon Mar 19, 2016
If ICU also uses the locale data provided by glibc then this won't work though (I think.)
flyingmutant commentedon Mar 19, 2016
Oh, I do remember that indeed now, thanks.
I am closing this as duplicate of #103. Regarding ICU — it might help, but it will effectively "fork" cmus installs in ICU-enabled and not. I am not sure I like that from the maintenance perspective (also, this is a departure from cmus' no-dependencies philosophy).
mahkoh commentedon Mar 19, 2016
I don't think this issue should be closed. As it stands right now, OP cannot listen to his music in cmus which is certainly a serious cmus bug. Even if glibc returns an incorrect integer, this shouldn't cause cmus to crash. The related issue is closed too but wasn't as serious as this one.
flyingmutant commentedon Mar 19, 2016
Sound good – I've created a separate meta-issue #418 for that.
Change album_add_track to always add the track
Change album_add_track to always add the track