universal-ctags / citre

A superior code reading & auto-completion tool with pluggable backends.
GNU General Public License v3.0
326 stars 26 forks source link

emacs x windows crashed when calling citre-peek #95

Closed wanghaiqiangk closed 2 years ago

wanghaiqiangk commented 3 years ago

It seems citre-peek works fine in terminal, while it will cause the Emacs X window crashes.

I'm not sure which information to report about X Emacs, so that I would just copy a minimal output into here right now.

Emacs version: 27.1 OS: Ubuntu 16.04 Emacs output on error:

X protocol error: BadDrawable (invalid Pixmap or Window parameter) on protocol request 55
When compiled with GTK, Emacs cannot recover from X disconnects.
This is a GTK bug: https://gitlab.gnome.org/GNOME/gtk/issues/221
For details, see etc/PROBLEMS.

(emacs:8803): GLib-WARNING **: g_main_context_prepare() called recursively from within a source's check() or prepare() member.

(emacs:8803): GLib-WARNING **: g_main_context_check() called recursively from within a source's check() or prepare() member.
Backtrace:
emacs[0x50d859]
emacs[0x418d21]
emacs[0x418ef5]
emacs[0x418b25]
emacs[0x4c8efe]
emacs[0x4c8f8b]
/usr/lib/x86_64-linux-gnu/libX11.so.6(_XError+0x11d)[0x7f979301aced]
/usr/lib/x86_64-linux-gnu/libX11.so.6(+0x3cb77)[0x7f9793017b77]
/usr/lib/x86_64-linux-gnu/libX11.so.6(+0x3cc35)[0x7f9793017c35]
/usr/lib/x86_64-linux-gnu/libX11.so.6(_XEventsQueued+0x55)[0x7f97930185f5]
/usr/lib/x86_64-linux-gnu/libX11.so.6(XFlush+0x1a)[0x7f9792ff9e1a]
/usr/lib/x86_64-linux-gnu/libX11.so.6(+0x5c7de)[0x7f97930377de]
/usr/lib/x86_64-linux-gnu/libX11.so.6(XDestroyIC+0x12)[0x7f9793025752]
emacs[0x4daf2f]
emacs[0x4d2ea4]
emacs[0x4d347b]
emacs[0x42bc75]
emacs[0x418aed]
emacs[0x4c8efe]
emacs[0x4c8f8b]
/usr/lib/x86_64-linux-gnu/libX11.so.6(_XError+0x11d)[0x7f979301aced]
/usr/lib/x86_64-linux-gnu/libX11.so.6(+0x3cb77)[0x7f9793017b77]
/usr/lib/x86_64-linux-gnu/libX11.so.6(+0x3cc35)[0x7f9793017c35]
/usr/lib/x86_64-linux-gnu/libX11.so.6(_XEventsQueued+0x55)[0x7f97930185f5]
/usr/lib/x86_64-linux-gnu/libX11.so.6(XPending+0x57)[0x7f9793009fd7]
/usr/lib/x86_64-linux-gnu/libgdk-3.so.0(+0x5f7ee)[0x7f97948047ee]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_prepare+0x15d)[0x7f97937809ed]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x4a38b)[0x7f979378138b]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_pending+0x27)[0x7f9793781517]
/usr/lib/x86_64-linux-gnu/libgtk-3.so.0(gtk_events_pending+0xd)[0x7f9794cabced]
emacs[0x4c5e3b]
emacs[0x4fb539]
emacs[0x4fba35]
emacs[0x575533]
emacs[0x575665]
emacs[0x5757de]
emacs[0x5764f5]
emacs[0x4fa56f]
emacs[0x4faa49]
emacs[0x4fb698]
emacs[0x4fe688]
...

[1]  + 8803 abort      emacs
AmaiKinono commented 3 years ago

I'll see if I can downgrade my Emacs to 27.1 and test this later. For now, can you try with citre-peek-fill-fringe set to nil?

wanghaiqiangk commented 3 years ago

I'll see if I can downgrade my Emacs to 27.1 and test this later. For now, can you try with citre-peek-fill-fringe set to nil?

Right. Now it works.

masatake commented 3 years ago

With Emacs-27.2 on Fedora34, it works fine.

AmaiKinono commented 2 years ago

I'm on Emacs 27.1. I've found a way to reproduce the problem on emacs -Q:

(setq ov (make-overlay 0 0))
;; If we define a non-empty bitmap like [0], Emacs won't crash.
(define-fringe-bitmap 'empty-fringe [])
(overlay-put ov 'after-string
             (propertize " "
                         'display
                         '(left-fringe empty-fringe)))

I don't know anything about GTK, but if you want to report the bug to Emacs developers, this may help them (however I'm pretty sure this is already fixed in Emacs 28 and 29, and maybe in 27.2).

AmaiKinono commented 2 years ago

I've introduced a workaround. Hopefully this is fixed.