Subject: bug#76559: 31.0.50; [-O3 + PGTK] Crash when 'copying as kill'/'killing word'

From: Eli Zaretskii <[email-masked]>
Date: Wed, 26 Feb 2025 15:10:33 +0200

> Cc: Michael Albinus <[email-masked]>
> From: Iurie Marian <[email-masked]>
> Date: Tue, 25 Feb 2025 18:32:39 +0100
> 
> Dear Maintainers,
> 
> Emacs is crashing while copying-as-kill/killing-word, only when compiled
> with -O3 optimizations. I am using PGTK (see the configure command
> below). I did a git bisect, and it seems that the commit below is
> triggering the bug. To reproduce it just compile with -O3 and PGTK, then
> simply hit M-<backspace>.
> 
> At the bottom you will also see the the stack trace, maybe it's useful.

Is this still in GDB, and you can answer some questions about it?  Or,
if not, then reproduce the crash and answer the questions then?

> (gdb) info locals
> event = 0x555555957a40 <kbd_buffer+384>
> copy = {kind = SELECTION_REQUEST_EVENT, dpyinfo = 0x55cf0b00,
> requestor = 0x555555f97a80, selection = 0x45, target = 0x4d, property
> = 0x5e, time = 0}
> moved_events = <optimized out>
> 
> (gdb) x/s 0x55cf0b00
> 0x55cf0b00:     <error: Cannot access memory at address 0x55cf0b00>

What does this produce:

 (gdb) p *event