Skip Menu |

This queue is for tickets about the Audio-Scan CPAN distribution.

Report information
The Basics
Id: 67650
Status: open
Priority: 0/
Queue: Audio-Scan

People
Owner: Nobody in particular
Requestors: chiatzung.liu [...] mitrastar.com.tw
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.85
Fixed in: (no value)



Subject: Segfault on Squeezebox Server mp3 files with Perl 5.8
Some mp3 ID3 tags will cause lib AudioScan crash. I upload one of these mp3 on http://www.megaupload.com/?d=LTY9841A. You can use it to check this issue, thanks.
Thanks for the bug report. Does it also crash for you on the latest version (0.87)?
From: chiatzung.liu [...] mitrastar.com.tw
在 2011-四月-21 08:32:44 星期四 時,AGRUNDMA 寫到: Show quoted text
> Thanks for the bug report. Does it also crash for you on the latest > version (0.87)?
Yes.. It still crashes even I using 0.87.
From: Jorge Rivera
Show quoted text
> > Thanks for the bug report. Does it also crash for you on the latest > > version (0.87)?
> > Yes.. It still crashes even I using 0.87.
Hi, I have the same issue. I have tested 0.90 and the latest 0.93. It impacts SC/SBS/LMS even in the latest nightlies from Logitech for the readyNAS devices that still run on Perl 5.8. It segfaults if you run the scan_tags, but works well for scan_info. I'm attaching a minimal test.pl script that segfaults and a file that consistently crashes the scan for tags. Regards, Jorge Rivera
Subject: Coleman Hawkins - Body And Soul.mp3

Message body not shown because it is not plain text.

Subject: test.pl
#/bin/perl -w use strict; use Audio::Scan; use Getopt::Long; my $file; my $data; GetOptions( 'file=s' => \$file, ); print "$file\n"; $data = Audio::Scan->scan_tags($file); print "$data\n"; ;
From: psvbitcard [...] psv.nu
Hi, I fixed my installation with the following patch to id3.c (based on Audio::Scan 0.93): --- id3.c.ORIG 2012-03-11 21:53:17.123312553 +0100 +++ id3.c 2012-03-12 19:16:18.930193394 +0100 @@ -824,7 +824,7 @@ // v2.4 handles multiple genres using null char separators (or $00 $00 in UTF-16), // this is handled by _id3_get_utf8_string read += _id3_get_utf8_string(id3, &value, size - read, encoding); - if (value != NULL && SvPOK(value)) { + if (value != NULL && SvPOK(value) && SvPVX(value)!=0 ) { sptr = SvPVX(value); // Test if the string contains only a number, @@ -834,7 +834,14 @@ if ( tmp == end ) { // Convert raw number to genre string - av_push( genres, newSVpv( _id3_genre_name((char *)sptr), 0 ) ); + + // Perl 5.10 (and later) behavior of newSVpv() returns NULL for + // a NULL input. Note that _id3_genre_name() returns NULL for an empty string. + // Earlier perl versions crash if newSVpv() is fed a NULL pointer. Thus, the test to + // not push a NULL on genres. /petersv 2012-03-12 + if (*sptr) { + av_push( genres, newSVpv( _id3_genre_name((char *)sptr), 0 ) ); + } // value as an SV won't be used, must drop refcnt SvREFCNT_dec(value); This allowed the scan to compplete on my library. I think this is only a problem for perl < 5.10. Since RHEL5 uses perl 5.8 I think it is still common.