[tpm] my perl program seg faults

Indy Singh indy at indigostar.com
Thu May 3 13:08:59 PDT 2007


I don't have a real answer, but a few hacks that may help.

Put a print statement at the end of your code so that you know for sure whether it is dying at the end or near the end.

I noticed that dynamic libraries are never unloaded, see if this but code at the end of your script helps:
DynaLoader::dl_unload_file($_) foreach (@DynaLoader::dl_librefs);

As another hack you could try redirecting STDERR to /dev/null at the end of your script.  I think something like this may work:
open (STDERR, ">/dev/null");

Indy Singh
IndigoSTAR Software -- www.indigostar.com


----- Original Message ----- 
From: "Fulko Hew" <fulko.hew at gmail.com>
To: <tpm at to.pm.org>
Sent: Thursday, May 03, 2007 3:57 PM
Subject: [tpm] my perl program seg faults


> I've posted this to PerlMonks, but I thought I'd throw it out to TPM as well...
> 
> My latest app, is a forking TCP server/client. It runs fine and does
> its thing. So I put it into a shell loop, and every once in a while I
> see it die (near or at the end of processing where its exiting) and
> say:
> 
> "Segmentation fault"
> 
> My guess is its happening after my app says exit, and Perl is doing
> its clean up. But I'd rather never see the error message. ISTR that
> this isn't the first app of mine that randomly emits this message on
> shutdown, but this time around its anoying me. How can I find out
> where/why its dying?
> 
> B.T.W. perl -v says: "This is perl, v5.8.8 built for i386-linux-thread-multi"
> _______________________________________________
> toronto-pm mailing list
> toronto-pm at pm.org
> http://mail.pm.org/mailman/listinfo/toronto-pm



More information about the toronto-pm mailing list