tokuhirom's Blog

-DDEBUGGING つきでコンパイルした Perl5 を用意しておいてバグレポートに活用する

perlbrew を利用している場合、用意に -DDEBUGGING つきの perl5 をビルドすることができる(利用していなくても容易にビルド可能だが、より容易となる)。

perlbrew install perl-5.12.1 -D=DEBUGGING -as perl-5.12.1-DDEBUGGING

のようにするだけ。

tokuhirom@gpath% gdb --args /home/tokuhirom/perl5/perlbrew/perls/perl-5.8.9-DDEBUGGING/bin/perl -e 'use indirect; BEGIN { indirect::unimport("", ":fatal") }warn "OK"; my $y=undef; "@{[ a->$y ]}"'
GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/tokuhirom/perl5/perlbrew/perls/perl-5.8.9-DDEBUGGING/bin/perl...done.
(gdb) run
Starting program: /home/tokuhirom/perl5/perlbrew/perls/perl-5.8.9-DDEBUGGING/bin/perl -e use\ indirect\;\ BEGIN\ \{\ indirect::unimport\(\"\",\ \":fatal\"\)\ \}warn\ \"OK\"\;\ my\ \$y=undef\;\ \"@\{\[\ a-\>\$y\ \]\}\"

Program received signal SIGSEGV, Segmentation fault.
indirect_ck_method (o=0x787f20) at indirect.xs:662
662        if (!SvPOK(sv) || (SvTYPE(sv) < SVt_PV))
(gdb) p sv
$1 = (SV *) 0x0