Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugger fails with "Error loading file" #309

Open
johnbester opened this issue Nov 16, 2015 · 11 comments
Open

Debugger fails with "Error loading file" #309

johnbester opened this issue Nov 16, 2015 · 11 comments

Comments

@johnbester
Copy link

Linux: Ubuntu trusty (3.13.0-68-generic / i686)
Geany 1.25 (built on Jul 13 2015 with GTK 2.24.23, GLib 2.40.2)

Installing from Ubuntu repositories (geany v1.23) caused the same problem, so I tried installing from ppa:geany-dev/ppa. Problem remains. All packages starting with "geany" installed, except for geany-plugin-markdown, geany-plugin-scope.

I have tried debugging a python script, (setting debug target to .py file and .pyc) - both gave me "Error laoding file" when I press the Start button

I then tried debugging a bash script (.sh) - same problem.

Then I downloaded a sample .c source file, compiled it and tried to debug it - same problem.

Starting geany from shell in order to try to get some output or stack trace did not help much. All I got was the following: (output on console immediately after pressing "OK" on "Error loading file" dialog)

(geany:30320): GLib-CRITICAL **: g_string_free: assertion 'string != NULL' failed

(geany:30320): GLib-CRITICAL **: g_string_free: assertion 'string != NULL' failed

(geany:30320): GLib-CRITICAL **: g_string_free: assertion 'string != NULL' failed

(geany:30320): GLib-CRITICAL **: g_string_free: assertion 'string != NULL' failed

(geany:30320): GLib-CRITICAL **: g_string_free: assertion 'string != NULL' failed

(geany:30320): GLib-CRITICAL **: g_string_free: assertion 'string != NULL' failed

(geany:30320): GLib-CRITICAL **: g_string_free: assertion 'string != NULL' failed

(geany:30320): GLib-CRITICAL **: g_string_free: assertion 'string != NULL' failed

(geany:30320): GLib-CRITICAL **: g_string_free: assertion 'string != NULL' failed

(geany:30320): GLib-CRITICAL **: g_string_free: assertion 'string != NULL' failed

(geany:30320): GLib-CRITICAL **: g_hash_table_destroy: assertion 'hash_table != NULL' failed

Is there any way I can get a decent stack trace of what caused the "Error loading file"?

@b4n
Copy link
Member

b4n commented Feb 8, 2016

I have tried debugging a python script, (setting debug target to .py file and .pyc) - both gave me "Error laoding file" when I press the Start button

I then tried debugging a bash script (.sh) - same problem.

The debugger plugin currently only supports GDB as a backend, and GDB doesn't support those languages. AFAIK, it only supports compiled languages, including Ada, C, C++, Objective-C, Pascal and a few others.

Then I downloaded a sample .c source file, compiled it and tried to debug it - same problem.

Odd. It would be interesting to know exactly what program you tried and how you built it and tried it.

Is there any way I can get a decent stack trace of what caused the "Error loading file"?

You could run Geany under a debugger (like GDB) and stop it when the dialog appears, and then get the backtrace. Not quite sure how it would help though, it's probably "just" GDB that is refusing your file for some reason (probably unrecognized format).

@Top-Dog
Copy link

Top-Dog commented Feb 25, 2018

I'm getting a very similar error too when trying to debug a C application (just a simple hello world program) with Geany 1.23.1 I've selected the correct program for the Target location

(geany:5691): GLib-CRITICAL **: g_string_free: assertion 'string != NULL' failed
(geany:5691): GLib-CRITICAL **: g_string_free: assertion 'string != NULL' failed
(geany:5691): GLib-CRITICAL **: g_string_free: assertion 'string != NULL' failed
(geany:5691): GLib-CRITICAL **: g_string_free: assertion 'string != NULL' failed
(geany:5691): GLib-CRITICAL **: g_string_free: assertion 'string != NULL' failed
(geany:5691): GLib-CRITICAL **: g_string_free: assertion 'string != NULL' failed
(geany:5691): GLib-CRITICAL **: g_string_free: assertion 'string != NULL' failed
(geany:5691): GLib-CRITICAL **: g_string_free: assertion 'string != NULL' failed
(geany:5691): GLib-CRITICAL **: g_string_free: assertion 'string != NULL' failed
(geany:5691): GLib-CRITICAL **: g_string_free: assertion 'string != NULL' failed
(geany:5691): GLib-CRITICAL **: Source ID 1196 was not found when attempting to remove it
Segmentation fault (core dumped)

@codebrainz
Copy link
Member

Would be useful if someone could provide a backtrace since it will show where the crash happens.

@Top-Dog
Copy link

Top-Dog commented Feb 25, 2018

Hop this helps. I'm running geany via Bash on Win10 using Xming Server, so I could only attach to the running process. Might need to rebuild geany with -g flag?

(gdb) continue
Continuing.

Program received signal SIGSEGV, Segmentation fault.
__strchr_sse2 () at ../sysdeps/x86_64/multiarch/../strchr.S:32
32 ../sysdeps/x86_64/multiarch/../strchr.S: No such file or directory.
(gdb) bt
#0 __strchr_sse2 () at ../sysdeps/x86_64/multiarch/../strchr.S:32
#1 0x00007f8dc1bf5740 in ?? () from /usr/lib/x86_64-linux-gnu/geany/debugger.so
#2 0x00007f8dc8ca8ce5 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3 0x00007f8dc8ca9048 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4 0x00007f8dc8ca930a in g_main_loop_run () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5 0x00007f8dca4eb447 in gtk_main () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#6 0x000000000044a626 in main ()
(gdb)

@elextr
Copy link
Member

elextr commented Feb 25, 2018

@Top-Dog did you actually mean version 1.23 ?

@codebrainz
Copy link
Member

Can you re-rerun Geany passing --g-fatal-warnings argument and post this backtrace?

@Top-Dog
Copy link

Top-Dog commented Feb 25, 2018

@elextr yes; geany 1.23.1 (built on May 19 2013 with GTK 2.24.18, GLib 2.37.0)
I tried to build the latest 1.32 but got some errors

libtool: warning: '/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libcairo.la' seems to be moved
libtool: warning: '/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libfreetype.la' seems to be moved
/bin/sed: can't read Development/geany-1.32.tar/geany-1.32/geany-1.32/src/libgeany.la: No such file or directory
libtool: error: 'Development/geany-1.32.tar/geany-1.32/geany-1.32/src/libgeany.la' is not a valid libtool archive

@codebrainz This is the updated backtrace:

Program received signal SIGTRAP, Trace/breakpoint trap.
0x00007fc28ccafc13 in g_logv () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
(gdb) bt
#0 0x00007fc28ccafc13 in g_logv () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#1 0x00007fc28ccafd72 in g_log () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2 0x00007fc28ccc806a in g_string_free () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3 0x00007fc285bf2d71 in ?? () from /usr/lib/x86_64-linux-gnu/geany/debugger.so
#4 0x00007fc28cca5648 in g_list_foreach () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5 0x00007fc285bf2eea in ?? () from /usr/lib/x86_64-linux-gnu/geany/debugger.so
#6 0x00007fc285bf4477 in ?? () from /usr/lib/x86_64-linux-gnu/geany/debugger.so
#7 0x00007fc28cca8ce5 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#8 0x00007fc28cca9048 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#9 0x00007fc28cca930a in g_main_loop_run () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#10 0x00007fc28e4eb447 in gtk_main () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#11 0x000000000044a626 in main ()

@codebrainz
Copy link
Member

Unfortunately you don't seem to have debugging symbols for the plugin so it doesn't tell where the problem is.

@johnbester
Copy link
Author

johnbester commented Feb 26, 2018

Thanks for looking into the problem. I can't however remember exactly I tried to debug a python script when I logged this bug. Since python is not a language I work in frequently, I probably tried to debug some script I downloaded. I am currently using Geany 1.27 on Ubuntu 16.04 and I have not used Geany debugger for quite some time. At the time of this bug I was still using Ubuntu 14.04.

@b4n
Copy link
Member

b4n commented Feb 26, 2018

@Top-Dog Please try version 1.27 or newer, because it fixed a lot of issues, and I'm pretty sure I remember the warnings you're seeing are part of it.
Instead of building yourself if you have issues with this, try using the latest pre-builds from Geany's website, they should be very up-to-date.

@lpaulsen93
Copy link
Contributor

@johnbester: do you see a chance to re-produce the problem? It's quite old and we are now on geany-plugins 1.35. Or do you think we should close it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants