in reply to panic: attempt to copy freed scalar a7b9650 to ad20598

The obvious question is: Which change caused the problem, new perl or Try::Tiny?

  • Comment on Re: panic: attempt to copy freed scalar a7b9650 to ad20598

Replies are listed 'Best First'.
Re^2: panic: attempt to copy freed scalar a7b9650 to ad20598
by mje (Curate) on Dec 03, 2009 at 16:16 UTC

    Problem goes away when I remove the Try::Tiny code and change it back to eval. I'd rather not do that, I'd rather find the problem.

      I doubt the problem is with Try::Tiny. This kind of problem is caused by bugs in Perl code or code that uses Perl as a library (XS code, B::, etc), and Try::Tiny doesn't have anything that. In fact, it's a tiny (living up to its name) and straightforward (nothing fancy) Perl module.

      Start by trying your code on 5.10.1. Lots of bug fixes there.

        I have built a default build of 5.10.1. It probably does not match how ubuntu build it (I don't know how they build it). When I run the problem code now I get the following on the console:

        Variable "$clientref" is not available at /home/martin/server/q.pl.pan +ics line 1894, <GEN506> line 1.

        It is strange as that line is the "};" at the end of the catch block. Although $clientref is referenced in the try block it is created above with a my at the start of the sub containing the try.

        I'll try 5.10.1 but that will take a while to build and then install all the modules. It will also be annoying if it is fixed in 5.10.1 as this box is currently only using a packaged perl and I think the only upgrade path would be to delete the packaged perl and build our own (thus losing the benefit of the package system). There is some XS code (DBD::Oracle) inside the try and catch blocks but it works inside a simple eval (but then again, as you say Try::Tiny is really only an eval wrapper).