Subject: Re: bug#63614: 29.0.91; PGTK Emacs crashes after clearing the clipboard

From: Po Lu <[email-masked]>
Date: Sun, 21 May 2023 08:51:30 +0800

Leonardo Hernández <[email-masked]> writes:

> Hello, I have been having issues with crashes running Emacs with PGTK
> on Wayland.
>
> To reproduce, open `emacs -Q`, then copy whatever you want with <M-w> or
> <C-w> and then copy another thing outside Emacs, for example, `wl-copy
> <<< "Copied text"`, then Emacs crashes.
>
> Backtrace:
> #0 0x00007f92636ac8ec in () at /usr/lib64/libc.so.6
> #1 0x00007f926365d3e2 in raise () at /usr/lib64/libc.so.6
> #2 0x0000563f0697d0a5 in terminate_due_to_signal (sig=11, 
> backtrace_limit=<optimized out>) at emacs.c:464
> #3 0x0000563f0697def8 in handle_fatal_signal (sig=11) at sysdep.c:1783
> fatal = <optimized out>
> #4 deliver_thread_signal (handler=<optimized out>, sig=11) at sysdep.c:1775
> fatal = <optimized out>
> #5 deliver_fatal_thread_signal (sig=11) at sysdep.c:1795
> fatal = <optimized out>
> #6 handle_sigsegv (sig=11, siginfo=0x563f072243f0 <sigsegv_stack+64496>, 
> arg=<optimized out>) at sysdep.c:1888
> fatal = <optimized out>
> #7 0x00007f926365d490 in <signal handler called> () at /usr/lib64/libc.so.6
> #8 0x0000563f06c49d89 in pgtk_handle_selection_clear (event=<optimized 
> out>) at pgtkselect.c:742
> selection = <optimized out>
> changed_owner_time = 0
> selection_symbol = <optimized out>
> local_selection_data = <optimized out>
> local_selection_time = <optimized out>
> dpyinfo = 0x90c1b80
> Vselection_alist = <optimized out>

Sadly, it seems that most of the relevant local variables have been
optimized out.  Would you please run (in this frame):

  (gdb) *event
  (gdb) p *event->selection

Thanks.