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

Geany segfaults after clicking new document 3 or 4 times #2736

Closed
gsi-nestor opened this issue Jan 27, 2021 · 21 comments
Closed

Geany segfaults after clicking new document 3 or 4 times #2736

gsi-nestor opened this issue Jan 27, 2021 · 21 comments
Labels
can't reproduce A developer couldn't reproduce the issue

Comments

@gsi-nestor
Copy link

gsi-nestor commented Jan 27, 2021

Hi, this is happening in Ubuntu 20.04, compiled version of geany 1.37.1. I'm a long time user of Geany, and I've always compiled from source. Compilation was fine, as usual.

╭─nalonso@satellite ~
╰─$ geany
[1] 1884036 segmentation fault (core dumped) geany
╭─nalonso@satellite ~
╰─$

If I open documents everything works fine.

[Edit: As you have discovered and cross posted, there is a separate issue about this]
Maybe unrelated, but Geany is taking a whole lot more time to load with a lot of documents. I use to have 30 or more files opened, mostly YAML and Dockerfiles, but up to 1.36 Geany was lightning fast even with all those documents open.

@gsi-nestor
Copy link
Author

gsi-nestor commented Jan 27, 2021

More on that: If I open at least one document, "New document" works as expected. The issue appears only when I don't have any documents open and I click several times on "New document." So, to reproduce it, I just close all the documents, and hit "New document" several times: Segmentation Fault.

@elextr
Copy link
Member

elextr commented Jan 27, 2021

Please verify that you have no plugins enabled.

@elextr
Copy link
Member

elextr commented Jan 27, 2021

Note WFM on Linux Mint 20 which is derived from Ubuntu 20.04.

@gsi-nestor
Copy link
Author

gsi-nestor commented Jan 27, 2021 via email

@elextr
Copy link
Member

elextr commented Jan 27, 2021

try starting geany as geany -c /tmp/something_that_does_not_exist and see if the problem persists.

@elextr elextr added the can't reproduce A developer couldn't reproduce the issue label Jan 27, 2021
@gsi-nestor
Copy link
Author

gsi-nestor commented Jan 27, 2021 via email

@gsi-nestor
Copy link
Author

Now it is not segfaulting anymore even with the regular config. Maybe we should close this here and move forward with this last behavior.

Thank you very much for your time

@elextr
Copy link
Member

elextr commented Jan 27, 2021

Geany opens fine, and is not segfaulting,

Good, that means there is something in the setup or settings that is weird, but it nonetheless should not cause a segfault.

Now it is not segfaulting anymore even with the regular config.

Thats weird, and bad because that means we can't track down what weirdness is causing the segfaulting and protect against it.

If it happens again can you try running Geany under gdb and get a backtrace showing where it segfaults and re-open this and post here?

The behaviour you describe with only one new document open is the intended behaviour. There is an option to always open a new document when the last is closed because someone didn't like having an empty space where the editor tabs go, but since it was just a space filler they deleted it when the user opened or created a document, but they did that always. So when you create a new document and there is only one existing document and it has no backing file and is unmodified it is deleted and you see that message in the status.

A side effect of this is that unless you have more than one document open or one file backed or modified document open you can't open multiple empty documents. Although there have been various discussions about this over the years nobody has found the use-case of opening only multiple empty documents sufficiently important to make the code to change it. For example add a flag to the "fake" document and only delete the single document it if its flagged as well as being unmodified and not file backed, so not deleting user created empty documents.

@elextr elextr closed this as completed Jan 27, 2021
@l33tlinuxh4x0r
Copy link

I too have this same issue... If I open Geany and press Ctrl+N start typing a file and save it then click in the text area of the file with my mouse it segfaults... I can confirm that spamming the mouse in the text area after pressing Ctrl+N also segfaults. I am running gentoo compiled from source... I'm about to get a gdb and will post the results as a follow up.

l33tlinuxh4x0r@Ryzen ~ $ geany -v
(geany:86563): GLib-GIO-DEBUG: 16:38:29.129: Using cross-namespace EXTERNAL authentication (this will deadlock if server is GDBus < 2.73.3)
(geany:86563): GLib-GIO-DEBUG: 16:38:29.131: _g_io_module_get_default: Found default implementation gvfs (GDaemonVfs) for ‘gio-vfs’
Geany-INFO: 16:38:29.148: Geany 2.0, unknown
Geany-INFO: 16:38:29.148: GTK 3.24.41, GLib 2.78.4
Geany-INFO: 16:38:29.148: OS: Gentoo Linux
Geany-INFO: 16:38:29.148: System data dir: /usr/share/geany
Geany-INFO: 16:38:29.148: User config dir: /home/l33tlinuxh4x0r/.config/geany
Geany-INFO: 16:38:29.207: Loaded GTK+ CSS theme '/usr/share/geany/geany.css'
Geany-INFO: 16:38:29.209: System plugin path: /usr/lib64/geany
Geany-INFO: 16:38:29.212: Added filetype Groovy (65).
Geany-INFO: 16:38:29.212: Added filetype Nim (66).
Geany-INFO: 16:38:29.212: Added filetype Meson (67).
Geany-INFO: 16:38:29.212: Added filetype Kotlin (68).
Geany-INFO: 16:38:29.212: Added filetype Scala (69).
Geany-INFO: 16:38:29.212: Added filetype Arduino (70).
Geany-INFO: 16:38:29.212: Added filetype CUDA (71).
Geany-INFO: 16:38:29.212: Added filetype JSON (72).
Geany-INFO: 16:38:29.212: Added filetype TypeScript (73).
Geany-INFO: 16:38:29.212: Added filetype Graphviz (74).
Geany-INFO: 16:38:29.212: Added filetype Clojure (75).
Geany-INFO: 16:38:29.212: Added filetype Genie (76).
Geany-INFO: 16:38:29.212: Added filetype Cython (77).
Geany-INFO: 16:38:29.212: Added filetype Swift (78).
Geany-INFO: 16:38:29.218: Loaded libvte from libvte-2.91.so
Geany-INFO: 16:38:29.219: Loaded:   /usr/lib64/geany/overview.so (Overview)
Geany-INFO: 16:38:29.226: /home/l33tlinuxh4x0r/work.py : Python (UTF-8)
Geany-INFO: 16:38:29.234: Loaded /usr/share/geany/tags/std.py.tags (Python), 15267 symbol(s).
Geany-INFO: 16:38:29.252: /home/l33tlinuxh4x0r/work2.py : Python (UTF-8)
Geany-INFO: 16:38:29.255: /home/l33tlinuxh4x0r/work3.py : Python (UTF-8)
Geany-INFO: 16:38:29.257: /home/l33tlinuxh4x0r/work4.py : Python (UTF-8)
Geany-INFO: 16:38:29.259: /home/l33tlinuxh4x0r/work5.py : Python (UTF-8)
Geany-INFO: 16:38:29.261: /home/l33tlinuxh4x0r/work6.py : Python (UTF-8)
Geany-INFO: 16:38:29.264: /home/l33tlinuxh4x0r/work7.py : Python (UTF-8)
Geany-INFO: 16:38:29.267: /home/l33tlinuxh4x0r/work8.py : Python (UTF-8)
(geany:86563): GLib-DEBUG: 16:38:29.372: g_unix_open_pipe() called with FD_CLOEXEC; please migrate to using O_CLOEXEC instead
Geany-INFO: 16:38:33.653: unknown : None (UTF-8)
(geany:86563): GLib-GIO-DEBUG: 16:38:38.122: Using cross-namespace EXTERNAL authentication (this will deadlock if server is GDBus < 2.73.3)
(geany:86563): GLib-GIO-DEBUG: 16:38:38.146: _g_io_module_get_default: Found default implementation dconf (DConfSettingsBackend) for ‘gsettings-backend’
(geany:86563): dconf-DEBUG: 16:38:38.146: watch_fast: "/org/gtk/settings/file-chooser/" (establishing: 0, active: 0)
(geany:86563): dconf-DEBUG: 16:38:38.146: watch_established: "/org/gtk/settings/file-chooser/" (establishing: 1)
Geany-INFO: 16:38:41.194: /home/l33tlinuxh4x0r/broken.py : Python (UTF-8)
Geany-INFO: 16:38:41.195: /home/l33tlinuxh4x0r/broken.py : Python (UTF-8)
(geany:86563): dconf-DEBUG: 16:38:41.196: change_fast
Segmentation fault (core dumped)

@l33tlinuxh4x0r
Copy link

l33tlinuxh4x0r commented Apr 24, 2024

gdb says...

0x00007ffff78d014e in free () from /usr/lib64/libc.so.6

Edit: the other gdb log that I posted was erroneous. I consistently get the above error now.

@elextr
Copy link
Member

elextr commented Apr 24, 2024

Need the whole backtrace, and watch it might print some and ask if you want to continue.

@l33tlinuxh4x0r
Copy link

gdb
GNU gdb (Gentoo 14.2 vanilla) 14.2
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) exec-file /usr/bin/geany
(gdb) r
Starting program: /usr/bin/geany 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib64/libthread_db.so.1".
[New Thread 0x7ffff54006c0 (LWP 41390)]
[New Thread 0x7ffff4a006c0 (LWP 41391)]
[New Thread 0x7fffefe006c0 (LWP 41392)]
[New Thread 0x7fffef4006c0 (LWP 41393)]
[New Thread 0x7fffee2006c0 (LWP 41394)]
[New Thread 0x7fffed8006c0 (LWP 41395)]
[New Thread 0x7fffece006c0 (LWP 41396)]
[Detaching after fork from child process 41398]
[Thread 0x7fffed8006c0 (LWP 41395) exited]
[Thread 0x7fffee2006c0 (LWP 41394) exited]

Thread 1 "geany" received signal SIGSEGV, Segmentation fault.
0x00007ffff7e6d14e in free () from /usr/lib64/libc.so.6
(gdb) 

@l33tlinuxh4x0r
Copy link

I have figured out that the bug is only present in X11. When running Wayland the bug no longer happens.

@elextr
Copy link
Member

elextr commented Apr 24, 2024

Without a backtrace have no idea whats wrong.

@l33tlinuxh4x0r
Copy link

Without a backtrace have no idea whats wrong.

Could you please tell me who to obtain a backtrace?

@elextr
Copy link
Member

elextr commented Apr 24, 2024

When it stops at "(gdb)" type "backtrace" and return.

@elextr
Copy link
Member

elextr commented Apr 24, 2024

@l33tlinuxh4x0r
Copy link

When it stops at "(gdb)" type "backtrace" and return.

Thanks...

l33tlinuxh4x0r@Ryzen ~ $ gdb
GNU gdb (Gentoo 14.2 vanilla) 14.2
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) exec-file /usr/bin/geany
(gdb) r
Starting program: /usr/bin/geany 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib64/libthread_db.so.1".
[New Thread 0x7ffff54006c0 (LWP 75924)]
[New Thread 0x7fffefe006c0 (LWP 75925)]
[New Thread 0x7ffff4a006c0 (LWP 75926)]
[New Thread 0x7fffef4006c0 (LWP 75927)]
[New Thread 0x7fffee2006c0 (LWP 75928)]
[New Thread 0x7fffed8006c0 (LWP 75929)]
[New Thread 0x7fffece006c0 (LWP 75931)]
[Detaching after fork from child process 75932]
[Thread 0x7fffed8006c0 (LWP 75929) exited]
[Thread 0x7fffee2006c0 (LWP 75928) exited]

Thread 1 "geany" received signal SIGSEGV, Segmentation fault.
0x00007ffff7e6c14e in free () from /usr/lib64/libc.so.6
(gdb) backtrace
#0  0x00007ffff7e6c14e in free () at /usr/lib64/libc.so.6
#1  0x00007ffff550048a in ??? ()
    at /usr/lib64/gtk-3.0/3.0.0/immodules/im-ibus.so
#2  0x00007ffff5501249 in ??? ()
    at /usr/lib64/gtk-3.0/3.0.0/immodules/im-ibus.so
#3  0x00007ffff7290d56 in ??? () at /usr/lib64/libgtk-3.so.0
#4  0x00007ffff6b86660 in g_closure_invoke () at /usr/lib64/libgobject-2.0.so.0
#5  0x00007ffff6b99bef in ??? () at /usr/lib64/libgobject-2.0.so.0
#6  0x00007ffff6b9afd9 in ??? () at /usr/lib64/libgobject-2.0.so.0
#7  0x00007ffff6ba1272 in g_signal_emit_valist ()
    at /usr/lib64/libgobject-2.0.so.0
#8  0x00007ffff6ba1327 in g_signal_emit () at /usr/lib64/libgobject-2.0.so.0
#9  0x00007ffff754bd1c in ??? () at /usr/lib64/libgtk-3.so.0
#10 0x00007ffff73fc93e in ??? () at /usr/lib64/libgtk-3.so.0
#11 0x00007ffff73fe536 in gtk_main_do_event () at /usr/lib64/libgtk-3.so.0
#12 0x00007ffff713f675 in ??? () at /usr/lib64/libgdk-3.so.0
#13 0x00007ffff718d802 in ??? () at /usr/lib64/libgdk-3.so.0
#14 0x00007ffff6a79168 in ??? () at /usr/lib64/libglib-2.0.so.0
#15 0x00007ffff6a7b297 in ??? () at /usr/lib64/libglib-2.0.so.0
#16 0x00007ffff6a7bb7f in g_main_loop_run () at /usr/lib64/libglib-2.0.so.0
#17 0x00007ffff73fd71d in gtk_main () at /usr/lib64/libgtk-3.so.0
#18 0x00007ffff7a6f8fe in main_lib () at /usr/lib64/libgeany.so.0
#19 0x00007ffff7df52e0 in ??? () at /usr/lib64/libc.so.6
--Type <RET> for more, q to quit, c to continue without paging--
#20 0x00007ffff7df5399 in __libc_start_main () at /usr/lib64/libc.so.6
#21 0x0000555555555095 in ??? ()
#22 0x00007fffffffdb18 in ??? ()
#23 0x000000000000003c in ??? ()
#24 0x0000000000000001 in ??? ()
#25 0x00007fffffffdeab in ??? ()
#26 0x0000000000000000 in ??? ()
(gdb) 
(gdb) 

@elextr
Copy link
Member

elextr commented Apr 24, 2024

Not very helpful but it shows the problem is entirely within the GTK/GIO/GObject/Glib libraries, the only Geany code present is the initial call to GTK.

So its something in the version of those libraries that doesn't like your X11. Is it actual Xorg X11 or XWayland?

@l33tlinuxh4x0r
Copy link

It is X11. I switched to Wayland and the issue went away.

@nyamatongwe
Copy link
Contributor

im-ibus.so is input method (IME) code commonly used for East Asian character entry although it can used be for similar features like diacritic or emoji entry. Fiddling with language or input method settings may improve things.

https://en.wikipedia.org/wiki/Intelligent_Input_Bus

For a long time one of the reasons to avoid Wayland was to avoid IME problems. This issue may be a sign that the tide has turned in favour of Wayland.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
can't reproduce A developer couldn't reproduce the issue
Projects
None yet
Development

No branches or pull requests

4 participants