Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 154365 - Stabilize media-sound/mp3c-0.29-r1 --- media-sound/mp3c-029 suffers from buffer overflows causing segfaults with some locales
Summary: Stabilize media-sound/mp3c-0.29-r1 --- media-sound/mp3c-029 suffers from buff...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High major
Assignee: Gentoo Sound Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-07 07:17 UTC by Paolo Pedroni
Modified: 2006-11-13 07:48 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paolo Pedroni 2006-11-07 07:17:48 UTC
As it is said in the summary mp3c-0.31 (but also mp3c-0.29 had the same problem) segfaults in the main screen whenewer one presses the enter key to modify track data (author, title, whatever).

This has started happening after my system was converted to gcc-4.1 and glibc-2.4.

If I tune down my CFLAGS to -O2 the segfault is delayed and it happens after the track data is modified and you try to go back to the main screen.

# emerge --info
Portage 2.1.1-r1 (default-linux/amd64/2006.1/desktop, gcc-4.1.1, glibc-2.4-r4, 2.6.17-gentoo-r8 x86_64)
=================================================================
System uname: 2.6.17-gentoo-r8 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 4600+
Gentoo Base System version 1.12.6
Last Sync: Tue, 07 Nov 2006 09:00:01 +0000
distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
ccache version 2.3 [enabled]
app-admin/eselect-compiler: [Not Present]
dev-java/java-config: 1.3.7, 2.0.30
dev-lang/python:     2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.3
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.60
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.13-r4
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O3 -pipe -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-march=k8 -O3 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache collision-protect distcc distlocks fixpackages metadata-transfer sandbox sfperms strict test userfetch userpriv usersandbox"
GENTOO_MIRRORS="http://gentoo.ngi.it http://gentoo.intergenia.de http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ http://ftp.ntua.gr/pub/linux/gentoo/"
LANG="it_IT.UTF-8"
LC_ALL="it_IT.UTF-8"
LINGUAS="it"
MAKEOPTS="-j11"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 X Xaw3d a52 aalib acpi alsa arts audiofile bash-completion berkdb bitmap-fonts bzip2 cairo caps cdparanoia cdr cli cracklib crypt cups curl dbus dga dio dlloader dri dvd dvdr dvdread elibc_glibc emboss emul-linux-x86 encode exif expat fam fbcon ffmpeg fftw firefox flac foomaticdb fortran ftp gd ggi gif glut gmp gnutls gphoto2 gpm gstreamer gtk2 hal iconv idn ieee1394 imagemagick imlib input_devices_evdev input_devices_keyboard input_devices_mouse isdnlog java javascript jbig jikes jpeg jpeg2k kde kdeenablefinal kernel_linux lcms libcaca libg++ linguas_it lm_sensors lua mad maildir matroska memlimit mikmod mime mmap mng motif mozilla mp3 mpeg mpi ncurses nls nptl nptlonly nsplugin offensive ogg openal opengl oss pam pcre pdf perl png posix ppds pppd python qt3 quicktime readline recode reflection samba sasl sdl session sharedmem shorten sndfile sockets sox speex spell spl ssl svg symlink sysvipc tcl tcltk tcpd theora threads tidy tiff tk truetype truetype-fonts type1-fonts udev unicode usb userland_GNU vcd video_cards_radeon vorbis wmf xine xml xorg xosd xpm xv xvid zlib"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Paolo Pedroni 2006-11-07 07:21:04 UTC
A quick note to add that I just read in the program documentation that segfaults may also be related to ncurses.
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2006-11-07 09:13:58 UTC
Please, reopen with a backtrace. Thanks.

http://www.gentoo.org/proj/en/qa/backtraces.xml
Comment 3 Paolo Pedroni 2006-11-07 16:07:45 UTC
After recompiling mp3c, ncurses and glibc with FEATURES="nostrip" CFLAGS="-march=k8 -O2 -pipe" CXXFLAGS="-march=k8 -O2 -pipe" USE="debug trace -glibc-omitfp" I still get:

(gdb) bt full
#0  0x000000000041f220 in select_field_box ()
No symbol table info available.
#1  0x0000000000414bcf in alter_track_infos_menu ()
No symbol table info available.
#2  0x00000000004101f8 in main_loop ()
No symbol table info available.
#3  0x000000000041359f in main ()
No symbol table info available.

What am I doing wrong?
Comment 4 Jakub Moc (RETIRED) gentoo-dev 2006-11-07 23:58:27 UTC
Did you really read the above howto? (hint: compiler flags)
Comment 5 Paolo Pedroni 2006-11-08 01:41:29 UTC
(In reply to comment #4)
> Did you really read the above howto? (hint: compiler flags)

S**t, that part really flied completely over my head. Redone now with FEATURES="nostrip" CFLAGS="-march=k8 -O2 -pipe -ggdb" CXXFLAGS="-march=k8 -O2 -pipe -ggdb" USE="debug trace
-glibc-omitfp"

It yields:
(gdb) bt full
#0  select_field_box (fs_anchor=0x57f300, max_length=<value optimized out>,
    stat_text=0x7fff498fffe0 "Modifica le informazioni della traccia 1", use_old=0 '\0', allow_space=1 '\001') at select_box.c:260
        i = <value optimized out>
        j = 25
        i2 = 1
        maxx = 140
        maxy = 50
        inp_ch = <value optimized out>
        fs_win = <value optimized out>
        curr = (field_select_typ *) 0x2b9900000005
#1  0x0000000000413a07 in alter_track_infos_menu (track=0x57fa70) at options.c:1213
        new = (field_select_typ *) 0x57fa70
        anchor = (field_select_typ *) 0x57f300
        song_curr = <value optimized out>
        pointer = <value optimized out>
        mini_str = "Modifica le informazioni della trac"
        i = <value optimized out>
        use_old = 0 '\0'
        yesno_flag = <value optimized out>
#2  0x000000000040f538 in main_loop (win=0x56e000) at keys.c:485
        inp_ch = 10
        pointer1 = 0x0
        pointer3 = <value optimized out>
        pointer4 = <value optimized out>
        pointer2 = (song_typ *) 0x0
        old_song = (song_typ *) 0x0
        i = <value optimized out>
        abort_flag = <value optimized out>
#3  0x0000000000412612 in main (argc=<value optimized out>, argv=0x7fff499001b8) at main.c:349
        win = (WINDOW *) 0x56e000
        anchor = (song_typ *) 0x57fa70
        tx = <value optimized out>
        i = 0
        batch_mode = 0 '\0'
        batch_file = <value optimized out>
        existing_lockfile = 0 '\0'

Is this any better?
Comment 6 Alexis Ballier gentoo-dev 2006-11-09 12:19:13 UTC
This sounds to me like an abi incompatibility, did you follow 
http://www.gentoo.org/doc/en/gcc-upgrading.xml after migrating to gcc 4.1.1  ?

(ie, emerge -e system && emerge -e world after switching to gcc 4.1.1 )

I can't reproduce it here and it does not seem that your cflags are faulty.
I'm ~amd64 so I may not have the same libs as you, that's just to be sure before trying several combinations of libs.
Comment 7 Paolo Pedroni 2006-11-09 13:51:59 UTC
(In reply to comment #6)
> This sounds to me like an abi incompatibility, did you follow 
> http://www.gentoo.org/doc/en/gcc-upgrading.xml after migrating to gcc 4.1.1  ?
> 
> (ie, emerge -e system && emerge -e world after switching to gcc 4.1.1 )

Oh yes, sir. Besides it also happens on a native gcc-4.1.1 system. :(
Comment 8 Alexis Ballier gentoo-dev 2006-11-09 23:05:47 UTC
Ok, I'm now able to reproduce it by setting my locales to italian.
While I'm trying to fix it, if you're blocked by this bug, it should work by setting your locales to C, something like "LC_ALL=C mp3c" to start mp3c.
Comment 9 Alexis Ballier gentoo-dev 2006-11-09 23:55:44 UTC
I've added a patch to 0.29-r1 and 0.31-r1, and also reported upstream.
This was due to a buffer overflow because the translated string was longer than the size of the buffer.

Please confirm that 0.29-r1 is working as expected then I'll ask for it to be stabilized.
Comment 10 Paolo Pedroni 2006-11-10 00:24:55 UTC
(In reply to comment #9)
> Please confirm that 0.29-r1 is working as expected then I'll ask for it to be
> stabilized.
> 

I'm at work at the moment, I'll check this when I get home this evening.
Comment 11 Paolo Pedroni 2006-11-10 08:06:13 UTC
(In reply to comment #9)
> I've added a patch to 0.29-r1 and 0.31-r1, and also reported upstream.
> This was due to a buffer overflow because the translated string was longer than
> the size of the buffer.
> 
> Please confirm that 0.29-r1 is working as expected then I'll ask for it to be
> stabilized.

mp3c-0.29-r1 works as expected with italian locale.

mp3c-0.31-r1 works as well and it would be nice to have it stable ASAP, because it contains improvements to cddb comunication.
Comment 12 Alexis Ballier gentoo-dev 2006-11-10 09:01:28 UTC
Thank you very much for your help Paolo, without your backtrace it would have been a harass to track this bug.

@Arches, please stabilize media-sound/mp3c-0.29-r1, 0.29 segfaults when, for example, using italian locales.


@ppc: You don't have 0.29 stable, but maybe you'll be interested in having 0.29-r1 stable since you're the only keyworded arch that does not have a stable version of mp3c.



About 0.31-r1, it'll have to wait a little bit, at least one month, before reaching stable because I bumped it some days ago. Please file a bug when it'll have been kept long enough in ~arch without bug to stabilize 0.31-r1.


Comment 13 Markus Meier gentoo-dev 2006-11-10 12:40:03 UTC
media-sound/mp3c-0.29-r1  USE="vorbis" LINGUAS="de -es -it -pl -pt"
1. emerges on x86
2. passes collision test
3. works

Portage 2.1.1-r1 (default-linux/x86/2006.1/desktop, gcc-4.1.1, glibc-2.4-r4, 2.6.18.1 i686)
=================================================================
System uname: 2.6.18.1 i686 Genuine Intel(R) CPU           T2300  @ 1.66GHz
Gentoo Base System version 1.12.6
Last Sync: Fri, 10 Nov 2006 19:30:01 +0000
ccache version 2.3 [disabled]
app-admin/eselect-compiler: [Not Present]
dev-java/java-config: 1.3.7, 2.0.30
dev-lang/python:     2.3.5-r3, 2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.3
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.60
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.13-r4
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r1
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=prescott -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-O2 -march=prescott -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--nospinner"
FEATURES="autoconfig collision-protect distlocks metadata-transfer parallel-fetch sandbox sfperms strict test userfetch userpriv usersandbox"
GENTOO_MIRRORS="http://mirror.switch.ch/mirror/gentoo/ http://gentoo.inode.at/"
LINGUAS="en de en_GB de_CH"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X a52 aac acpi alsa apache2 asf berkdb bitmap-fonts cairo cdr cdrom cli cracklib crypt cups dbus divx dlloader dri dts dvd dvdr dvdread eds elibc_glibc emboss encode fam ffmpeg firefox flac fortran gdbm gif gnome gpm gstreamer gtk hal iconv input_devices_keyboard input_devices_mouse ipv6 isdnlog java jpeg kde kdeenablefinal kernel_linux ldap libg++ linguas_de linguas_de_CH linguas_en linguas_en_GB mad mikmod mmx mono mp3 mpeg ncurses nls nptl nptlonly ogg opengl oss pam pcre perl png ppds pppd python qt3 qt4 quicktime readline reflection rtsp samba sdl session smp spell spl sse sse2 sse3 ssl svg tcpd test tetex theora threads truetype truetype-fonts type1-fonts udev unicode userland_GNU vcd video_cards_fbdev video_cards_i810 video_cards_vesa vorbis win32codecs wxwindows x264 xine xml xorg xprint xv xvid zlib"
Unset:  CTARGET, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 14 Andrej Kacian (RETIRED) gentoo-dev 2006-11-10 16:05:24 UTC
0.29-r1 stable on x86.
Comment 15 Michael Cummings (RETIRED) gentoo-dev 2006-11-10 16:47:30 UTC
amd64 all set
Comment 16 Gustavo Zacarias (RETIRED) gentoo-dev 2006-11-13 05:24:32 UTC
sparc stable.
Comment 17 Joe Jezak (RETIRED) gentoo-dev 2006-11-13 07:48:59 UTC
Marked ppc stable, closing since we're the last arch.