lanoxx / tilda

A Gtk based drop down terminal for Linux and Unix
GNU General Public License v2.0
1.27k stars 162 forks source link

SIGTRAP from bad X call when holding the "Pull Down Terminal" keybind #388

Closed sheybey closed 4 years ago

sheybey commented 5 years ago

This appears to be the same crash as #348, but the problem is not triggered by desktop switching. The only consistent criterion is an uptime of at least several hours, but there doesn't seem to be an upper limit - I've gone weeks without ending my desktop session and tilda ran fine the whole time. This Debian bug report appears to be about the same issue: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=893858

I've captured an strace of the most recent incident, but the only thing sticking out to me is the bad X call which results in a SIGTRAP. This is the resulting message. ** (tilda:9329): ERROR **: 17:14:40.955: X Error: BadMatch (invalid parameter attributes)

I'm rebuilding tilda from source at the moment and I'll see if I can reproduce the crash under a debugger.

I'm running Debian testing. Tilda 1.4.1-2 running on Gnome 3.30.2 on X.org.

sheybey commented 5 years ago

I have found a consistent way to trigger this.

  1. Start tilda.
  2. Open tilda.
  3. Press and hold the "Pull Down Terminal" keybinding.

This causes the BadMatch error seen above.

stderr/stdout:

tilda.c: FUNCTION ENTERED: main: Using libvte version: 0.54.2
tilda.c: FUNCTION ENTERED: remove_stale_lock_files
tilda.c: FUNCTION ENTERED: create_lock_file
tilda.c: FUNCTION ENTERED: get_instance_number
tilda.c: FUNCTION ENTERED: islockfile
tilda.c: FUNCTION ENTERED: create_lock_file
tilda.c: FUNCTION ENTERED: parse_cli
tilda.c: FUNCTION ENTERED: get_config_file_name
tilda_window.c: FUNCTION ENTERED: tilda_window_init
tilda_window.c: FUNCTION ENTERED: tilda_window_set_fullscreen
tilda_window.c: FUNCTION ENTERED: tilda_window_add_tab
tilda_terminal.c: FUNCTION ENTERED: tilda_term_init
tilda_terminal.c: FUNCTION ENTERED: tilda_term_config_defaults
tilda_terminal.c: FUNCTION ENTERED: tilda_term_adjust_font_scale
tilda_terminal.c: FUNCTION ENTERED: tilda_term_set_scrollbar_position
tilda_terminal.c: FUNCTION ENTERED: start_shell
tilda_terminal.c: FUNCTION ENTERED: tilda_terminal_switch_page_cb
tilda_window.c: FUNCTION ENTERED: tilda_search_box_init
key_grabber.c: FUNCTION ENTERED: generate_animation_positions
Virtual modifier for 'caps_lock_mask' set to: GDK_LOCK_MASK
Virtual modifier for 'num_lock_mask' set to: GDK_MOD2_MASK
Virtual modifier for 'scroll_lock_mask' set to: 
Resolved accelerator: F12. KeySymbol: 65481, Virtual Modifiers: 
Binding to keycode 96
Binding to real modifier mask 0 ()
Added binding. Keystring: F12
key_grabber.c: FUNCTION ENTERED: pull
Tilda has started. Press F12 to pull down the window.
tilda_terminal.c: FUNCTION ENTERED: window_title_changed_cb
tilda_terminal.c: FUNCTION ENTERED: get_window_title
Got KeyPress! keycode: 96, modifiers: 0
Current event time 429800950
Calling handler for 'F12'...
key_grabber.c: FUNCTION ENTERED: onKeybindingPull
key_grabber.c: FUNCTION ENTERED: pull
tilda_window.c: FUNCTION ENTERED: focus_term
key_grabber.c: FUNCTION ENTERED: tilda_window_set_active
pull_down(): MOVED DOWN
Got KeyRelease!
tilda_window.c: FUNCTION ENTERED: focus_out_event_cb
Got KeyPress! keycode: 96, modifiers: 0
Current event time 429802117
Calling handler for 'F12'...
key_grabber.c: FUNCTION ENTERED: onKeybindingPull
key_grabber.c: FUNCTION ENTERED: pull
pull_up(): MOVED UP
Got KeyPress! keycode: 96, modifiers: 0
Current event time 429802618
Calling handler for 'F12'...
key_grabber.c: FUNCTION ENTERED: onKeybindingPull
key_grabber.c: FUNCTION ENTERED: pull
tilda_window.c: FUNCTION ENTERED: focus_term
key_grabber.c: FUNCTION ENTERED: tilda_window_set_active
pull_down(): MOVED DOWN
Got KeyPress! keycode: 96, modifiers: 0
Current event time 429802648
Calling handler for 'F12'...
key_grabber.c: FUNCTION ENTERED: onKeybindingPull
key_grabber.c: FUNCTION ENTERED: pull
pull_up(): MOVED UP
Got KeyPress! keycode: 96, modifiers: 0
Current event time 429802678
Calling handler for 'F12'...
key_grabber.c: FUNCTION ENTERED: onKeybindingPull
key_grabber.c: FUNCTION ENTERED: pull
tilda_window.c: FUNCTION ENTERED: focus_term
key_grabber.c: FUNCTION ENTERED: tilda_window_set_active
pull_down(): MOVED DOWN
Got KeyPress! keycode: 96, modifiers: 0
Current event time 429802708
Calling handler for 'F12'...
key_grabber.c: FUNCTION ENTERED: onKeybindingPull
key_grabber.c: FUNCTION ENTERED: pull
pull_up(): MOVED UP
xerror.c: FUNCTION ENTERED: xerror_handler
X Error: BadMatch (invalid parameter attributes)
Trace/breakpoint trap

Core file: core.23213.gz

nssy commented 5 years ago

Running same environment and can confirm this happens.

mclark-newvistas commented 5 years ago

I believe I have the same issue - Arch Linux, Tilda 1.4.1-1 (latest package). Pressing the "Pull Down Terminal" keybinding too quickly (or holding it, as suggested) triggers a crash. Tilda is also notably slower to appear than typical (when it doesn't crash), though disappears as fast as usual.

Luk4sG commented 4 years ago

Confirming this on Ubuntu 18.04. Very annoying. You don't need to hold the key - just press it fast few times. Found you that disabling Auto Hide Delay (set to 0) and enabling animations (currently 1000usec) makes it occur less frequently, at least when not holding the "pull down" key.

whitty commented 4 years ago

@lanoxx thanks for your fix on this issue - I have some similar symptoms in #428. I'd like to contribute some time to diagnosing the issue. Can you give any pointers where to instrument. Obviously the BadMatch is not the cause of the error, but reporting that an error has occurred.

I'm happy to contribute some time adding instrumentation to get to the root cause here, but I have no familiarity with the toolkits involved - is it possible to diagnose from the output what the message is that caused the bad response? where is the code related to terminal hide/show/pull-down that I should instrument.

howels commented 3 years ago

Same error here. Ubuntu 20.10 MATE with tilda and can repeatably crash Tilda all of a sudden by hitting the show/hide hotkey a couple of times quickly. Started a few weeks ago.

Tilda has started. Press F12 to pull down the window.

(tilda:5228): tilda-ERROR **: 01:13:08.620: X Error: BadMatch (invalid parameter attributes)
Tilda has started. Press F12 to pull down the window.

(tilda:5274): Gtk-CRITICAL **: 01:14:00.524: gtk_builder_get_object: assertion 'GTK_IS_BUILDER (builder)' failed

(tilda:5274): Gtk-CRITICAL **: 01:14:00.524: gtk_builder_get_object: assertion 'GTK_IS_BUILDER (builder)' failed

(tilda:5274): Gtk-CRITICAL **: 01:14:00.524: gtk_spin_button_get_range: assertion 'GTK_IS_SPIN_BUTTON (spin_button)' failed

(tilda:5274): GLib-GObject-WARNING **: 01:14:00.524: invalid (NULL) pointer instance

(tilda:5274): GLib-GObject-CRITICAL **: 01:14:00.524: g_signal_handlers_block_matched: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(tilda:5274): Gtk-CRITICAL **: 01:14:00.524: gtk_spin_button_set_value: assertion 'GTK_IS_SPIN_BUTTON (spin_button)' failed

(tilda:5274): GLib-GObject-WARNING **: 01:14:00.524: invalid (NULL) pointer instance

(tilda:5274): GLib-GObject-CRITICAL **: 01:14:00.524: g_signal_handlers_unblock_matched: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(tilda:5274): Gtk-CRITICAL **: 01:14:00.525: gtk_window_resize: assertion 'height > 0' failed

(tilda:5274): tilda-ERROR **: 01:14:02.908: X Error: BadMatch (invalid parameter attributes)
Tilda has started. Press F12 to pull down the window.

(tilda:5334): tilda-ERROR **: 01:14:25.009: X Error: BadMatch (invalid parameter attributes)
Tilda has started. Press F12 to pull down the window.

(tilda:5378): tilda-ERROR **: 01:15:25.207: X Error: BadMatch (invalid parameter attributes)

Running Tilda 1.5.2-1