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?


In reply to panic: attempt to copy freed scalar a7b9650 to ad20598 by mje

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.