in reply to Abnormal exit with threads, LWP and the Perl Debugger

Did you get any resolution to this problem?

I don't have anything to offer -- I haven't had a debugger that worked with threads for many builds; but then I didn't find it useful when it did work -- but I'd be interested to know what if any progress you've made?


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?

  • Comment on Re: Abnormal exit with threads, LWP and the Perl Debugger

Replies are listed 'Best First'.
Re^2: Abnormal exit with threads, LWP and the Perl Debugger
by chrestomanci (Priest) on Jan 27, 2012 at 11:39 UTC

    No, I did not get a resolution.

    At the moment I am using a work around where if I want to debug the parts of the code that do http requests I run a single threaded version of the script, and if I want to debug the threading stuff, I comment out the http stuff and replace it with dummy placeholder code.

    It would be nice to know where the bug lies so that I can report it to the correct place, though seeing as LWP is core, perhaps I should just report it as a bug against perl, and not concern myself with which module is to blame.

      Perhaps the simplest workaround -- and potentially quick way to trace the origin -- would be to satisfy the missing call:

      ## somewhere at the top of your application. BEGIN { package Devel; use Carp qw[ cluck ]; sub CLONE { cluck "Devel::CLONE called with args [ @_ ]"; } }

      That ought to both get you passed the symptom and provide a full trace-back to the originating cause.

      You might have to experiment with return values to prevent some error action being taken.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      The start of some sanity?

Re^2: Abnormal exit with threads, LWP and the Perl Debugger
by chrestomanci (Priest) on Jan 28, 2012 at 10:16 UTC

    I have tested again using the recent perl 5.15.7 release (Locally compiled with perlbrew), and the bug has disappeared, so it looks like someone else has found and fixed it.

      I'd still be interested to see the traceback from the call to Devel::CLONE. it might shed some light on why when I try to run your sample above under the debugger, it segfaults before it ever reached the DB prompt.

      It would also be nice to track the cure of the bug back to the change that fixed it to give us a more sure feeling that it has been fixed and not just moved,


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      The start of some sanity?

        I have compiled perl-5.15.1 and tested with that. The bug is present.

        I also implemented your suggestion to add some code to catch the CLONE call. I got:

        $ perl -d debugLWPtheads.pl Loading DB routines from perl5db.pl version 1.33 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(debugLWPtheads.pl:35): exit main(); + DB<1> c Starting a thread to find all SHAs Devel::CLONE called with args [ Devel ] at debugLWPtheads.pl line 9 th +read 1 Devel::CLONE('Devel') called at debugLWPtheads.pl line 23 thread 1 at debugLWPtheads.pl line 9 thread 1 Devel::CLONE('Devel') called at debugLWPtheads.pl line 23 thread 1 This line should be reached without error messages. Debugged program terminated. Use q to quit or R to restart, use o inhibit_exit to avoid stopping after program termination, h q, h R or h o to get additional info. + Thread 1 terminated abnormally: Undefined subroutine &Cwd:: +CLONE called at debugLWPtheads.pl line 23. at debugLWPtheads.pl line 23 thread 1 DB<1> Scalars leaked: 1 Use `q' to quit or `R' to restart. `h q' for details.

        It looks like the package of the CLONE call is moving around, as I reported in my original post.

        Also, as it looks like this is a genuine bug rather than a mistake on my part, should this discussion be moved to a different part of the Monastery?

      and the bug has disappeared, so it looks like someone else has found and fixed it.

      or it just moved to some other bit of memory