User forums > Help
CodeBlocks Debugger on Loading Dynamic/Shared Libraries No Response
yankes:
Hello all,
I am experiencing some trouble while debugging on CodeBlocks 12.11 for Linux (Ubuntu). I have both installed CB under Windows and Linux. Under Windows the debugger seems to work just fine, however on Linux I am experiencing the following problem:
I start the debugging normally without any problems. But on a line where I have a dynamic shared library loading, the debugger seems to freeze and gives no more response. So basically I can't debug my application.
The line when it stops is the following:
cs_demo = dlopen("content_supplier.so", RTLD_LAZY);
On Windows, though, the similar line of LoadLibrary let's me continue my debugging without any problem. This is not a question of wrong filename or something, because if it would be the function dlopen would just return 0 and on a call for dlerror() I would just get the string with the error, so the question is: Why Debugger stops responding ? Is it a BUG? Or am I forgetting to do something on Debugger Options?
Thank you very much in advance.
Jenna:
Does it work, if you do not debug ?
You can run into a deadlock when doing thread related stuff in the init-routine/constructor of the shared library.
See: https://bugzilla.redhat.com/show_bug.cgi?id=661676 .
And the behaviour might be different on linux and windows (as always).
Did you turn on the debuggers debug-log to see if you get some information ("Settings -> Debugger -> Common -> Full (debug) log") ?
Can you stop the debugger and get a backtrace ?
What happens if you debug from commandline ?
yankes:
Thanks for such quick answer.
Well actually I am quite confused if am running into a deadlock or not. This is the message returned by the debugger and I have full log enabled.
[debug]>>>>>>cb_gdb:
[debug]> next
[debug]Cannot find new threads: generic error
[debug][Thread debugging using libthread_db enabled]
I am also getting on console a GDB warning:
warning: GDB: Failed to set controlling terminal: Operation not permitted
About the backtrade, shouldn't I be expecting that a box should have popped up offering to show me a "backtrace" after stopping debugger?
What it seems to me is that the Debugger NEVER returns from the dlopen call, I can stop it without any problems.
Thanks in advance for your support
Jenna:
--- Quote from: yankes on March 08, 2013, 12:22:05 pm ---Thanks for such quick answer.
Well actually I am quite confused if am running into a deadlock or not. This is the message returned by the debugger and I have full log enabled.
[debug]>>>>>>cb_gdb:
[debug]> next
[debug]Cannot find new threads: generic error
[debug][Thread debugging using libthread_db enabled]
I am also getting on console a GDB warning:
warning: GDB: Failed to set controlling terminal: Operation not permitted
About the backtrade, shouldn't I be expecting that a box should have popped up offering to show me a "backtrace" after stopping debugger?
What it seems to me is that the Debugger NEVER returns from the dlopen call, I can stop it without any problems.
Thanks in advance for your support
--- End quote ---
To get a backtrace if the debugger is paused (not if the debugger hangs), you need to open the "call stack" window ("Debug -> Debugging windows -> Call stack") or type "bt" (or "bt full" to get more information) in the input field of the debug log and press enter or the execute button (assuming you use gdb).
There is a "Break debugger"-button in the toolbar (and a similar menu-entry).
The warning about the controlling terminal can be ignored (it's a gdb issue).
Jenna:
By the way searching the web for "Cannot find new threads: generic error" might be helpful.
Navigation
[0] Message Index
[#] Next page
Go to full version