I realise this is a tough one but I'm hoping someone might be to give me new ideas on how to track this error down. Background: a very large application written in Perl and happily running on 5.8 on another server. Moved to new server with 5.10.0 AND changed some code to use Try::Tiny and now we get a lot of these panics.
I've tried reproducing the problem in a small example but have failed. That example looks something like this:
use Try::Tiny;
use Log::Log4perl qw(get_logger :levels);
Log::Log4perl->init_and_watch('/etc/log4.conf', 60);
my $log = get_logger('Q::S');
fred();
sub fred
{
my $x = try {
dave();
0;
} catch {
my $ev = $_;
if (0) {
eval {
my $a = 1;
1;
} or $log->warn("failed $@");
} else {
$log->logwarn("test $_");
}
1;
};
print "$x\n";
return if $x; # <---- this would be q.pl line 1895
}
sub dave
{
# the following line would be DB.pm line 1380
my ($sth, $options, @args) = @_;
}
The big problem is we seem to have to run this code a while before it starts happening and then it happens all the time. I can run the code in debug and I get slightly more out of it:
perl -t -I /home/martin/modules/BET/lib q.pl -n1 -p 9999 -r -c /etc/se
+rvices.ini
Attempt to free unreferenced scalar: SV 0xa7b9650, Perl interpreter: 0
+x9ad0008 at q.pl line 1895, <GEN41> line 1.
Failed to insert into job_audit, panic: attempt to copy freed scalar a
+7b9650 to ad20598 at /home/martin/modules/X/lib/X/DB.pm line 1380, <G
+EN42> line 1.
Any ideas how to identify the freed scalar and track this down?
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.