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

Project organizer crashes when closing project #549

Closed
ghost opened this issue Mar 27, 2017 · 8 comments
Closed

Project organizer crashes when closing project #549

ghost opened this issue Mar 27, 2017 · 8 comments

Comments

@ghost
Copy link

ghost commented Mar 27, 2017

After updating to geany 1.30.1 + geany-plugins 1.30, geany allways crashes (segmentation fault) when closing project with project organizer plugin enabled.
Tested on windows 10 & ubuntu 16.04 x64

@ghost
Copy link
Author

ghost commented Mar 28, 2017

Submitted pull request #550 for this.

@kugel-
Copy link
Member

kugel- commented Mar 30, 2017

@techee FYI

Thread 1 "geany" received signal SIGSEGV, Segmentation fault.
0x00007fffe0016aa2 in expand_path (utf8_expanded_path=0x13cf090 "", select=select@entry=0) at prjorg-sidebar.c:1168
1168		foreach_slist (elem, prj_org->roots)
(gdb) bt
#0  0x00007fffe0016aa2 in expand_path (utf8_expanded_path=0x13cf090 "", select=select@entry=0) at prjorg-sidebar.c:1168
#1  0x00007fffe0016c5f in expand_on_idle (ptr=0x8659a0) at prjorg-sidebar.c:1224
#2  0x00007ffff529945a in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#3  0x00007ffff5299810 in  () at /usr/lib/libglib-2.0.so.0
#4  0x00007ffff5299b32 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
#5  0x00007ffff724ed05 in gtk_main () at /usr/lib/libgtk-3.so.0
#6  0x00007ffff79a7a40 in main_lib (argc=<optimized out>, argv=<optimized out>) at ../../src/libmain.c:1236
#7  0x00007ffff4cad511 in __libc_start_main () at /usr/lib/libc.so.6
#8  0x000000000040061a in _start ()

Reverting 8111515 helps

techee added a commit to techee/geany-plugins that referenced this issue Mar 30, 2017
…he tree

Since expand_on_idle() is called as an idle function, it can happen it's
executed after project is closed in which case it should just return
without accessing variables with invalid values.

Should fix crash reported in geany#549.
@techee
Copy link
Member

techee commented Mar 30, 2017

I can't reproduce it myself but I think the reason is that the idle function gets called after project is closed. Can someone confirm that #555 helps?

@codebrainz
Copy link
Member

I think I experienced this bug very infrequently. P/O is one of the plugins I always have activated and once in a blue moon I got a crasher. Hopefully this is the problem because it didn't happen enough for me to troubleshoot it :)

@ghost
Copy link
Author

ghost commented Apr 3, 2017

Hi!
I've installed geany 1.30.1-1~xenial1 & geany-plugins 1.30+dfsg-1~xenial1 from this ppa: https://launchpad.net/~geany-dev/+archive/ubuntu/ppa in a virtual Ubuntu 16.04 x64 machine and enabling project organizer plugin the crash occurs every time I close an open project.
I've cloned this repo and compiled only projectorganizer plugin aplying @techee #555 and I can confirm that the crash is gone. It works!

Thanks

techee added a commit to techee/geany-plugins that referenced this issue Apr 3, 2017
…he tree

Since expand_on_idle() is called as an idle function, it can happen it's
executed after project is closed. Before trying to expand paths it now
first checks if the idle call corresponds to the project for which
the idle call was created.

Should fix crash reported in geany#549.
@techee
Copy link
Member

techee commented Apr 3, 2017

I think the crash depends on when idle functions are exactly called and could be specific to the used gtk/glib versions - I for instance have never seen it.

I've uploaded an updated patch in #555 - @interoceto could you test it?

@ghost
Copy link
Author

ghost commented Apr 4, 2017

Hi all!
@techee Tested #555 in virtual Ubuntu machine (named above) and a new crash occur. ** SEE BELOW **
Tested:
Create new project.
Switch from open project to the new one and vice versa.
Close project.
Close geany with an opened project. Open geany and the project is correctly opened.

** EDITED **
The above tested operations works ok, but geany crashes when opening a file with no project opened.

Please, read: my new comment at #555

Thank you!

techee added a commit to techee/geany-plugins that referenced this issue Apr 10, 2017
…he tree

Since expand_on_idle() is called as an idle function, it can happen it's
executed after project is closed. Before trying to expand paths it now
first checks if the idle call corresponds to the project for which
the idle call was created.

Should fix crash reported in geany#549.
@ghost
Copy link
Author

ghost commented Apr 10, 2017

@techee I can confirm that #559 Solves this issue.

Thanks

This issue was closed.
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

3 participants