emacs-lsp / lsp-ui

UI integrations for lsp-mode
https://emacs-lsp.github.io/lsp-ui
GNU General Public License v3.0
1.04k stars 140 forks source link

lsp-ui-doc-focus-frame crashes emacs 28.1 #697

Closed jgrillo-grapl closed 2 years ago

jgrillo-grapl commented 2 years ago

I've encountered an issue where any interaction with the lsp-ui-doc popup frame crashes emacs. If I run e.g. M-x lsp-ui-doc-focus-frame with a lsp-ui-doc frame visible emacs crashes with the following output:

Fatal error 6: Aborted

(emacs:29843): Gdk-WARNING **: 14:38:16.674: GdkWindow 0x4003e9 unexpectedly destroyed

(emacs:29843): Gtk-CRITICAL **: 14:38:16.676: gtk_cairo_should_draw_window: assertion 'GDK_IS_WINDOW (window)' failed
Backtrace:
emacs(+0x147027)[0x555efa6bf027]
emacs(+0x46c07)[0x555efa5bec07]
emacs(+0x4708f)[0x555efa5bf08f]
emacs(+0x44a3b)[0x555efa5bca3b]
emacs(+0x8fa75)[0x555efa607a75]
emacs(+0x1f1810)[0x555efa769810]
emacs(+0x1f9025)[0x555efa771025]
emacs(+0x12d56a)[0x555efa6a556a]
emacs(+0x46299)[0x555efa5be299]
emacs(+0x46364)[0x555efa5be364]
/usr/lib/x86_64-linux-gnu/libX11.so.6(_XIOError+0x4e)[0x7ba5a581320e]
/usr/lib/x86_64-linux-gnu/libX11.so.6(+0x4439c)[0x7ba5a581139c]
/usr/lib/x86_64-linux-gnu/libX11.so.6(XSync+0x4d)[0x7ba5a580c9ed]
emacs(+0x10717a)[0x555efa67f17a]
emacs(+0x107e70)[0x555efa67fe70]
emacs(+0x108119)[0x555efa680119]
emacs(+0x10942d)[0x555efa68142d]
emacs(+0x10bba3)[0x555efa683ba3]
/usr/lib/x86_64-linux-gnu/libgdk-3.so.0(+0x6a06f)[0x7ba5a62b006f]
/usr/lib/x86_64-linux-gnu/libgdk-3.so.0(+0x6a339)[0x7ba5a62b0339]
/usr/lib/x86_64-linux-gnu/libgdk-3.so.0(gdk_display_get_event+0x40)[0x7ba5a627a940]
/usr/lib/x86_64-linux-gnu/libgdk-3.so.0(+0x6a102)[0x7ba5a62b0102]
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_dispatch+0x2ae)[0x7ba5a5d88fee]
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x4e288)[0x7ba5a5d89288]
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_iteration+0x2c)[0x7ba5a5d8931c]
/usr/lib/x86_64-linux-gnu/libgtk-3.so.0(gtk_main_iteration+0x15)[0x7ba5a657cbc5]
emacs(+0xfeb62)[0x555efa676b62]
emacs(+0x134ec9)[0x555efa6acec9]
emacs(+0x1353c5)[0x555efa6ad3c5]
emacs(+0x21ea5b)[0x555efa796a5b]
emacs(+0x950c0)[0x555efa60d0c0]
emacs(+0x85a8f)[0x555efa5fda8f]
emacs(+0x8a43b)[0x555efa60243b]
emacs(+0xa0976)[0x555efa618976]
emacs(+0xa38cb)[0x555efa61b8cb]
emacs(+0x1a767a)[0x555efa71f67a]
emacs(+0x67704)[0x555efa5df704]
emacs(+0x8d995)[0x555efa605995]
emacs(+0x1387f7)[0x555efa6b07f7]
emacs(+0x13b1ec)[0x555efa6b31ec]
emacs(+0x13ca6c)[0x555efa6b4a6c]
...
Aborted (core dumped)

I have also seen it manifest with this different looking stacktrace:

Fatal error 6: Aborted
Backtrace:
emacs(+0x147027)[0x58083a9fa027]
emacs(+0x46c07)[0x58083a8f9c07]
emacs(+0x4708f)[0x58083a8fa08f]
emacs(+0x44a3b)[0x58083a8f7a3b]
emacs(+0x8fa75)[0x58083a942a75]
emacs(+0x1f1810)[0x58083aaa4810]
emacs(+0x1f9025)[0x58083aaac025]
emacs(+0x12d56a)[0x58083a9e056a]
emacs(+0x46299)[0x58083a8f9299]
emacs(+0x46364)[0x58083a8f9364]
/usr/lib/x86_64-linux-gnu/libX11.so.6(_XIOError+0x4e)[0x7d1aba20e20e]
/usr/lib/x86_64-linux-gnu/libX11.so.6(_XEventsQueued+0x7d)[0x7d1aba20bacd]
/usr/lib/x86_64-linux-gnu/libX11.so.6(_XGetRequest+0x55)[0x7d1aba20e845]
/usr/lib/x86_64-linux-gnu/libXrender.so.1(XRenderFillRectangle+0x8b)[0x7d1ab9f914bb]
/usr/lib/x86_64-linux-gnu/libcairo.so.2(+0x9a288)[0x7d1abab29288]
/usr/lib/x86_64-linux-gnu/libcairo.so.2(+0x7ec34)[0x7d1abab0dc34]
/usr/lib/x86_64-linux-gnu/libcairo.so.2(+0x7ee5c)[0x7d1abab0de5c]
/usr/lib/x86_64-linux-gnu/libcairo.so.2(+0x7f84e)[0x7d1abab0e84e]
/usr/lib/x86_64-linux-gnu/libcairo.so.2(+0x26b80)[0x7d1abaab5b80]
/usr/lib/x86_64-linux-gnu/libcairo.so.2(+0xa02b9)[0x7d1abab2f2b9]
/usr/lib/x86_64-linux-gnu/libcairo.so.2(+0x7769f)[0x7d1abab0669f]
/usr/lib/x86_64-linux-gnu/libcairo.so.2(+0x2eed6)[0x7d1abaabded6]
/usr/lib/x86_64-linux-gnu/libcairo.so.2(+0x28359)[0x7d1abaab7359]
/usr/lib/x86_64-linux-gnu/libcairo.so.2(cairo_fill+0x15)[0x7d1abab13035]
emacs(+0x10221f)[0x58083a9b521f]
emacs(+0x10367d)[0x58083a9b667d]
emacs(+0x2248e3)[0x58083aad78e3]
emacs(+0x225583)[0x58083aad8583]
emacs(+0x225871)[0x58083aad8871]
emacs(+0x54d54)[0x58083a907d54]
emacs(+0x550e3)[0x58083a9080e3]
emacs(+0x55ec2)[0x58083a908ec2]
emacs(+0x560cb)[0x58083a9090cb]
emacs(+0x8d87e)[0x58083a94087e]
emacs(+0x1387f7)[0x58083a9eb7f7]
emacs(+0x13b1ec)[0x58083a9ee1ec]
emacs(+0x13ca6c)[0x58083a9efa6c]
emacs(+0x1a75e2)[0x58083aa5a5e2]
emacs(+0x12db22)[0x58083a9e0b22]
emacs(+0x1a7561)[0x58083aa5a561]
emacs(+0x12dabe)[0x58083a9e0abe]
...
Aborted (core dumped)

Similarly, when I try to scroll the popup frame with the mouse scroll wheel, I get a crash like this:

Fatal error 6: Aborted

(emacs:12013): Gdk-WARNING **: 13:14:19.324: GdkWindow 0x4008e8 unexpectedly destroyed

(emacs:12013): Gdk-WARNING **: 13:14:19.324: GdkWindow 0x4008e4 unexpectedly destroyed

(emacs:12013): GLib-GObject-WARNING **: 13:14:19.325: invalid (NULL) pointer instance

(emacs:12013): GLib-GObject-CRITICAL **: 13:14:19.325: g_signal_handler_disconnect: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(emacs:12013): Gdk-CRITICAL **: 13:14:19.325: gdk_frame_clock_end_updating: assertion 'GDK_IS_FRAME_CLOCK (frame_clock)' failed

(emacs:12013): Gdk-WARNING **: 13:14:19.329: GdkWindow 0x40017f unexpectedly destroyed

(emacs:12013): Gdk-WARNING **: 13:14:19.329: GdkWindow 0x400182 unexpectedly destroyed

(emacs:12013): Gdk-WARNING **: 13:14:19.330: GdkWindow 0x4002f4 unexpectedly destroyed

(emacs:12013): Gdk-WARNING **: 13:14:19.330: GdkWindow 0x400142 unexpectedly destroyed

(emacs:12013): Gdk-WARNING **: 13:14:19.330: GdkWindow 0x40013e unexpectedly destroyed

(emacs:12013): GLib-GObject-WARNING **: 13:14:19.330: invalid (NULL) pointer instance

(emacs:12013): GLib-GObject-CRITICAL **: 13:14:19.330: g_signal_handler_disconnect: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(emacs:12013): Gdk-CRITICAL **: 13:14:19.330: gdk_frame_clock_end_updating: assertion 'GDK_IS_FRAME_CLOCK (frame_clock)' failed
Backtrace:
emacs(+0x145db7)[0x57e6c52c7db7]
emacs(+0x45818)[0x57e6c51c7818]
emacs(+0x45ca0)[0x57e6c51c7ca0]
emacs(+0x4364b)[0x57e6c51c564b]
emacs(+0x8f0f5)[0x57e6c52110f5]
emacs(+0x1f0590)[0x57e6c5372590]
emacs(+0x1f7da5)[0x57e6c5379da5]
emacs(+0x12c31a)[0x57e6c52ae31a]
emacs(+0x44eaa)[0x57e6c51c6eaa]
emacs(+0x44f75)[0x57e6c51c6f75]
/usr/lib/x86_64-linux-gnu/libX11.so.6(_XIOError+0x4e)[0x7da82bbdf20e]
/usr/lib/x86_64-linux-gnu/libX11.so.6(+0x4439c)[0x7da82bbdd39c]
/usr/lib/x86_64-linux-gnu/libX11.so.6(XQueryPointer+0x8e)[0x7da82bbd319e]
/usr/lib/x86_64-linux-gnu/libgdk-3.so.0(+0x5aa41)[0x7da82c469a41]
/usr/lib/x86_64-linux-gnu/libgdk-3.so.0(+0x79105)[0x7da82c488105]
/usr/lib/x86_64-linux-gnu/libgdk-3.so.0(gdk_window_get_device_position_double+0x114)[0x7da82c45bb74]
/usr/lib/x86_64-linux-gnu/libgdk-3.so.0(gdk_window_get_device_position+0x2d)[0x7da82c45bc8d]
/usr/lib/x86_64-linux-gnu/libgtk-3.so.0(+0x33b6d4)[0x7da82c8466d4]
/usr/lib/x86_64-linux-gnu/libgtk-3.so.0(+0x33b80f)[0x7da82c84680f]
/usr/lib/x86_64-linux-gnu/libgdk-3.so.0(+0x2dc08)[0x7da82c43cc08]
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x4e923)[0x7da82bf52923]
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_dispatch+0x158)[0x7da82bf51e98]
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x4e288)[0x7da82bf52288]
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_iteration+0x2c)[0x7da82bf5231c]
/usr/lib/x86_64-linux-gnu/libgtk-3.so.0(gtk_main_iteration+0x15)[0x7da82c745bc5]
emacs(+0xfda92)[0x57e6c527fa92]
emacs(+0x133c59)[0x57e6c52b5c59]
emacs(+0x134155)[0x57e6c52b6155]
emacs(+0x1a6e24)[0x57e6c5328e24]
emacs(+0x8d31f)[0x57e6c520f31f]
emacs(+0x137587)[0x57e6c52b9587]
emacs(+0x139f7c)[0x57e6c52bbf7c]
emacs(+0x13b7fc)[0x57e6c52bd7fc]
emacs(+0x1a6362)[0x57e6c5328362]
emacs(+0x12c8d2)[0x57e6c52ae8d2]
emacs(+0x1a62e1)[0x57e6c53282e1]
emacs(+0x12c86e)[0x57e6c52ae86e]
emacs(+0x13214b)[0x57e6c52b414b]
emacs(+0x132495)[0x57e6c52b4495]
emacs(+0x4c474)[0x57e6c51ce474]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xeb)[0x7da82918a09b]
...
Aborted (core dumped)

This is how I built emacs:

git checkout emacs-28.1
./configure --with-x-toolkit=gtk3 --with-xwidgets --with-native-compilation
make -j8
sudo make install

I'm running in a Debian 10 container in Chrome OS:

jgrillo@penguin:~/src/grapl$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 10 (buster)
Release:        10
Codename:       buster

Please let me know if there's any way I can provide more useful information.

jgrillo-grapl commented 2 years ago

I was able to "fix" this in the sense that emacs no longer crashes by setting the following in my init.el:

  (setq lsp-ui-doc-use-childframe nil)
  (setq lsp-ui-doc-use-webkit nil)

However the pop-up frame can't be scrolled now, lsp-ui-doc-focus-frame appears to have no effect.

jgrillo-grapl commented 2 years ago

Also saw this stacktrace, which is different from the others I posted before:


jgrillo@penguin:~/src/grapl$ emacs
Overriding existing handler for signal 10. Set JSC_SIGNAL_FOR_GC if you want WebKit to use a different signal

** (emacs:7965): ERROR **: 11:26:13.773: Unable to configure xdg-desktop-portal access in the WebKit sandbox: GApplication is required.
Fatal error 5: Trace/breakpoint trap
Backtrace:
emacs(+0x147107)[0x56710b687107]
emacs(+0x46c4e)[0x56710b586c4e]
emacs(+0x470b7)[0x56710b5870b7]
emacs(+0x145a78)[0x56710b685a78]
emacs(+0x145b69)[0x56710b685b69]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12730)[0x7c71d3384730]
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x53d35)[0x7c71d9916d35]
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_log_default_handler+0xad)[0x7c71d9917dcd]
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_logv+0x21f)[0x7c71d991801f]
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_log+0x8f)[0x7c71d991820f]
/usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37(+0xb448fb)[0x7c71d66238fb]
/usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37(+0xb459ea)[0x7c71d66249ea]
/usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37(+0x9bf8ee)[0x7c71d649e8ee]
/usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37(+0xa55680)[0x7c71d6534680]
/usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37(+0xa5cd21)[0x7c71d653bd21]
/usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37(+0xa5d16c)[0x7c71d653c16c]
/usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37(+0xa2556e)[0x7c71d650456e]
/usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37(+0xa25bd0)[0x7c71d6504bd0]
/usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37(webkit_web_view_load_uri+0x1a6)[0x7c71d65c7fa6]
emacs(+0x2151c6)[0x56710b7551c6]
/home/jgrillo/.emacs.d/eln-cache/28.1-cd14eebd/lsp-ui-doc-308f758d-acaa7e3a.eln(F6c73702d75692d646f632d2d7765626b69742d72756e2d78776964676574_lsp_ui_doc__webkit_run_xwidget_0+0x155)[0x7c71b9f23805]
emacs(+0x1a866b)[0x56710b6e866b]
/home/jgrillo/.emacs.d/eln-cache/28.1-cd14eebd/lsp-ui-doc-308f758d-acaa7e3a.eln(F6c73702d75692d646f632d2d6d616b652d6672616d65_lsp_ui_doc__make_frame_0+0x415)[0x7c71b9f28445]
emacs(+0x1a866b)[0x56710b6e866b]
/home/jgrillo/.emacs.d/eln-cache/28.1-cd14eebd/lsp-ui-doc-308f758d-acaa7e3a.eln(F6c73702d75692d646f632d2d646973706c6179_lsp_ui_doc__display_0+0x224)[0x7c71b9f27ef4]
emacs(+0x1a866b)[0x56710b6e866b]
/home/jgrillo/.emacs.d/eln-cache/28.1-cd14eebd/lsp-ui-doc-308f758d-acaa7e3a.eln(F6c73702d75692d646f632d2d63616c6c6261636b_lsp_ui_doc__callback_0+0x274)[0x7c71b9f28c94]
emacs(+0x1a866b)[0x56710b6e866b]
emacs(+0x1e30f0)[0x56710b7230f0]
emacs(+0x1a8519)[0x56710b6e8519]
emacs(+0x1a89d2)[0x56710b6e89d2]
emacs(+0x1a866b)[0x56710b6e866b]
emacs(+0x1e30f0)[0x56710b7230f0]
emacs(+0x1a8519)[0x56710b6e8519]
emacs(+0x1e30f0)[0x56710b7230f0]
emacs(+0x1a8519)[0x56710b6e8519]
emacs(+0x1e30f0)[0x56710b7230f0]
emacs(+0x1a8519)[0x56710b6e8519]
/home/jgrillo/.emacs.d/eln-cache/28.1-cd14eebd/lsp-mode-9c9841c0-fb4b3a70.eln(F6c73702d2d7061727365722d6f6e2d6d657373616765_lsp__parser_on_message_0+0x780)[0x7c71c80fea70]
emacs(+0x1a866b)[0x56710b6e866b]
emacs(+0x1e30f0)[0x56710b7230f0]
...
Trace/breakpoint trap (core dumped)```
brotzeit commented 2 years ago

So it does work without --with-x-toolkit=gtk3 --with-xwidgets ?

jgrillo-grapl commented 2 years ago

So it does work without --with-x-toolkit=gtk3 --with-xwidgets ?

No, it still crashes. I just built with ./configure --with-native-compilation and set the following lsp-ui-doc configurations:

  (setq lsp-ui-doc-enable t)
  (setq lsp-ui-doc-header nil)
  (setq lsp-ui-doc-delay 0.05)
  (setq lsp-ui-doc-show-with-cursor t)
  (setq lsp-ui-doc-show-with-mouse t)
  (setq lsp-ui-doc-position 'top)
  (setq lsp-ui-doc-alignment 'frame)
  (setq lsp-ui-doc-use-childframe t)
  (setq lsp-ui-doc-use-webkit nil)

When I interacted with the doc child frame by attempting to scroll with the mouse scroll wheel I got this trace:

jgrillo@penguin:~/src/grapl$ emacs
Fatal error 6: Aborted

(emacs:3219): Gdk-WARNING **: 11:53:54.583: GdkWindow 0x40072a unexpectedly destroyed

(emacs:3219): Gdk-WARNING **: 11:53:54.583: GdkWindow 0x400726 unexpectedly destroyed

(emacs:3219): Gdk-WARNING **: 11:53:54.585: GdkWindow 0x40017e unexpectedly destroyed

(emacs:3219): Gdk-WARNING **: 11:53:54.585: GdkWindow 0x40017b unexpectedly destroyed

(emacs:3219): Gdk-WARNING **: 11:53:54.585: GdkWindow 0x400142 unexpectedly destroyed

(emacs:3219): Gdk-WARNING **: 11:53:54.585: GdkWindow 0x40013e unexpectedly destroyed

(emacs:3219): GLib-GObject-WARNING **: 11:53:54.585: invalid (NULL) pointer instance

(emacs:3219): GLib-GObject-CRITICAL **: 11:53:54.585: g_signal_handler_disconnect: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(emacs:3219): Gdk-CRITICAL **: 11:53:54.585: gdk_frame_clock_end_updating: assertion 'GDK_IS_FRAME_CLOCK (frame_clock)' failed
Backtrace:
emacs(+0x145f07)[0x5b4b3a36ff07]
emacs(+0x458bf)[0x5b4b3a26f8bf]
emacs(+0x45d47)[0x5b4b3a26fd47]
emacs(+0x436db)[0x5b4b3a26d6db]
emacs(+0x8f225)[0x5b4b3a2b9225]
emacs(+0x1f06e0)[0x5b4b3a41a6e0]
emacs(+0x1f7ef5)[0x5b4b3a421ef5]
emacs(+0x12c46a)[0x5b4b3a35646a]
emacs(+0x44f3a)[0x5b4b3a26ef3a]
emacs(+0x45005)[0x5b4b3a26f005]
/usr/lib/x86_64-linux-gnu/libX11.so.6(_XIOError+0x4e)[0x7989c3e4320e]
/usr/lib/x86_64-linux-gnu/libX11.so.6(+0x4439c)[0x7989c3e4139c]
/usr/lib/x86_64-linux-gnu/libX11.so.6(XSync+0x4d)[0x7989c3e3c9ed]
emacs(+0x1061ea)[0x5b4b3a3301ea]
emacs(+0x106ee0)[0x5b4b3a330ee0]
emacs(+0x107189)[0x5b4b3a331189]
emacs(+0x10849d)[0x5b4b3a33249d]
emacs(+0x10ac13)[0x5b4b3a334c13]
/usr/lib/x86_64-linux-gnu/libgdk-3.so.0(+0x6a06f)[0x7989c46dd06f]
/usr/lib/x86_64-linux-gnu/libgdk-3.so.0(+0x6a339)[0x7989c46dd339]
/usr/lib/x86_64-linux-gnu/libgdk-3.so.0(gdk_display_get_event+0x40)[0x7989c46a7940]
/usr/lib/x86_64-linux-gnu/libgdk-3.so.0(+0x6a102)[0x7989c46dd102]
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_dispatch+0x2ae)[0x7989c41b5fee]
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x4e288)[0x7989c41b6288]
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_iteration+0x2c)[0x7989c41b631c]
/usr/lib/x86_64-linux-gnu/libgtk-3.so.0(gtk_main_iteration+0x15)[0x7989c49a9bc5]
emacs(+0xfdbc2)[0x5b4b3a327bc2]
emacs(+0x133da9)[0x5b4b3a35dda9]
emacs(+0x1342a5)[0x5b4b3a35e2a5]
emacs(+0x1a6f74)[0x5b4b3a3d0f74]
emacs(+0x8d44f)[0x5b4b3a2b744f]
emacs(+0x1376d7)[0x5b4b3a3616d7]
emacs(+0x13a0cc)[0x5b4b3a3640cc]
emacs(+0x13b94c)[0x5b4b3a36594c]
emacs(+0x1a64b2)[0x5b4b3a3d04b2]
emacs(+0x12ca22)[0x5b4b3a356a22]
emacs(+0x1a6431)[0x5b4b3a3d0431]
emacs(+0x12c9be)[0x5b4b3a3569be]
emacs(+0x13229b)[0x5b4b3a35c29b]
emacs(+0x1325e5)[0x5b4b3a35c5e5]
emacs(+0x4c5ee)[0x5b4b3a2765ee]
...
Aborted (core dumped)

When I attempted M-x lsp-ui-doc-focus-frame I got this trace:

jgrillo@penguin:~/src/grapl$ emacs
Fatal error 6: Aborted

(emacs:6097): Gdk-WARNING **: 12:02:47.191: GdkWindow 0x40042e unexpectedly destroyed

(emacs:6097): Gdk-WARNING **: 12:02:47.191: GdkWindow 0x40042a unexpectedly destroyed

(emacs:6097): GLib-GObject-WARNING **: 12:02:47.191: invalid (NULL) pointer instance

(emacs:6097): GLib-GObject-CRITICAL **: 12:02:47.191: g_signal_handler_disconnect: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(emacs:6097): Gdk-CRITICAL **: 12:02:47.191: gdk_frame_clock_end_updating: assertion 'GDK_IS_FRAME_CLOCK (frame_clock)' failed

(emacs:6097): Gdk-WARNING **: 12:02:47.193: GdkWindow 0x40017f unexpectedly destroyed

(emacs:6097): Gdk-WARNING **: 12:02:47.193: GdkWindow 0x400182 unexpectedly destroyed

(emacs:6097): Gdk-WARNING **: 12:02:47.193: GdkWindow 0x400142 unexpectedly destroyed

(emacs:6097): Gdk-WARNING **: 12:02:47.193: GdkWindow 0x40013e unexpectedly destroyed

(emacs:6097): GLib-GObject-WARNING **: 12:02:47.194: invalid (NULL) pointer instance

(emacs:6097): GLib-GObject-CRITICAL **: 12:02:47.194: g_signal_handler_disconnect: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(emacs:6097): Gdk-CRITICAL **: 12:02:47.194: gdk_frame_clock_end_updating: assertion 'GDK_IS_FRAME_CLOCK (frame_clock)' failed
Backtrace:
emacs(+0x145f07)[0x55c17e0e7f07]
emacs(+0x458bf)[0x55c17dfe78bf]
emacs(+0x45d47)[0x55c17dfe7d47]
emacs(+0x436db)[0x55c17dfe56db]
emacs(+0x8f225)[0x55c17e031225]
emacs(+0x1f06e0)[0x55c17e1926e0]
emacs(+0x1f7ef5)[0x55c17e199ef5]
emacs(+0x12c46a)[0x55c17e0ce46a]
emacs(+0x44f3a)[0x55c17dfe6f3a]
emacs(+0x45005)[0x55c17dfe7005]
/usr/lib/x86_64-linux-gnu/libX11.so.6(_XIOError+0x4e)[0x7ed0c661720e]
/usr/lib/x86_64-linux-gnu/libX11.so.6(+0x4439c)[0x7ed0c661539c]
/usr/lib/x86_64-linux-gnu/libX11.so.6(XSync+0x4d)[0x7ed0c66109ed]
emacs(+0x1061ea)[0x55c17e0a81ea]
emacs(+0x106ee0)[0x55c17e0a8ee0]
emacs(+0x107189)[0x55c17e0a9189]
emacs(+0x10849d)[0x55c17e0aa49d]
emacs(+0x10ac13)[0x55c17e0acc13]
/usr/lib/x86_64-linux-gnu/libgdk-3.so.0(+0x6a06f)[0x7ed0c6eb106f]
/usr/lib/x86_64-linux-gnu/libgdk-3.so.0(+0x6a339)[0x7ed0c6eb1339]
/usr/lib/x86_64-linux-gnu/libgdk-3.so.0(gdk_display_get_event+0x40)[0x7ed0c6e7b940]
/usr/lib/x86_64-linux-gnu/libgdk-3.so.0(+0x6a102)[0x7ed0c6eb1102]
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_dispatch+0x2ae)[0x7ed0c6989fee]
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x4e288)[0x7ed0c698a288]
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_iteration+0x2c)[0x7ed0c698a31c]
/usr/lib/x86_64-linux-gnu/libgtk-3.so.0(gtk_main_iteration+0x15)[0x7ed0c717dbc5]
emacs(+0xfdbc2)[0x55c17e09fbc2]
emacs(+0x133da9)[0x55c17e0d5da9]
emacs(+0x1342a5)[0x55c17e0d62a5]
emacs(+0x1a71ef)[0x55c17e1491ef]
/usr/local/libexec/emacs/28.1/x86_64-pc-linux-gnu/../../../../bin/../lib/emacs/28.1/native-lisp/28.1-6772280a/preloaded/minibuffer-1b0f548b-503c46c4.eln(F636f6d706c6574696f6e2d2d736f6d65_completion__some_0+0x1d5)[0x7ed0be9db6c5]
emacs(+0x1a745b)[0x55c17e14945b]
/usr/local/libexec/emacs/28.1/x86_64-pc-linux-gnu/../../../../bin/../lib/emacs/28.1/native-lisp/28.1-6772280a/preloaded/minibuffer-1b0f548b-503c46c4.eln(F636f6d706c6574696f6e2d2d6e74682d636f6d706c6574696f6e_completion__nth_completion_0+0x2f7)[0x7ed0be9dfaf7]
emacs(+0x1a745b)[0x55c17e14945b]
/usr/local/libexec/emacs/28.1/x86_64-pc-linux-gnu/../../../../bin/../lib/emacs/28.1/native-lisp/28.1-6772280a/preloaded/minibuffer-1b0f548b-503c46c4.eln(F636f6d706c6574696f6e2d7472792d636f6d706c6574696f6e_completion_try_completion_0+0x50)[0x7ed0be9dfe40]
emacs(+0x1a745b)[0x55c17e14945b]
/usr/local/libexec/emacs/28.1/x86_64-pc-linux-gnu/../../../../bin/../lib/emacs/28.1/native-lisp/28.1-6772280a/preloaded/simple-fab5b0cf-fcc5e219.eln(F657865637574652d657874656e6465642d636f6d6d616e642d2d73686f72746572_execute_extended_command__shorter_0+0xdd)[0x7ed0bedac45d]
emacs(+0x1a745b)[0x55c17e14945b]
emacs(+0x1e1ee0)[0x55c17e183ee0]
emacs(+0x1a7309)[0x55c17e149309]
emacs(+0x1a7789)[0x55c17e149789]
...
Aborted (core dumped)
brotzeit commented 2 years ago

I'm pretty sure this can't be fixed in lsp-ui. You could comment the code in lsp-ui-doc-focus-frame step by step and see which function call results in this segfault. And then send a bug report to the emacs maintainers.

jgrillo-grapl commented 2 years ago

I agree, I isolated this further by compiling emacs without gtk and it appears to be somehow caused by child frames. I've worked around it by using eldoc instead, which has the added benefit that my emacs config works identically well in both a tty and a gui. Closing as this issue is not exactly an lsp-ui problem.