5.8.8 certainly cures the problem with my cut down code above, but not with the code from which it is derived :(

Now to go through the process of reducing it all over again.

Update:

If you get a moment, could you try wrapping the sub call in the OP code in a loop and calling say 10 times under 5.8.8? From what I am seeing, it appears that 5.8.8 allows me to call it twice without failure, but goes belly up after 4 or 5 times.

The cuprit appears to be something in GD, but a quick scan of GD.xs shows none of the bad things demo'd in in the OO Inline C example. It use Safemalloc/Safefree exclusively and make no calls to str(n)dup(), or any of the other dodgey crt string functions.

I tried upgrading GD to 2.30. It builds clean(ish), but segfaults when running it's testsuite. (And yes. I made sure I had the latest version of gdlib: v2.0.33 :)


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re^6: Segfault on second (identical) call to a sub by BrowserUk
in thread Segfault on second (identical) call to a sub by BrowserUk

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.