Hi fellow perlmonks,
this morning I am trying to debug a program which is making use of Thread::Queue. Fortunately, the person who wrote it in the first place included an option "--debug" so the program does not use Threads, making debugging easier. However, I am encountering a problem which I currently have no clue how to tackle:
If I start the program in the debugger it blurts out error messages and dies:
perl -d ./program --debug ~/github/sbin/programconfig
Loading DB routines from perl5db.pl version 1.44
Editor support available.
Enter h or 'h h' for help, or 'man perldebug' for more help.
lock can only be used on shared values at /usr/opt/perl5/lib/5.20.1/pe
+rl5db.pl line 4101.
BEGIN failed--compilation aborted at /usr/opt/perl5/lib/5.20.1/Thread/
+Queue.pm line 9.
Compilation failed in require at ./program line 1156.
BEGIN failed--compilation aborted at ./program line 1156.
lock can only be used on shared values at /usr/opt/perl5/lib/5.20.1/pe
+rl5db.pl line 4101.
END failed--call queue aborted at ./program line 1156.
lock can only be used on shared values at /usr/opt/perl5/lib/5.20.1/pe
+rl5db.pl line 2514.
END failed--call queue aborted at ./program line 8615.
Unbalanced scopes: 6 more ENTERs than LEAVEs
If I start the same thing on the command line without the debugger, it just runs:
./program --debug ~/github/sbin/programconfig
I am a bit at loss how to properly debug this, as I am doing a feature extension and I am trying to hunt down an error. Any Ideas why Thread::Queue dies in the debugger but runs without the debugger? Looking at other questions regarding Thread::Queue it should be possible to debug it (although it could be hard with the threading). Also I admit, I don't quite understand the error message (the part about locking and the unbalanced scopes).
Appreciating any hints!
Yulivee
Update
I got this working. For anyone who stumbles upon this: Threads need to be explicitly enabled in the debugger, even if they are not in in use. As soon as a threads module is in user, one needs to start the debugger with perl -d
t program.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.