Thanks, that did help. The extra level of sub call/return allowed me to see the stack frame just before and after the trap occurs (in 5.8.8). It's happening as perl cleans up it's stack after the nested call; in Perl_free_temps(). It shows (I think), that the problem is nothing to do with GD but rather with the perl executable itself:

PID: 320 TID: 1716 - Stack Contents for 0x280EAF30 0x280EAF30: perl58.dll:VMem::Free + 0x0054 <Void> 0x280EF62F: perl58.dll:CPerlHost::Free + 0x0021 <Void> 0x280EBE12: perl58.dll:PerlMemFree + 0x0016 <Void> 0x280E4E37: perl58.dll:Perl_safesysfree + 0x002A <Void> 0x280AEE3B: perl58.dll:Perl_sv_clear + 0x06EE <Void> 0x280AF2B0: perl58.dll:Perl_sv_free + 0x013E <Void> 0x280024D5: perl58.dll:Perl_av_undef + 0x008D <Void> 0x280AED0E: perl58.dll:Perl_sv_clear + 0x05C1 <Void> 0x280AF2B0: perl58.dll:Perl_sv_free + 0x013E <Void> 0x280350D8: perl58.dll:Perl_pad_undef + 0x0227 <Void> 0x280EF62F: perl58.dll:CPerlHost::Free + 0x0021 <Void> 0x2802CD37: perl58.dll:Perl_cv_undef + 0x0138 <Void> 0x280AECEA: perl58.dll:Perl_sv_clear + 0x059D <Void> 0x280AF2B0: perl58.dll:Perl_sv_free + 0x013E <Void> 0x280A2CEA: perl58.dll:Perl_free_tmps + 0x0077 <Void> 0x28065C6F: perl58.dll:Perl_pp_nextstate + 0x005F <op *> 0x280A26CD: perl58.dll:Perl_runops_standard + 0x000F <Int> 0x2803A9C5: perl58.dll:S_run_body + 0x018F <Void> 0x2803A562: perl58.dll:perl_run + 0x008A <Int> 0x280EEC9F: perl58.dll:RunPerl + 0x00A1 <Int> 0x7C0068F7: __getmainargs + 0x00BD 0x00401012: perl.exe:main + 0x0012 <Int> 0x0040115A: perl.exe:mainCRTStartup + 0x0143 <Int> 0x77E814C7: GetCurrentDirectoryW + 0x0044

In every other version I've traced, the stack is already corrupted by the time the trap occurs and so it was impossible to tell where I was in the code. I your version, the trap occurs much closer to the origin of the corruption and so the stack trace is still intact.

If I could get a version of the trap that didn't call GD at all would be the best demonstration, but maybe the above stacktrace is convincing when combined with the same code running clean under 5.8.6--which I will now re-install.

Thanks again for your help.


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^2: 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.