jhanna has asked for the wisdom of the Perl Monks concerning the following question:
This is a follow up to node Mysterious script crash in win2k
I localized the last crash to this subroutine. d(34) printed 34 in the debug file, but the $m never appeared on the console, nor in the DEBUG log file (which is unbuffered), neither in the LOG file.sub mlog { my $fh=shift; d(34); my $m=localtime(); $m=~s/^... (...) +(\d+) (\S+) ..(..)/$1-$2-$4 $3/; $m.= " $Con{$fh}->{ip} <$Con{$fh}->{mailfrom}>" if $fh && $Con{$fh}; $m.= " $_[0]\n"; print $m unless $silent; print DEBUG $m; if($logfile && open(LOG,">>$logfile")) {print LOG $m; close LOG;} }
This means the program crashed inside localtime(), or doing a s/// regexp replace, or concatenating to a string ($m). The $_[0] parameter that was passed in was a string constant: 'local or whitelisted', and was called this way:
The setmaillog and isnotspam functions operated correctly and also affirm that $this is not corrupted.if(onwhitelist($fh,$this->{header})) { setmaillog(0,$fh); isnotspam($fh); mlog($fh,'local or whitelisted'); }
Help! Something I'm doing is corrupting perl internally, and I don't know how to find that kind of bug!
john
P.S. Here's my perl's version:
This is perl, v5.6.1 built for MSWin32-x86-multi-thread (with 1 registered patch, see perl -V for more detail) Copyright 1987-2001, Larry Wall Binary build 630 provided by ActiveState Tool Corp. http://www.ActiveState.com Built 20:29:41 Oct 31 2001
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: still have a mysterious crash
by Thelonius (Priest) on Dec 17, 2002 at 19:07 UTC | |
by jhanna (Scribe) on Dec 17, 2002 at 19:17 UTC | |
Re: still have a mysterious crash
by dingus (Friar) on Dec 17, 2002 at 19:08 UTC | |
by jhanna (Scribe) on Dec 17, 2002 at 19:20 UTC |
Back to
Seekers of Perl Wisdom