#112 Debugger: Whole application crashes

debugger (11)


since I upgraded to Kubuntu 14.04 Geany is crashing whenever I try to use debugger. I am using it with c files (binaries). It worked just fine on Kubuntu 13.10

Steps I use to reproduce this:
1. Open Geany
2. Open a c file/project, something...
3. Compile
4. In debugger set the file to be debugged
5. Click on run

Then the whole Geany application crashes.
I attached a log from valgrind to this ticket. I hope that can be helpful.

1 Attachments


Bugs: #127


  • Alexander Petukhov

    Hi! I've took a quick look, the reason the plugin crash is gdb 7.7 syntax (or behaviour) changes. In particular gdb MI -exec-run command do not accept "&" anymore, that was used to start target executable in async mode to enable for example inserting new break while a target is running. I tried to change debugger/src/dbm_gdb.c:372 from
    exec_async_command("-exec-run &");
    and it didn't crash, however not sure if async mode functionality is still enabled if doing so.
    If you can patch and build - that's a hint, I'll take a closer look asap.

    • Stefan Arnold

      Stefan Arnold - 2014-08-27

      Having this change, geany crashes on starting debugging.
      Console gives:
      sys.excepthook is missing
      lost sys.stderr

    • Colomban Wendling

      Changing the two occurrence of "-exec-run &" to remove the & did fix the crash form me. I indeed am using GDB 7.7.1 (Debian unstable here).

      The potentially crashing code is still here, but it's not triggered anymore and the debugging session seems to work OK.

      I think fixing Debugger to work with GDB 7.7 is important as it seems to have spread (Debian testing, Fedora 20, Ubuntu 14.04, …).

      It would also be good to make the code more resistant to communications problems like this not to crash when such unexpected data is received.

  • Asdas

    Asdas - 2014-05-08

    Thanks for the quick answer, I was really surprised that you noticed it and replied so fast. After a while I managed to adjust the code as you suggested and compile it but it did not help unfortunately.

  • Yanpas

    Yanpas - 2014-08-01

    Affects me too

  • Stefan Arnold

    Stefan Arnold - 2014-08-27

    I think i have the same problem.
    The erroneous code for me ist at dbm_gdb.c:584. strstr return NULL which is not evaluated. A memory dump gives me "^error,msg="Invalid argument: &" followed by 4xzero.
    Just having a quick view over the file i saw more of this constellations.
    Really poor coding...

  • Ron Brash

    Ron Brash - 2015-02-12

    I noticed that if you have any strings in your code or in data used by your code it still crashes hard - even if you change the code noted by Colomban...

  • Ron Brash

    Ron Brash - 2015-02-12

    In stree.c above line 510 I added a NULL check and edited gtk_tree_model_get() to have a -1 argument:

    if(model == NULL) {
    printf("model is null\n");
    gtk_tree_model_get(model, &thread_iter, S_THREAD_ID, &existing_thread_id, -1);

    And in dbm_gdb.c @ 584 I did a NULL check - the free may not be necessary, but otherwise cleanup is skipped:

    gchar *thread_id = strstr(line + strlen(line) + 1,"thread-id=\"");
    if (thread_id == NULL){
    return FALSE;

  • Colomban Wendling

    • status: open --> closed-fixed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks