Subject: | segmentation fault in 'do' |
Date: | Sat, 19 Sep 2009 22:32:29 +0900 |
To: | bug-Devel-NYTProf [...] rt.cpan.org |
From: | Tokuhiro Matsuno <tokuhirom [...] gmail.com> |
following one liner cause segv.
echo 'sub{exit}' > foo.pl; perl -d:NYTProf -e 'my $h = do "./foo.pl"; $h->()'
------------------------------------------------------
tokuhirom@skinny% gdb perl
[~/dev/Plack] 土 19 22:29
GNU gdb 6.3.50-20050815 (Apple version gdb-1344) (Fri Jul 3 01:19:56 UTC 2009)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for
shared libraries ... done
(gdb) run -d:NYTProf -e 'my $h = do "./foo.pl"; $h->()'
Starting program: /opt/local/bin/perl -d:NYTProf -e 'my $h = do
"./foo.pl"; $h->()'
Reading symbols for shared libraries ++.. done
Reading symbols for shared libraries .. done
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
0x00007fff844d3c00 in strlen ()
(gdb) bt
#0 0x00007fff844d3c00 in strlen ()
#1 0x0000000100190029 in pp_entersub_profiler ()
#2 0x000000010001a34f in Perl_call_sv ()
#3 0x000000010001a65f in Perl_call_list ()
#4 0x000000010001b8da in perl_destruct ()
#5 0x00000001000010f8 in main ()