Subject: bug#71929: 30.0.60; crash in mark_image_cache

From: Po Lu <[email-masked]>
Date: Sun, 07 Jul 2024 12:04:38 +0800

Sean Whitton <[email-masked]> writes:

> Hello,
>
> On Sun 07 Jul 2024 at 10:43am +08, Sean Whitton wrote:
>
>> Hello,
>>
>> On Sat 06 Jul 2024 at 02:08pm +08, Po Lu wrote:
>>
>>> Thanks.  Would you mind running Emacs with this patch installed and
>>> configured with the aforesaid option, and responding with backtraces
>>> from any triggered assertion?
>>
>> I launch it with emacs --fg-daemon under gdb and it crashes immediately,
>> before I've had chance to open any frames with emacsclient:
>
> Not quite.  It crashes when I try to use 'emacsclient -c' to open the
> first graphical frame.

Please move into verify_image_cache_refcount and execute:

  (gdb) p expected
  (gdb) p FRAME_IMAGE_CACHE (f)
  (gdb) p FRAME_IMAGE_CACHE (f)->refcount
  (gdb) set $cons = Vframe_list
  (gdb) while $cons
   >xgetptr $cons
   >p ((struct Lisp_Cons *) $ptr)->u.s.car
   >xframe
   >p *$
   >xgetptr $cons
   >set $cons = ((struct Lisp_Cons *) $ptr)->u.s.u.cdr
   >end