We had an experience at $w0rk today, which took us all a bit aback.
We had an segmentation fault with one of our Perl modules - of course it had to be one of mine, so accusations were flying like rocks on N0rrebro.
Anyways, after a scheduled update of some systems, where a lot of people had not been notified, including my technical contact (I am there as a consultant), things have not been working perfectly since the weekend, but the smoke is clearing.
So today we started out with a day where everything I touched broke. I had handed over one of my applications for finalization to another consultant - and boom it exploded with a segmentation fault
and a core dump.
This generated a lot of commotion, since we code pure-perl, our mod_perl trouble have long gone, or we do not see that so often anymore. So this we all had to see it.
So the all (3) of us gathered around the keyboard and came with suggestions to as what the problem could be, I think we where all equally excited over seeing something like this in Perl, we have not these for ages.
The Perl installed was a 5.8.7 with one patch and the problem seemed to be with Error
an old version of Error
.
This is the code giving us a hard time:
package test;
use Error qw(:try);
sub _something {
my ($self, $request, $session) = @_;
my $login = $session->{idents}->{login};
my $number = $request->{param}->{ban_number};
my $no = $request->{param}->{subscriber_no};
try {
my $test = test::Test->new(test => $login);
$result = $test->testMethod(
Number => $number;
No => $no;
);
if ($result->{code} != 0) {
throw selfservice::Exception($result->{message}, $result->{code});
}
}
}
1;
As you can see the arguments to
testMethod
are separated by semi-colons, which normally give you a nice syntax error, but in this case it,
core dumped.
We could even get it to give us a
bus error
with a different combination :)
I have not been able to replicate it anywhere else, so I guess we just correct the syntax and update
Error
accordingly - we even asked a fellow Perl Monger to attempt to compile it on his 5.8.7, but without luck (this pointed us to
Error
).
But it was with some excitement and under some commotion we gathered around a single laptop to see perl
core dump, not exactly your everyday experience.
I can reproduce it
Yanick on 2007-03-13T22:35:19
In case you're still interested to know if it can be reproduced elsewhere, I can see it on my home machine too:
yanick@enkidu ~/tmp $ perl core.pl
Segmentation fault
yanick@enkidu ~/tmp $ perl -MError -le'print $Error::VERSION'
0.15008
yanick@enkidu ~/tmp $ perl -V
Summary of my perl5 (revision 5 version 8 subversion 6) configuration:
Platform:
osname=linux, osvers=2.6.12-gentoo-r6enkidu, archname=i686-linux
uname='linux enkidu 2.6.12-gentoo-r6enkidu #4 tue aug 2 16:04:40 edt 2005 i686 amd sempron(tm) processor 3100+ authenticamd gnulinux '
config_args='-des -Darchname=i686-linux -Dcccdlflags=-fPIC -Dccdlflags=-rdynamic -Dcc=gcc -Dprefix=/usr -Dvendorprefix=/usr -Dsiteprefix=/usr -Dlocincpth= -Doptimize=-O2 -march=i686 -fomit-frame-pointer -Duselargefiles -Dd_semctl_semun -Dscriptdir=/usr/bin -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dinstallman1dir=/usr/share/man/man1 -Dinstallman3dir=/usr/share/man/man3 -Dman1ext=1 -Dman3ext=3pm -Dinc_version_list=5.8.0 5.8.0/i686-linux 5.8.2 5.8.2/i686-linux 5.8.4 5.8.4/i686-linux 5.8.5 5.8.5/i686-linux -Dcf_by=Gentoo -Ud_csh -Di_ndbm -Di_gdbm -Di_db'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='gcc', ccflags ='-fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O2 -march=i686 -fomit-frame-pointer',
cppflags='-DPERL5 -fno-strict-aliasing -pipe'
ccversion='', gccversion='3.3.4 20040623 (Gentoo Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6)', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='gcc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib
/lib
/usr/lib
libs=-lpthread -lnsl -lndbm -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
libc=/lib/libc-2.3.4.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version='2.3.4'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: USE_LARGE_FILES
Built under linux
Compiled at Jan 1 2006 13:44:58
@INC:
/etc/perl
/usr/lib/perl5/site_perl/5.8.6/i686-linux
/usr/lib/perl5/site_perl/5.8.6
/usr/lib/perl5/site_perl/5.8.4
/usr/lib/perl5/site_perl/5.8.4/i686-linux
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.6/i686-linux
/usr/lib/perl5/vendor_perl/5.8.6
/usr/lib/perl5/vendor_perl/5.8.4
/usr/lib/perl5/vendor_perl/5.8.4/i686-linux
/usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.6/i686-linux
/usr/lib/perl5/5.8.6
/usr/local/lib/site_perl
.
Re:I can reproduce it
jonasbn on 2007-03-14T05:33:59
Well, then I think our assumptions are correct, taking you version of Error
into consideration:
yanick@enkidu ~/tmp $ perl -MError -le'print $Error::VERSION'
0.15008
I wonder if it is a combination of perl
and Error
or just that particular version of Error
Re:I can reproduce it
Yanick on 2007-03-14T12:58:01
I have no clue. I tried to simplify the program producing the core, and it seems to be very tricky. Any line removed downgrade the core to a slew of syntax errors. Very weird...