Subject: bug#76238: 31.0.50; feature/igc: crash #2, 2025-02-12

From: Pip Cet <[email-masked]>
Date: Sat, 15 Feb 2025 12:14:02 +0000

"Oliver Reiter" <[email-masked]> writes:

> Pip Cet <[email-masked]> writes:
>
>> "Oliver Reiter" <[email-masked]> writes:
>>
>>> Pip Cet <[email-masked]> writes:
>>>
>>>> "Oliver Reiter via \"Bug reports for GNU Emacs, the Swiss army knife of text editors\"" <[email-masked]> writes:
>>>>
>>>>> Dear all,
>>>>>
>>>>> a crash while marking a region:
>>>>
>>>> Thanks again!  I was hoping to fix bug#76237 first, but as that has me
>>>> stumped, can I get a "bt full" for this one, plus the following:
>>>>
>>>> x/79gx 0x7fffb9c07730
>>>>
>>>
>>> Sure, have a look here:
>>
>> Thanks.  I did wonder why you were seeing so many crashes, and I suspect
>> that PGTK is the most likely explanation: the PGTK code puts Lisp
>> objects into malloc'd memory in a number of places, and that needs to be
>> fixed before it can work stably with MPS GC, I'm afraid.
>>
>> I had a hard time triggering this, but ultimately succeeded.  I think
>> the most likely culprit (and what I used for my crash) is an "event"
>> device registered with PGTK: its name is stored in xmalloc'd memory, so
>> it will likely become invalid after a few collections, but it will be
>> exposed to Lisp (and the garbage collector) if an event from this device
>> ever fires.
>>
>> I'm not sure what the best way forward is here; there's a lot of PGTK
>> code and fixing it might take some time, and I can't reliably test such
>> builds because PGTK does not support X, only Wayland.
>>
>> OTOH, X builds should work fine on most Wayland displays, right?  Maybe
>> you could try running one of those in case it's a different problem
>> after all?
>>
>> Anyway, thanks again for the report, and I'll let you know if I found
>> out more.
>>
>> Pip
>
> So you are suggesting to build with X (or Lucid or so?), and if I keep
> seeing these crashes we have established it is not PGTK's fault. Or,

Precisely.

> in the case of no (similar) crashes, that it is indeed PGTK causing
> these crashes. Right? If yes, then I'll do that over the next weeks.

I think that would be extremely helpful, yes (I'd use the plain GTK3
build as it's probably closest to PGTK).  You can also wait for me to
commit the initial round of fixes for PGTK and try continuing to use
that, of course.

> If there is something else I could do to help debug the igc+PGTK
> build, please tell.

Thanks for all your efforts so far!  While I'm sure I won't find all
issues with the PGTK build right away, leaked strings are particularly
difficult to diagnose, so I'll fix what I can see and let you know!

Pip