GNOME Bugzilla – Bug 778188
VTE crashes on multiple repeated BELL chars
Last modified: 2017-07-20 02:11:40 UTC
Hi, I've managed to reproduce an issue where VTE crashes when printing the BELL character in a while loop. The following code crashes both gnome-terminal and terminix: while true; do printf '\7'; done
Got a stack trace?
Not reproducible here. (Although it does make vte use rather much CPU.)
Yes. This is the stack trace I get: Feb 05 17:49:42 derek-lenny systemd-coredump[16131]: Process 15248 (gnome-terminal-) of user 1000 dumped core. Stack trace of thread 15248: #0 0x00007f8eaba2504f raise (libc.so.6) #1 0x00007f8eaba2647a abort (libc.so.6) #2 0x00007f8ea7cb9fef n/a (libwayland-client.so.0) #3 0x00007f8ea7cb6195 wl_proxy_marshal_array_constructor_versioned (libwayland-client.so.0) #4 0x00007f8ea7cb62dc wl_proxy_marshal (libwayland-client.so.0) #5 0x00007f8eadd66609 n/a (libvte-2.91.so.0) #6 0x00007f8eadd558df n/a (libvte-2.91.so.0) #7 0x00007f8eadd56b71 n/a (libvte-2.91.so.0) #8 0x00007f8eadd56c58 n/a (libvte-2.91.so.0) #9 0x00007f8eadd56f89 n/a (libvte-2.91.so.0) #10 0x00007f8eac1fceb3 n/a (libglib-2.0.so.0) #11 0x00007f8eac1fc43a g_main_context_dispatch (libglib-2.0.so.0) #12 0x00007f8eac1fc7f0 n/a (libglib-2.0.so.0) #13 0x00007f8eac1fc89c g_main_context_iteration (libglib-2.0.so.0) #14 0x00007f8eac7b654d g_application_run (libgio-2.0.so.0) #15 0x0000000000412909 n/a (gnome-terminal-server) #16 0x00007f8eaba12291 __libc_start_main (libc.so.6) #17 0x0000000000412a3a n/a (gnome-terminal-server) Stack trace of thread 15258: #0 0x00007f8eabad148d poll (libc.so.6) #1 0x00007f8eac1fc786 n/a (libglib-2.0.so.0) #2 0x00007f8eac1fc89c g_main_context_iteration (libglib-2.0.so.0) #3 0x00007f8eac1fc8e1 n/a (libglib-2.0.so.0) #4 0x00007f8eac2240d5 n/a (libglib-2.0.so.0) #5 0x00007f8eabd97454 start_thread (libpthread.so.0) #6 0x00007f8eabada7df __clone (libc.so.6) Stack trace of thread 15255: #0 0x00007f8eabad148d poll (libc.so.6) #1 0x00007f8eac1fc786 n/a (libglib-2.0.so.0) #2 0x00007f8eac1fc89c g_main_context_iteration (libglib-2.0.so.0) #3 0x00007f8ea06ad4bd n/a (libdconfsettings.so) #4 0x00007f8eac2240d5 n/a (libglib-2.0.so.0) #5 0x00007f8eabd97454 start_thread (libpthread.so.0) #6 0x00007f8eabada7df __clone (libc.so.6) Stack trace of thread 15259: #0 0x00007f8eabad148d poll (libc.so.6) #1 0x00007f8eac1fc786 n/a (libglib-2.0.so.0) #2 0x00007f8eac1fcb12 g_main_loop_run (libglib-2.0.so.0) #3 0x00007f8eac7e2316 n/a (libgio-2.0.so.0) #4 0x00007f8eac2240d5 n/a (libglib-2.0.so.0) #5 0x00007f8eabd97454 start_thread (libpthread.so.0) #6 0x00007f8eabada7df __clone (libc.so.6) Stack trace of thread 15516: #0 0x00007f8eabad5f19 syscall (libc.so.6) #1 0x00007f8eac24203a g_cond_wait_until (libglib-2.0.so.0) #2 0x00007f8eac1d0e89 n/a (libglib-2.0.so.0) #3 0x00007f8eac1d14ac g_async_queue_timeout_pop (libglib-2.0.so.0) #4 0x00007f8eac224b9d n/a (libglib-2.0.so.0) #5 0x00007f8eac2240d5 n/a (libglib-2.0.so.0) #6 0x00007f8eabd97454 start_thread (libpthread.so.0) #7 0x00007f8eabada7df __clone (libc.so.6)
-> gtk+:wayland
With debug symbols:
+ Trace 237110
The problem is the wayland socket is flooded. Either GTK+ or VTE should throttle the beep requests.
Created attachment 347798 [details] [review] wayland: Make beep requests go through the GdkDisplay This way we can add things like throttling.
Created attachment 347799 [details] [review] wayland: Throttle system bell requests If a bad behaving application tries to make the window/display beep too often, throttle the beep requests so that we don't end up filling the Wayland socket queue. The throttle is set to 50 beeps per second, which far more beeps than will ever make any sense from a user experience point of view, but will avoid terminating due to an excessive amount of requests.
50 beeps per second - I like it!
(In reply to Matthias Clasen from comment #9) > 50 beeps per second - I like it! It has a nice buzzing sound to it too. Does that count as a a-c-n?
I am hitting this bug every once in a while (as have other people here). Any reason that this has not been merged yet? From my side it is looking good, except that gdk_window_beep needs the same treatment (i.e. gdk_window_impl_wayland_beep, I am trying to get VTE to use that instead).
Oh right, the first patch addresses that. So everything should be good with the patches.
Review of attachment 347798 [details] [review]: sure
Review of attachment 347799 [details] [review]: sure
Attachment 347798 [details] pushed as 96295ad - wayland: Make beep requests go through the GdkDisplay Attachment 347799 [details] pushed as f6dd1f6 - wayland: Throttle system bell requests
Backported to gtk-3-22.