Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 115861 - Audio-CD-disc-cover-0.05 segfault at cddb->lookup
Summary: Audio-CD-disc-cover-0.05 segfault at cddb->lookup
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Gentoo Perl team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-17 08:27 UTC by Markus Preis
Modified: 2006-05-24 17:21 UTC (History)
1 user (show)

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


Attachments
strace log from disc-cover-test (strace.txt,62.01 KB, text/plain)
2006-01-29 12:02 UTC, Markus Preis
Details
Output from strace (strace,50.57 KB, text/plain)
2006-01-29 12:30 UTC, Yuval Yaari (RETIRED)
Details
Audio-CD-disc-cover-0.05.ebuild (Audio-CD-disc-cover-0.05.ebuild,903 bytes, text/plain)
2006-01-30 11:01 UTC, Chris White (RETIRED)
Details
Audio-CD-disc-cover-0.05-segfault.patch (Audio-CD-disc-cover-0.05-segfault.patch,593 bytes, patch)
2006-01-30 11:02 UTC, Chris White (RETIRED)
Details | Diff
Added epatch to libcdaudio-0.99.12.ebuild (libcdaudio-0.99.12.ebuild,872 bytes, text/plain)
2006-02-09 04:02 UTC, Yuval Yaari (RETIRED)
Details
Patch to cddb.c, adding calls to va_end() (libcdaudio-0.99.12-segfault.patch,360 bytes, patch)
2006-02-09 04:03 UTC, Yuval Yaari (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Preis 2005-12-17 08:27:13 UTC
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
Comment 1 Michael Cummings (RETIRED) gentoo-dev 2006-01-08 09:21:04 UTC
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
Comment 2 Markus Preis 2006-01-08 12:00:05 UTC
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
Comment 3 Michael Cummings (RETIRED) gentoo-dev 2006-01-13 17:06:15 UTC
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)
Comment 4 Markus Preis 2006-01-19 10:43:08 UTC
(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

Comment 5 Yuval Yaari (RETIRED) gentoo-dev 2006-01-29 02:08:54 UTC
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?
Comment 6 Markus Preis 2006-01-29 12:02:46 UTC
Created attachment 78468 [details]
strace log from disc-cover-test
Comment 7 Markus Preis 2006-01-29 12:04:22 UTC
(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?
> 
Comment 8 Yuval Yaari (RETIRED) gentoo-dev 2006-01-29 12:27:07 UTC
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...
Comment 9 Yuval Yaari (RETIRED) gentoo-dev 2006-01-29 12:30:56 UTC
Created attachment 78469 [details]
Output from strace
Comment 10 Yuval Yaari (RETIRED) gentoo-dev 2006-01-29 13:30:07 UTC
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?
Comment 11 Chris White (RETIRED) gentoo-dev 2006-01-30 09:08:07 UTC
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
Comment 12 Yuval Yaari (RETIRED) gentoo-dev 2006-01-30 09:54:40 UTC
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
Comment 13 Chris White (RETIRED) gentoo-dev 2006-01-30 10:37:40 UTC
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";
Comment 14 Chris White (RETIRED) gentoo-dev 2006-01-30 10:38:03 UTC
bah, and gdb it with the newer script ;p...
Comment 15 Yuval Yaari (RETIRED) gentoo-dev 2006-01-30 10:40:29 UTC
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
Comment 16 Chris White (RETIRED) gentoo-dev 2006-01-30 11:01:17 UTC
Created attachment 78509 [details]
Audio-CD-disc-cover-0.05.ebuild

Updated ebuild for patch.
Comment 17 Chris White (RETIRED) gentoo-dev 2006-01-30 11:02:34 UTC
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)
Comment 18 Yuval Yaari (RETIRED) gentoo-dev 2006-01-30 11:14:39 UTC
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
Comment 19 Chris White (RETIRED) gentoo-dev 2006-01-30 11:45:59 UTC
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.
Comment 20 Yuval Yaari (RETIRED) gentoo-dev 2006-02-09 04:00:32 UTC
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 :)
Comment 21 Yuval Yaari (RETIRED) gentoo-dev 2006-02-09 04:02:19 UTC
Created attachment 79311 [details]
Added epatch to libcdaudio-0.99.12.ebuild
Comment 22 Yuval Yaari (RETIRED) gentoo-dev 2006-02-09 04:03:01 UTC
Created attachment 79312 [details, diff]
Patch to cddb.c, adding calls to va_end()