[Pdx-pm] Strange Random coredumps

Martin Schneider Martin.Schneider at tntsoftware.com
Thu Dec 19 15:32:57 CST 2002


On the SQL 2000 side, are there any significant events in the Windows
event logs?  If you suspect the Perl to SQL communications, SQL has a
tracing tool called Profiler, but trace file size may become an issue.
If you're running Perl on Windows, and switch to ODBC, then Data Sources
(ODBC) also has a trace feature (but same issue).

Martin Schneider
- Standard disclaimers apply -

-----Original Message-----
From: Mark Hartley [mailto:mark at drapple.com] 
Sent: Thursday, December 19, 2002 12:35 PM
To: pdx-pm-list at pm.org
Subject: [Pdx-pm] Strange Random coredumps

I am having a very frustrating problem with a few Perl apps
I've written randomly dumping core, and I'm hoping someone can
point me in a direction to find the cause.

A little background as to what I'm doing:
I have a whole bunch of applications that I've written which run
as a CGI under Apache (1.3.26) on a FreeBSD (4.6.2-RELEASE-p4) machine.
There are actually 3 of these machines, one of which is running SSL.
All 3 machines are using Perl 5.005_03.

The applications are talking to a MS SQL server 2000 database (not by
my choice).  I am using DBI:Sybase drivers to talk to the db.  I know
that I could use ODBC drivers as well, but right now I'm using the
Sybase ones.

OK, now to the problem:

These applications get a fair amount of traffic each day (something
the lines of 32,000 hits per day).  One specific app takes about 25% of
that.  Now, the app runs about 8000 times per day, and it will randomly
dump core anywhere from 0 up to 100 times per day, leaving no
information in 
Apache's error log as to what happened.  The 0 days are good, but the
other days 
I end up taking heat from the client.  I've tried adding debugging code
into the
scripts to try and find where it dies, and I've had a reasonable amount
success with this method, but the code is correct.  The places where it
is dying
don't seem to to form any kind of a pattern. Sometimes it dies trying to
from the db, other times it will die while trying to generate some
output. But
I know the code is correct and works.  I've gone over it a zillion
times, and it 
runs perfectly over 7500 times per day. If I try to run it through the
debugger by hand, everything seems to work just fine, but with the fact
that it
runs fine 98% of the time, that doesn't surprise me.

This is happening with several of the scripts.  I was just using this
one as 
an example.  I've found I can significantly reduce the number of times
applications die if I simply put a:

print STDERR "foo\n";

in the script in a few different places.  It makes no sense to me why
a few of those will cause a script to be significanlty more stable if I
those.  I realize I can just leave them in, but it feels like a bandaid,
it doesn't eliminate the problem, it just reduces it.

Now some of these Perl scripts are reasonably large (the one I mention
is 72kb with nearly 2000 lines), but the coredumps also happen on
scripts with
only a couple hundred lines of code.

Does anyone have any advice or anything they can help me figure out with
to this.


Pdx-pm-list mailing list
Pdx-pm-list at mail.pm.org

More information about the Pdx-pm-list mailing list