I've just installed B::C and am playing with perlcc. When I attempt to
compile a non-trivial CGI script to binary, perlcc fails:
$ perlcc -o foo cms.pl
/usr/local/bin/perlcc: cms.pl did not compile, which can't happen:
warning: IV !IOK sv_list[8270] at /usr/local/lib/perl/5.10.1/B/C.pm
line 1388.
Segmentation fault
When I compile using the bytecode backend:
$ perlcc -B -o bar cms.pl
the output file works and seems faster! :-)
How do I troubleshoot the binary output case?
Are there measurable differences between the binary and the bytecode
outputs?
TIA,
David
$ cat /etc/debian_version
6.0.2
$ perl --version
This is perl, v5.10.1 (*) built for i486-linux-gnu-thread-multi
(with 53 registered patches, see perl -V for more detail)
$ grep 'our..VERSION' `which perlcc`
our $VERSION = 2.12;
Thank you for your help. :-)
$ perlcc -v6 -o foo cms.pl 2>&1 | wc
59260 301847 2705114
OMG I'll pass for now.
> If the code is free I could debug it.
I added the GPL and boiled down my code (tarball attached):
1. A module Dpchrist::Core.
2. A Perl script perlcc-bug.t
3. A shell script to light it off EXERCISE_BUG.sh
It has something to do with what remains:
1. Dpchrist::Core -- moving or renaming the package changes the error
message.
2. use Log::Log4perl qw( :easy ) -- eliminating or not using in easy
mode changes the error message.
3. require Exporter, @ISA, %EXPORT_TAGS, @EXPORT_OK -- eliminating or
modifying anything, or defining a subroutine "CATEGORY", changes the
error message.
4. use constant FOO => qr/::/ -- eliminating or not using a regex value
changes the error message.
So, there's potential for some complex interactions left in there.
Here's a sample run:
2011-10-08 22:11:56 dpchrist@p43400e ~/sandbox/perl/perlcc-bug
$ ./EXERCISE_BUG.sh
perlcc -o foo perlcc-bug.t
/usr/local/bin/perlcc: perlcc-bug.t did not compile, which can't
happen:
warning: IV !IOK sv_list[25] at /usr/local/lib/perl/5.10.1/B/C.pm
line 1388.
Segmentation fault
I noticed the sv_list[] index getting smaller as I threw code out. I
assume that's a stack? 25 deep is better than 8270! -v6 is much
smaller, but still big:
$ perlcc -v6 -o foo perlcc-bug.t 2>&1 | wc
2284 11416 102162
Good luck debugging it. Let met know if I can do anything. :-)
David
2011-10-08 22:13:50 dpchrist@p43400e ~/sandbox/perl/perlcc-bug
$ perl -MLog::Log4perl -e 'print $Log::Log4perl::VERSION, "\n"'
1.33
2011-10-08 22:18:09 dpchrist@p43400e ~/sandbox/perl/perlcc-bug
$ perl -MExporter -e 'print $Exporter::VERSION, "\n"'
5.63