Subject: bug#56869: 29.0.50; segfault, "assertion 'GDK_IS_DEVICE (device)' failed"

From: Joe Corneli <[email-masked]>
Date: Mon, 15 Aug 2022 15:00:47 +0100

Joe Corneli writes:

> Hm, I think I missed the obvious ones.  Have added:
>
> sudo apt-get install libgtk-3-0-dbgsym libgtk-3-bin-dbgsym
>
> If it crashes again, I’ll give more info.

OK, I think I’m now able to provide the debugging info you were asking
for!  As far as I could tell the specific interaction that triggered
this was switching between windows.

Thread 1 "emacs" received signal SIGSEGV, Segmentation fault.
gdk_x11_device_manager_xi2_translate_event (xevent=<optimised out>, event=<optimised out>, display=<optimised out>, 
    translator=<optimised out>) at ../../../../../gdk/x11/gdkdevicemanager-xi2.c:1794
1794	../../../../../gdk/x11/gdkdevicemanager-xi2.c: No such file or directory.
(gdb) generate-core-file
warning: Memory read failed for corefile section, 4096 bytes at 0xffffffffff600000.
Saved corefile core.384524
(gdb) bt
#0  gdk_x11_device_manager_xi2_translate_event
    (xevent=<optimised out>, event=<optimised out>, display=<optimised out>, translator=<optimised out>)
    at ../../../../../gdk/x11/gdkdevicemanager-xi2.c:1794
#1  gdk_x11_device_manager_xi2_translate_event
    (translator=<optimised out>, display=<optimised out>, event=<optimised out>, xevent=<optimised out>)
    at ../../../../../gdk/x11/gdkdevicemanager-xi2.c:1478
#2  0x00007ffff757e989 in _gdk_x11_event_translator_translate
    (translator=translator@entry=0x555556481800, display=0x55555645d0e0, xevent=xevent@entry=0x7fffffffccc0)
    at ../../../../../gdk/x11/gdkeventtranslator.c:51
#3  0x00007ffff757e4cc in gdk_event_source_translate_event (xevent=0x7fffffffccc0, event_source=0x555555f7c890)
    at ../../../../../gdk/x11/gdkeventsource.c:230
#4  _gdk_x11_display_queue_events (display=0x55555645d0e0) at ../../../../../gdk/x11/gdkeventsource.c:341
#5  0x00007ffff75460e4 in gdk_display_get_event (display=display@entry=0x55555645d0e0)
    at ../../../../gdk/gdkdisplay.c:441
#6  0x00007ffff757e0e6 in gdk_event_source_dispatch
    (source=<optimised out>, callback=<optimised out>, user_data=<optimised out>)
    at ../../../../../gdk/x11/gdkeventsource.c:363
#7  0x00007ffff6f5617d in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#8  0x00007ffff6f56400 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#9  0x00007ffff6f564a3 in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#10 0x00007ffff78611d9 in gtk_main_iteration () at ../../../../gtk/gtkmain.c:1432
#11 0x00005555556f3c4c in XTread_socket (terminal=0x555556229fe8, hold_quit=0x7fffffffcf90) at xterm.c:23384
#12 0x0000555555750de1 in gobble_input () at keyboard.c:7364
#13 0x0000555555751295 in handle_async_input () at keyboard.c:7595
#14 0x00005555557512b8 in process_pending_signals () at keyboard.c:7609
#15 0x00005555557512fc in unblock_input_to (level=0) at keyboard.c:7624
#16 0x0000555555751324 in unblock_input () at keyboard.c:7643
#17 0x000055555574aa84 in timer_check () at keyboard.c:4734
#18 0x0000555555748485 in readable_events (flags=1) at keyboard.c:3516
#19 0x0000555555750c86 in get_input_pending (flags=1) at keyboard.c:7314
#20 0x0000555555758fe0 in detect_input_pending_run_timers (do_display=true) at keyboard.c:10844
#21 0x0000555555877a12 in wait_reading_process_output
    (time_limit=135, nsecs=0, read_kbd=-1, do_display=true, wait_for_cell=XIL(0), wait_proc=0x0, just_wait_proc=0)
    at process.c:5780
#22 0x00005555555af4f7 in sit_for (timeout=make_fixnum(135), reading=true, display_option=1) at dispnew.c:6238
#23 0x00005555557465f6 in read_char
    (commandflag=1, map=XIL(0x55555aebd253), prev_event=XIL(0), used_mouse_menu=0x7fffffffd8b9, end_time=0x0)
    at keyboard.c:2864
#24 0x00005555557573c6 in read_key_sequence
    (keybuf=0x7fffffffdaf0, prompt=XIL(0), dont_downcase_last=false, can_return_switch_frame=true, fix_current_buffer=true, prevent_redisplay=false) at keyboard.c:10021
#25 0x000055555574241e in command_loop_1 () at keyboard.c:1384
#26 0x000055555580b3a2 in internal_condition_case
    (bfun=0x555555742004 <command_loop_1>, handlers=XIL(0x90), hfun=0x5555557415cd <cmd_error>) at eval.c:1497
#27 0x0000555555741ca5 in command_loop_2 (handlers=XIL(0x90)) at keyboard.c:1132
#28 0x000055555580a9ab in internal_catch (tag=XIL(0xf3c0), func=0x555555741c7a <command_loop_2>, arg=XIL(0x90))
    at eval.c:1220
#29 0x0000555555741c35 in command_loop () at keyboard.c:1110
#30 0x0000555555741156 in recursive_edit_1 () at keyboard.c:719
#31 0x0000555555741308 in Frecursive_edit () at keyboard.c:802
#32 0x000055555573d478 in main (argc=1, argv=0x7fffffffdf98) at emacs.c:2517

-- 
Dr Joseph A. Corneli (https://github.com/holtzermann17)

HYPERREAL ENTERPRISES LTD is a private company limited by shares, incorporated
25th, June 2019 as Company Number 634284 on the Register of Companies for
Scotland (https://beta.companieshouse.gov.uk/company/SC634284).