After an emerge -e world disc-cover will segfault. The segfault happens in Module Audio::CD from Package Audio-CD-disc-cover-0.05. Perhaps the new gcc is the problem markus@master $ disc-cover-test Trying CDDB server cddbp://freedb.freedb.org:888/ Connection established. Segfaulterror Reproducable: Always markus@master /source/Audio-CD-0.05 $ emerge info Portage 2.0.51.22-r3 (default-linux/x86/2005.1, gcc-3.4.4, glibc-2.3.5-r2, 2.6.14-gentoo-r2 i686) ================================================================= System uname: 2.6.14-gentoo-r2 i686 AMD Athlon(tm) XP 2800+ Gentoo Base System version 1.6.13 dev-lang/python: 2.4.2 sys-apps/sandbox: 1.2.12 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1 sys-devel/binutils: 2.16.1 sys-devel/libtool: 1.5.20 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-O3 -march=athlon-xp -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/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/ /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O3 -march=athlon-xp -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks sandbox sfperms strict" GENTOO_MIRRORS="ftp://ftp.tu-clausthal.de/pub/linux/gentoo/ ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ ftp://linux.rz.ruhr-uni-bochum.de/gentoo-mirror/ http://ftp.uni-erlangen.de/pub/mirrors/gentoo ftp://ftp.uni-erlangen.de/pub/mirrors/gentoo ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/ http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ ftp://ftp.gentoo.mesh-solutions.com/gentoo/ " LANG="de_DE.UTF-8" LC_ALL="de_DE.UTF-8" LINGUAS="de" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86 3dnow 3dnowext X aalib acpi alsa apm arts audiofile avi bash-completion berkdb bitmap-fonts bzip2 cddb cdparanoia cdr crypt css cups curl dga dio directfb divx4linux dri dv dvd dvdr dvdread edl eds emboss encode esd exif expat fam fbcon fdftk festival ffmpeg fla flac foomaticdb fortran gd gdbm ggi gif gimp gimpprint glut gmp gpg gphoto2 gpm gtk gtk2 idn imagemagick imlib ipv6 java jpeg jpeg2k kde lcms libg++ libwww lzo lzw lzw-tiff mad matroska mbox mhash mikmod mmx mmxext mng motif mp3 mpeg mysql ncurses network nls nvidia odbc ogg oggvorbis old-crypt openal opengl oss pam pam_console pcre pdflib perl png pnp postgres povray ppds python qt quicktime readline recode samba sasl scanner sdl slang smime sndfile snmp sox speedo spell sse ssl svga tcltk tcpd tetex tiff truetype truetype-fonts type1 type1-fonts udev unicode usb userlocales v4l v4l2 vorbis win32codecs wmf xanim xine xml2 xmms xscreensaver xv xvid xvmc yv12 zlib zvbi fritzcapi_cards_fcpci linguas_de userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LDFLAGS, MAKEOPTS, PORTDIR_OVERLAY
i'm not able to dup this at all...I even tested the module directly with a cd in the drive: $ perl -MAudio::CD my $cd = Audio::CD->init; my $cddb = $cd->cddb; my $id = $cddb->discid; my $data = $cddb->lookup; my $title = $data->title; my $genre = $data->genre; print "This is $title - genre: $genre\n"; This is Monster - genre: rock
I've tried following script: #!/usr/bin/perl -w use Audio::CD; print "1\n"; my $cd = Audio::CD->init; print "2\n"; my $cddb = $cd->cddb; print "3\n"; my $id = $cddb->discid; print "4\n"; my $data = $cddb->lookup; print "5\n"; my $title = $data->title; print "6\n"; my $genre = $data->genre; print "7\n"; print "This is $title - genre: $genre\n"; and i got this result: markus@master /images/film3 $ test2.sh 1 2 3 4 Speicherzugriffsfehler markus@master /images/film3 $ I reemerged perl and run perl-cleaner all Which other Information do you need? Thanks Markus
Sorry for the delay, wanted to find the same cd i used last time:) 1 2 3 4 5 6 7 This is Monster - genre: rock I don't believe this problem is with the module (and haven't seen anything to contradict that). Unless you can provide more info on how its the module failing, I'm afraid I'm going to have to close this out. Are you sure your connecting to the cddb host and such? (random thought)
(In reply to comment #3) Which Information du you need? How could I get these Information? Please give me a hint. By the way I've tried to do your Example from Comment #1 on the shell but I didn't got any result or feedback. Is it right that I have to put this perl statement directly an the bash shell? Sorry for asking so silly questions Markus
Please, `free` just before you run that script and send us the output. Also, I'd appreciate output from strace, just in case... Michael, what do you say about his CFLAGS and FEATURES?
Created attachment 78468 [details] strace log from disc-cover-test
(In reply to comment #5) > Please, `free` just before you run that script and send us the output. Here the output from free: markus@master ~ $ free total used free shared buffers cached Mem: 515644 508160 7484 0 59736 154256 -/+ buffers/cache: 294168 221476 Swap: 514072 104216 409856 ad the Output from my script: markus@master ~ $ disc-cover-test 1 2 3 4 Speicherzugriffsfehler markus@master ~ $ > Also, I'd appreciate output from strace, just in case... I added the strace log as attachment. > > Michael, what do you say about his CFLAGS and FEATURES? >
It started to happen to me too. Confirming that Markus is not insane :-) Here's the weird part: # perl test.pl 1 2 3 4 Segmentation fault # rm ~/.cd* -rf # perl test.pl 1 2 3 4 Connection error: Success 5 6 7 This is - genre: (unknown) Strace output will be attached in a moment...
Created attachment 78469 [details] Output from strace
re-emerged media-libs/libcdaudio and dev-perl/Audio-CD-disc-cover with gcc-3.3.6, which is the same gcc I compiled my perl with: # perl -V:gccversion gccversion='3.3.6 (Gentoo 3.3.6, ssp-3.3.6-1.0, pie-8.7.8)'; And it stopped happening. re-emerged those two ebuilds with gcc-3.4.4 -- segfaults. Re-emerged those two ebuilds AND perl with gcc-3.4.4, and it STILL segfaults (even after perl-cleaner all)! re-emerged media-libs/libcdaudio and dev-perl/Audio-CD-disc-cover with gcc-3.3.6 (even though perl is compiled with gcc-3.4.4) and it works... The reason I didn't get this segfault before is possibly because it took the already-cached CDDB data... Markus, for the time being, please recompile those ebuilds with gcc-3.3.6 (sorry, that's all I can offer for now). Michael, a penny for your thoughts?
Can I actually get a gdb backtrace for this? I put together a guide on backtracing and general debugging here: http://www.gentoo.org/doc/en/draft/debugging-howto.xml Just In Case(r) :P
Sure (thanks for the guide, it's great!): (gdb) run Starting program: /usr/bin/perl ./test.pl [Thread debugging using libthread_db enabled] [New Thread 16384 (LWP 30755)] 1 2 3 4 Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 16384 (LWP 30755)] 0xb7fe2734 in cddb_lookup (cd_desc=6, data=0xb7d86008) at cddb_lookup.c:148 148 cddb_lookup.c: No such file or directory. in cddb_lookup.c (gdb) bt #0 0xb7fe2734 in cddb_lookup (cd_desc=6, data=0xb7d86008) at cddb_lookup.c:148 #1 0xb7fe73e9 in XS_Audio__CDDB_lookup (cv=0x81b97b8) at CD.xs:422 #2 0x080ca1ec in Perl_pp_entersub () at pp_hot.c:2890 #3 0x080aff88 in Perl_runops_debug () at dump.c:1449 #4 0x08066bbe in perl_run (my_perl=0x8162d88) at perl.c:1934 #5 0x0805f651 in main (argc=33800, argv=0x8408, env=0xbffff8d0) at perlmain.c:98
Can you use this instead (has verbosity turned on..): #!/usr/bin/perl -w use Audio::CD; print "1\n"; my $cd = Audio::CD->init; print "2\n"; my $cddb = $cd->cddb; print "3\n"; $cddb->verbose(1); my $id = $cddb->discid; print "4\n"; my $data = $cddb->lookup; print "5\n"; my $title = $data->title; print "6\n"; my $genre = $data->genre; print "7\n"; print "This is $title - genre: $genre\n";
bah, and gdb it with the newer script ;p...
There you go: (gdb) run Starting program: /usr/bin/perl /root/test.pl [Thread debugging using libthread_db enabled] [New Thread 16384 (LWP 5446)] 1 2 3 4 Trying CDDB server http://www.freedb.org:80/cgi-bin/cddb.cgi Connection established. Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 16384 (LWP 5446)] 0xb7fe2734 in cddb_lookup (cd_desc=6, data=0xb7d86008) at cddb_lookup.c:148 148 switch(list.list_host[serverindex].host_protocol) { (gdb) bt #0 0xb7fe2734 in cddb_lookup (cd_desc=6, data=0xb7d86008) at cddb_lookup.c:148 #1 0xb7fe73e9 in XS_Audio__CDDB_lookup (cv=0x81b9860) at CD.xs:422 #2 0x080ca1ec in Perl_pp_entersub () at pp_hot.c:2890 #3 0x080aff88 in Perl_runops_debug () at dump.c:1449 #4 0x08066bbe in perl_run (my_perl=0x8162d88) at perl.c:1934 #5 0x0805f651 in main (argc=33800, argv=0x8408, env=0xbffff890) at perlmain.c:98
Created attachment 78509 [details] Audio-CD-disc-cover-0.05.ebuild Updated ebuild for patch.
Created attachment 78510 [details, diff] Audio-CD-disc-cover-0.05-segfault.patch The patch, see: http://www.gentoo.org/doc/en/bugzilla-howto.xml#doc_chap8 for more information on testing ebuilds (Just In Case ;p)
Still segfaults: (gdb) run Starting program: /usr/bin/perl /root/test.pl [Thread debugging using libthread_db enabled] [New Thread 16384 (LWP 7231)] 1 2 3 4 Trying CDDB server http://www.freedb.org:80/cgi-bin/cddb.cgi Connection established. Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 16384 (LWP 7231)] 0xb7fe272d in cddb_lookup (cd_desc=6, data=0xb7d86008) at cddb_lookup.c:147 147 cddb_lookup.c: No such file or directory. in cddb_lookup.c (gdb) bt #0 0xb7fe272d in cddb_lookup (cd_desc=6, data=0xb7d86008) at cddb_lookup.c:147 #1 0xb7fe73e9 in XS_Audio__CDDB_lookup (cv=0x81b9840) at CD.xs:422 #2 0x080ca1ec in Perl_pp_entersub () at pp_hot.c:2890 #3 0x080aff88 in Perl_runops_debug () at dump.c:1449 #4 0x08066bbe in perl_run (my_perl=0x8162d88) at perl.c:1934 #5 0x0805f651 in main (argc=33865, argv=0x8449, env=0xbffff8a0) at perlmain.c:98
Yuval contacted me on IRC, and is sending an email to the upstream developers. I'm closing this as UPSTREAM until they can give a comment on the code.
Problem was in libcdaudio's cddb_connect_server() which didn't call va_end() in 2 cases. I'll send the patch upstream (and also notify Doug MacEachern that it's not an Audio::CD bug). HUGE thanks goes to ariels for figuring this one out :)
Created attachment 79311 [details] Added epatch to libcdaudio-0.99.12.ebuild
Created attachment 79312 [details, diff] Patch to cddb.c, adding calls to va_end()