Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

jonasbn (1153)

  reversethis-{gro.napc} {ta} {nbsanoj}
AOL IM: BJonasN (Add Buddy, Send Message)

Perl Programmer located in Copenhagen, Denmark. Active member of Copenhagen Perl Mongers.

Author of:

  • Business::DK::CPR
  • Business::DK::CVR
  • Business::DK::PO
  • Business::OnlinePayment::CashCow
  • Date::Holidays
  • Date::Holidays::Abstract
  • Date::Holidays::Super
  • Date::Pregnancy
  • Games::Bingo
  • Games::Bingo::Bot
  • Games::Bingo::Print
  • Module::Info::File
  • Module::Template::Setup
  • Test::Timer

and maintainer of:

  • Tie::Tools
  • XML::Conf
  • Workflow

Journal of jonasbn (1153)

Tuesday March 13, 2007
03:26 PM

Big commotion and excitement at $w0rk

[ #32677 ]

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});

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.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • 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
    Segmentation fault
    yanick@enkidu ~/tmp $ perl -MError -le'print $Error::VERSION'
    yanick@enkidu ~/tmp $ perl -V
    Summary of my perl5 (revision 5 version 8 subversion 6) configuration:
            osname=linux, osvers=2.6.12-gentoo-r6enkidu, archname=i686-linux
            uname='linux enkidu 2.6.12-gentoo-r6
    • Well, then I think our assumptions are correct, taking you version of Error into consideration:
      yanick@enkidu ~/tmp $ perl -MError -le'print $Error::VERSION'

      I wonder if it is a combination of perl and Error or just that particular version of Error
      • 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...