Subject: bug#71929: 30.0.60; crash in mark_image_cache

From: Eli Zaretskii <[email-masked]>
Date: Sun, 07 Jul 2024 10:08:01 +0300

> From: Sean Whitton <[email-masked]>
> Cc: [email-masked],  Eli Zaretskii <[email-masked]>
> Date: Sun, 07 Jul 2024 12:54:13 +0800
> 
> > 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
> 
> (gdb) p expected
> $1 = 0
> (gdb) p FRAME_IMAGE_CACHE (f)
> $2 = (struct image_cache *) 0x555557f29270
> (gdb) p FRAME_IMAGE_CACHE (f)->refcount
> $3 = 1
> (gdb) set $cons = Vframe_list
> [...]
> $4 = XIL(0x555555f3dfd5)
> $5 = (struct frame *) 0x555555f3dfd0
> "F1"
> $6 = {
>   header = {
>     size = 4611686018595352602
>   },
> [...]
>   terminal = 0x555555f3ddb0,
>   output_data = {
>     tty = 0x0,
>     x = 0x0,
>     w32 = 0x0,
>     ns = 0x0,
>     pgtk = 0x0,
>     haiku = 0x0,
>     android = 0x0
>   },

This is the initial frame of the daemon.  It is not a GUI frame, and
so it should not have a valid image cache.  I guess some change is
needed in verify_image_cache_refcount?