Subject: bug#76133: 31.0.50; feature/igc: crash using mu4e, 2025-02-07

From: Eli Zaretskii <[email-masked]>
Date: Sun, 09 Feb 2025 07:37:44 +0200

> From: Oliver Reiter <[email-masked]>
> Cc: [email-masked], Pip Cet <[email-masked]>
> Date: Sat, 08 Feb 2025 22:16:34 +0100
> 
> >     case Lisp_Symbol:
> >       {
> > 	Lisp_Object name = SYMBOL_NAME (obj); <<<<<<<<<<<<<<<<<
> > 	ptrdiff_t size_byte = SBYTES (name);
> >
> > Is the crashes session still inside GDB?  If so, please do
> >
> >  (gdb) fr 10
> >  (gdb) p obj
> >  (gdb) xtype
> >
> (gdb) fr 10
> #10 print_object (obj=<optimized out>, obj@entry=XIL(0x7fffa7debfb3),
>     printcharfun=printcharfun@entry=XIL(0x38), escapeflag=escapeflag@entry=true)
>     at /home/reitero/build/sources/emacs/emacs/src/print.c:2587
> warning: Source file is more recent than executable.
> 2587		Lisp_Object name = SYMBOL_NAME (obj);
> (gdb) p obj
> $1 = <optimized out>
> (gdb) xtype
> value has been optimized out

Darn!

> (gdb) fr 20
> #20 0x00005555556b4d55 in cmd_error (data=XIL(0x7fffb59141b3))
>     at /home/reitero/build/sources/emacs/emacs/src/keyboard.c:1021
> 1021	  cmd_error_internal (data, macroerror);
> (gdb) p data
> $3 = XIL(0x7fffb59141b3)
> (gdb) xtype
> Lisp_Cons

OK, so now:

  (gdb) fr 20
  (gdb) p data
  (gdb) xcar
  (gdb) xtype

The last two commands will show the car of the error data and its
type.  For each Lisp object type we have a corresponding xTYPE
command.  For example, xsymbol for symbols, xstring for strings,
xvector for vectors, etc.  So keep walking the members of the 'data'
list with xcdr, xcar, xtype, and the corresponding xTYPE.  Here's the
beginning:

  (gdb) p data
  (gdb) xcar
  (gdb) xtype
  <assuming the above says Lisp_Symbol>
  (gdb) xsymbol
  (gdb) p data
  (gdb) xcdr
  (gdb) xcar
  (gdb) xtype
  (gdb) <xTYPE command according to what xtype says>

That is, each time take xcdr several times, then xcar, then xtype, and
then the corresponding xTYPE command to show the object.  If the list
is

  (a b c d)

then to show c, you need xcdr twice and then xcar.

Keep going until xcdr will hit nil, which means the end of the list.

Somewhere there you will probably see an invalid Lisp object, and we
will then need to look at it and try to understand where it came from
and why.

Thanks.