http://qs321.pair.com?node_id=810858

mje has asked for the wisdom of the Perl Monks concerning the following question:

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?