Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: Segfault on second (identical) call to a sub

by syphilis (Archbishop)
on Feb 05, 2006 at 01:04 UTC ( [id://528028]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Segfault on second (identical) call to a sub
in thread Segfault on second (identical) call to a sub

Unfortunately, I am still seeing the same problems which probably means that they are down to 5.8.7 core and all the time I spent rebuilding all my packages was wasted as I'll have to go through it all again for 5.8.8

Not sure that I understand you correctly ... I don't think you have to re-build any packages when you upgrade. The GD-2.30 that triggers the error on perl 5.8.7 is the very same GD-2.30 that produces no error on perl 5.8.8. It was built probably using perl 5.8.7, or perhaps perl 5.8.6, but I didn't re-build it when I installed perl 5.8.8.

(I don't think ActiveState have yet released a 5.8.8 build, and I don't know how long it will be before they do.)

Cheers,
Rob
  • Comment on Re^3: Segfault on second (identical) call to a sub

Replies are listed 'Best First'.
Re^4: Segfault on second (identical) call to a sub
by BrowserUk (Patriarch) on Feb 05, 2006 at 01:41 UTC

    I'll try to clarify :)

    I usually upgrade AS perl builds without rebuilding the packages that don't come with it. That's worked reliably since 5.8.0. However, when I first installed 5.8.7/AS813, the installed failed right towards the end. It didn't tell me what failed, but I am guessing that it was generating the HTMLised POD. It insisted on backing the install off, but left the previous 5.8.6 build broken to the point where perl simply wouldn't start. AS support suggested that I should always uninstall the previous build, (leaving the non-AS packages in place), before installng a new AS build. I attempted this with AS813 but it still failed at the end in the same way.

    I reinstalled 5.8.6 over the top of what was left and things seemed okay. A few days later AS815 became available so I got that, uninstalled 5.8.6, again leaving the non distribution packages in place and attempted the AS815 install. It went through cleanly.

    However, there were various instances of previously working code doing strange things--mostly resulting in a "free to wrong pool". I've seen this message a lot in the past with code that used threads badly, but these were simple non-threaded programs. The latest of which is the subject of the OP. This a highly cut-down version of a program that has worked fine since 5.8.3 and through several upgrades of GD, that suddenly started working one time but not the next. As you can see from the OP and zentara's post above, it is really very obscure when you can call a sub successfully once, or even twice to do exactly the same processing, from different places in the code--but not twice from the same place!

    So, given the immediate preceding history of failed installed and broken restorations, I was unable in good conscience to 'point the finger' at 5.8.7. Hence my need to re-build everything clean to be sure.

    My fear is, that as I have now built all those packages in conjunction with 5.8.7, whatever malady is the root cause of the segfault may now be compiled into, (via errors in the Perl header files?), all the (XS components of) packages that I built in conjunction with it.

    It may be that the problem was unrelated to the header files in any way, but with perl 5.8.7 delta saying

    There has been a fair amount of refactoring of the C source code,

    can I be sure?


    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.
      My fear is, that as I have now built all those packages in conjunction with 5.8.7, whatever malady is the root cause of the segfault may now be compiled into, (via errors in the Perl header files?), all the (XS components of) packages that I built in conjunction with it.

      I think that fear is misplaced - I think it would be a rare case that a perl extension will need to be re-compiled (or benefit in any way from re-compiling) when you switch to perl 5.8.8.

      Anyway, time will tell .... :-)

      The error can still arise in perl 5.8.8. If you have a compiler, and Inline::C installed, and you run the Object Oriented Inline example from Inline's C-Cookbook.pod, you should get the "Free to wrong pool ..." error on Windows. That error still persists with perl 5.8.8 - but that's because it's the code in the Cookbook example that's in need of correction.

      Cheers,
      Rob

        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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://528028]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2024-04-19 15:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found