|more useful options|
Abnormal exit with threads, LWP and the Perl Debuggerby chrestomanci (Curate)
|on Jan 20, 2012 at 11:55 UTC||Need Help??|
chrestomanci has asked for the
wisdom of the Perl Monks concerning the following question:
Greeting wise brothers.
I am experiencing a problem debugging code that uses threads and LWP::UserAgent. I have reduced my failing code to this snippet:
If in the debugger, I attempt to step over the line where the thread is created, I get an error: Thread 1 terminated abnormally: Undefined subroutine &Devel::CLONE called at demoLWP_threadBug.pl line 13. and a breakpoint in the findAndQ_sha() function is not reached. If I run without the debugger the script runs normally.
I am testing with perl 5.12.4 on Ubuntu Oneiric Linux, AMD64
If I comment out the use HTTP::Request; and use LWP::UserAgent; lines, then the code runs correctly in the debugger.
The script I am working on is using a Thread_pool design pattern. One thread is created to populate a queue of URLs that need fetching and processing, and a number of other worker threads are created to read from the queue and process each URL in turn. In the full (non reduced) version of the script, the package where the undefined CLONE subroutine was searched for varies.
Can anyone shed any light on this problem? is it a bug in LWP?