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

From: Po Lu <[email-masked]>
Date: Fri, 12 Aug 2022 21:23:38 +0800

Eli Zaretskii <[email-masked]> writes:

> The backtrace says:
>
>  . the main loop called some command
>  . that command signaled an error
>  . the error caused the Lisp debugger to be called
>  . the debugger was invoked and entered recursive-edit
>  . while waiting for user input, a timer fired
>  . the timer function called write-region
>  . write-region called lock-file
>  . lock-file called a Lisp function, probably to report some conflict
>    with another process(??) locking the file
>  . Emacs prompted the user, probably about the lock
>  . while waiting for user response, Emacs checked timers, and as
>    result called process_pending_signals
>  . one of the pending signals was SIGIO, so Emacs called read-socket,
>    which segfaulted inside GTK
>
> Does the above sound reasonable for your Emacs sessions?

It seems plausible, GTK aborted because it received an X event that it
couldn't find a corresponding device for.  So to really figure out what
event is causing the problem, you have to look inside GTK, because on
GTK builds it's reading events and not XTread_socket (which just calls
gtk_main_iteration.)