Subject: | Audio-Scan 0.13 scan_tags() segfaults on undefined array element |
Date: | Mon, 11 May 2009 12:29:01 +0200 |
To: | bug-Audio-Scan [...] rt.cpan.org |
From: | "H. Langos" <henrik-cpanrt [...] prak.org> |
Hi,
I just found a curious error using Audio::Scan::scan_tags().
I wrote a simple perl script and made an error passing
a non existing array element to scan_tags().
Instead of $ARGV[0], I passed $ARGV[1] and got a segfault!
It does not happen when I pass an undefined scalar, though.
Even if I touched $ARGV[1] with ref() before passing it to
scan_tags() I didn't get the segfault anymore.
Seems like the glue between perl and the libid3tag behaves
differently in those cases.
Here's the test script that dies with a segfault in the
second scan_tags() call:
---------------
use strict;
use warnings;
use Audio::Scan;
use Data::Dumper;
my $foo;
print "---------foo: ".ref(\$foo)." \n";
print Dumper($foo);
my $tags = Audio::Scan->scan_tags($foo);
print "still here\n";
#print "---------ARGV[1]: ".ref(\$ARGV[1])." \n"; # <- uncommenting this line will make the segfault go away
print Dumper($ARGV[1]);
my $tags = Audio::Scan->scan_tags($ARGV[1]);
print "still here\n";
-------------
The system is a Debian GNU/Linux i686.
$ perl -v
This is perl, v5.10.0 built for i486-linux-gnu-thread-multi
...
$ uname -a
Linux jukebox 2.6.26-1-686 #1 SMP Sat Jan 10 18:29:31 UTC 2009 i686 GNU/Linux
I'll attach the output of a perl -d trace from the second scan_tags()
call up the the point where it dumps me back on the shell prompt.
cheers
-henrik
Message body is not shown because sender requested not to inline it.