Segfault in strcmp

Forums:

Moc 2.5.0-beta1 won't open after upgrading to Xubuntu 13.10, constantly segfaults in strcmp on startup:

noccy@noccy-aspire:/tmp/moc-2.5.0~beta1+svn20130411$ mocp
Segmentation fault
noccy@noccy-aspire:/tmp/moc-2.5.0~beta1+svn20130411$ mocp -D
Segmentation fault
noccy@noccy-aspire:/tmp/moc-2.5.0~beta1+svn20130411$ mocp --debug
Segmentation fault

GDB trace:

(gdb) run
Starting program: /tmp/moc-2.5.0~beta1+svn20130411/mocp
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
__strcmp_ia32 () at ../sysdeps/i386/i686/multiarch/../strcmp.S:38
38 ../sysdeps/i386/i686/multiarch/../strcmp.S: No such file or directory.
(gdb) backtrace
#0 __strcmp_ia32 () at ../sysdeps/i386/i686/multiarch/../strcmp.S:38
#1 0xb7c5774c in rccGetRealLanguage () from /usr/lib/librcc.so.0
#2 0xb7c5798a in rccGetCurrentLanguage () from /usr/lib/librcc.so.0
#3 0xb7c58a8c in rccGetCurrentConfig () from /usr/lib/librcc.so.0
#4 0xb7c55e60 in rccRegisterLanguage () from /usr/lib/librcc.so.0
#5 0xb7c567aa in rccCreateContext () from /usr/lib/librcc.so.0
#6 0xb7c5695a in rccInitDefaultContext () from /usr/lib/librcc.so.0
#7 0x08082916 in rcc_init () at rcc.c:64
#8 0x08053fb9 in main (argc=1, argv=0xbfffeca4) at main.c:845
(gdb)

Can you tell me, as precisely as possible, the version of librcc you are linking against?

I installed XUBUNTU-amd64 13.10-beta2 in a chroot. Running mocp segfaulted with almost the same backtrace:
(gdb) run<br /> Starting program: /usr/bin/mocp<br /> [Thread debugging using libthread_db enabled]<br /> Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".</p> <p>Program received signal SIGSEGV, Segmentation fault.<br /> __strcmp_ssse3 () at ../sysdeps/x86_64/multiarch/../strcmp.S:212<br /> 212 ../sysdeps/x86_64/multiarch/../strcmp.S: Datei oder Verzeichnis nicht gefunden.<br /> (gdb) bt<br /> #0 __strcmp_ssse3 () at ../sysdeps/x86_64/multiarch/../strcmp.S:212<br /> #1 0x00007ffff6c9020a in rccGetRealLanguage () from /usr/lib/librcc.so.0<br /> #2 0x00007ffff6c913b9 in rccGetCurrentConfig () from /usr/lib/librcc.so.0<br /> #3 0x00007ffff6c8e860 in rccRegisterLanguage () from /usr/lib/librcc.so.0<br /> #4 0x00007ffff6c8f27f in rccCreateContext () from /usr/lib/librcc.so.0<br /> #5 0x00007ffff6c8f453 in rccInitDefaultContext () from /usr/lib/librcc.so.0<br /> #6 0x000000000043a1cf in rcc_init ()<br /> #7 0x000000000040ec40 in main ()

Ubuntu uses the same libc6 and librcc0 versions as Debian's sid where moc runs fine. Recompiling moc --without-rcc makes moc working in (X)Ubuntu. It seems that librcc0 (librcc-dev) or locale is somewhat broken. Please file a Ubuntu bug. Is it possible to mark such a bug as release critical?

--
Elimar

Thanks for confirming my initial doubts about this bug actually being in MOC code, Elimar. If you, "noccy", can file that bug report with Ubuntu we will track it.

Hi Gents,

I built Debian packages of librcc-0.2.10 at XUbuntu 13.10-beta2 upgraded as of today and updated the installed 0.2.9 version. Did a rebuild of moc against librcc-dev 0.2.10-0ubuntu1 and......... It works ;-) This is done on a amd64 machine. I'll investigate on how to push this into the BTS of "Amazontu" on weekend. For now I have to relax a bit, though. Rest of the week I am quite busy.

Elimar
Debian's moc maintainer

Any news?
I don't want using cmus anymore....

If you followed the thread posted by Elimar you would have seen that it's not a MOC problem but something to do with Ubuntu's build of the librcc package. Unfortunately, this is not a MOC problem and therefore we cannot fix it in MOC. (I was going to post that a little earlier but decided to wait a little longer to see if there was any resolution at the Ubuntu end.)

One possible workaround would be to replace the Ubuntu librcc package by the Debian one, which is demonstrated to have worked. But I don't know enough about the Debian and Ubuntu packaging systems to instruct you on this.

Of course, if you don't actually need RCC support you could build MOC using the --without-rcc option on configure, but I suspect you're not into building MOC from source.

What will happen by building moc without rcc?

Here error shows after built and install it:
<br /> $ mocp<br /> Running the server...<br /> Trying OSS...</p> <p>FATAL_ERROR: No valid sound driver!</p> <p>FATAL_ERROR: Server exited!</p> <p>[marslo@MarsloJiao ~]<br /> $ echo $LD_LIBRARY_PATH<br /> /usr/local/lib/moc/decoder_plugins<br /> [marslo@MarsloJiao ~]<br /> $ echo $LD_RUN_PATH<br /> /usr/local/lib/moc/decoder_plugins<br /> [marslo@MarsloJiao ~]<br /> $ ls /usr/local/lib/moc/decoder_plugins<br /> libffmpeg_decoder.la* libffmpeg_decoder.so* libvorbis_decoder.la* libvorbis_decoder.so*<br />

Here is the gdb information:
<br /> [marslo@MarsloJiao ~]<br /> $ gdb mocp core<br /> GNU gdb (GDB) 7.6.1-ubuntu<br /> Copyright (C) 2013 Free Software Foundation, Inc.<br /> License GPLv3+: GNU GPL version 3 or later<br /> This is free software: you are free to change and redistribute it.<br /> There is NO WARRANTY, to the extent permitted by law. Type "show copying"<br /> and "show warranty" for details.<br /> This GDB was configured as "i686-linux-gnu".<br /> For bug reporting instructions, please see:<br /> ...<br /> Reading symbols from /usr/local/bin/mocp...done.<br /> /home/marslo/core: No such file or directory.<br /> (gdb) run<br /> Starting program: /usr/local/bin/mocp<br /> [Thread debugging using libthread_db enabled]<br /> Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".<br /> Running the server...<br /> Trying OSS...</p> <p>FATAL_ERROR: No valid sound driver!</p> <p>FATAL_ERROR: Server exited!</p> <p>[Inferior 1 (process 12044) exited with code 02]<br /> (gdb)<br />

My sound card is alsa
<br /> [marslo@MarsloJiao /proc/asound/card0]<br /> $ head -1 /proc/asound/card0/codec#0<br /> Codec: Realtek ALC262<br /> [marslo@MarsloJiao /proc/asound/card0]<br /> $ cat /proc/asound/version<br /> Advanced Linux Sound Architecture Driver Version k3.11.0-12-generic.</p> <p>[marslo@MarsloJiao ~]<br /> $ dpkg -l alsa-base<br /> Desired=Unknown/Install/Remove/Purge/Hold<br /> | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend<br /> |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)<br /> ||/ Name Version Architecture Description<br /> +++-====================-===============-===============-==============================================<br /> ii alsa-base 1.0.25+dfsg-0ub all ALSA driver configuration files<br /> [marslo@MarsloJiao ~]<br /> $ dpkg -l alsa-utils<br /> Desired=Unknown/Install/Remove/Purge/Hold<br /> | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend<br /> |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)<br /> ||/ Name Version Architecture Description<br /> +++-====================-===============-===============-==============================================<br /> ii alsa-utils 1.0.27.1-1ubunt i386 Utilities for configuring and using ALSA<br />

I'v installed the libdb++-dev, libdb-dev and libltdl-dev
Here my system information:
<br /> [marslo@MarsloJiao ~/Tools/Software/SourceCode/Moc]<br /> $ cat /etc/issue<br /> Ubuntu 13.10 \n \l<br /> [marslo@MarsloJiao ~/Tools/Software/SourceCode/Moc]<br /> $ uname -a<br /> Linux MarsloJiao 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9 16:12:00 UTC 2013 i686 i686 i686 GNU/Linux<br />

How can I fix this issue?
Thanks in advanced.

Marslo

Okay, accroding to this post , I insalled the following packages:
<br /> sudo apt-get install libncurses5-dev libncursesw5-dev libasound2-dev libvorbis-dev libmad0-dev libid3tag0-dev zlib1g-dev libsndfile1-dev libflac-dev libogg-dev libsamplerate0-dev libspeex-dev libmpcdec-dev libsidplay2-dev libsidutils-dev libresid-builder-dev libwavpack-dev libtagc0-dev libcurl4-gnutls-dev libavcodec-dev libavformat-dev libltdl3-dev libtool libmodplug-dev automake1.9 autoconf<br />

My moc works finally!! ^_^

Marslo

Yes, I just logged in to post that you would need additional '-dev' packages and saw your happy news.

The Ubuntu packagers still don't seem to have responded to this problem on their thread.

Yeah, it'a a hard way, but I made it, :)
And, I made the basic Q&A
IMAGE(https://github.com/Marslo/Moc_Cmus-Config/blob/master/screenshots/mocp.png?raw=true)

I recently included a note in MOC's README file regarding the need for '-dev' packages on Debian-based distributions:


Note that for Debian-based distributions, you will also require any '-dev' suffixed versions of the packages above if building from source.

You may not have been using a recent enough version of MOC to have seen that, however.

Okay. Thayt's my bad. ignore README is my bad habit. I must to develop good habits.

I still want to know what will happed without rcc?
Thanks.

Marslo

MOC uses RCC to handle national character encodings in displayed filenames. If you only use ASCII filenames then there'll be no difference; if you have non-ASCII characters, then some filenames may not look as they should.

The Ubuntu thread is now showing the problem as fixed (librcc-0.2.9-3.1ubuntu0.1) and working its way through the Ubuntu release process.

Please notice https://bugs.launchpad.net/ubuntu/+source/librcc/+bug/1183580

I got the same error on standard Ubuntu 13.10