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

From: Oliver Reiter <[email-masked]>
Date: Sat, 08 Feb 2025 22:16:34 +0100

Hey,

see below:

Eli Zaretskii <[email-masked]> writes:

>> Date: Fri, 07 Feb 2025 22:15:12 +0100
>> From:  Oliver Reiter via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <[email-masked]>
>> 
>> 
>> Dear all,
>> 
>> a feature/igc crash. Opened mu4e and tried to view some mails...
>
> Thanks.
>
> I don't think this is related to igc.  I think somehow Emacs tried to
> display an invalid Lisp object.  See below.
>
>> Thread 1 "emacs" hit Breakpoint 1, terminate_due_to_signal (sig=11, backtrace_limit=40) at /home/reitero/build/sources/emacs/emacs/src/emacs.c:425
>> 425	{
>> (gdb) bt
>> #0  terminate_due_to_signal (sig=11, backtrace_limit=40)
>>     at /home/reitero/build/sources/emacs/emacs/src/emacs.c:425
>> #1  0x00005555556d3892 in handle_fatal_signal (sig=sig@entry=11)
>>     at /home/reitero/build/sources/emacs/emacs/src/sysdep.c:1793
>> #2  0x00005555556d0fb9 in deliver_thread_signal (sig=sig@entry=11,
>>     handler=handler@entry=0x5555556d3884 <handle_fatal_signal>)
>>     at /home/reitero/build/sources/emacs/emacs/src/sysdep.c:1785
>> #3  0x00005555556d101d in deliver_fatal_thread_signal (sig=sig@entry=11)
>>     at /home/reitero/build/sources/emacs/emacs/src/sysdep.c:1805
>> #4  0x00005555556d104e in handle_sigsegv (sig=11, siginfo=<optimized out>, arg=<optimized out>)
>>     at /home/reitero/build/sources/emacs/emacs/src/sysdep.c:1943
>> #5  <signal handler called>
>> #6  0x00007ffff364c3db in __GI_kill () at ../sysdeps/unix/syscall-template.S:120
>> #7  0x000055555585f157 in sigHandle ()
>> #8  <signal handler called>
>> #9  0x000055555574ebea in SYMBOL_NAME (sym=<optimized out>)
>>     at /home/reitero/build/sources/emacs/emacs/src/lisp.h:2417
>> #10 print_object (obj=<optimized out>, obj@entry=0x7fffa7debfb3, printcharfun=printcharfun@entry=0x38,
>>     escapeflag=escapeflag@entry=true) at /home/reitero/build/sources/emacs/emacs/src/print.c:2587
>> #11 0x000055555574f80d in print (obj=obj@entry=0x7fffa7debfb3, printcharfun=0x38,
>>     escapeflag=escapeflag@entry=true) at /home/reitero/build/sources/emacs/emacs/src/print.c:1297
>> #12 0x000055555574f8ef in Fprin1 (object=object@entry=0x7fffa7debfb3,
>>     printcharfun=printcharfun@entry=0x38, overrides=overrides@entry=0x0)
>>     at /home/reitero/build/sources/emacs/emacs/src/print.c:778
>> #13 0x000055555574fe98 in print_error_message (data=<optimized out>, stream=0x38,
>>     context=<optimized out>, caller=<optimized out>)
>>     at /home/reitero/build/sources/emacs/emacs/src/print.c:1136
>> #14 0x00005555556b5ee6 in Fcommand_error_default_function (data=0x7fffb59141b3,
>>     context=0x7fffe04215cc, signal=0x7fffb582a70d)
>>     at /home/reitero/build/sources/emacs/emacs/src/keyboard.c:1111
>> #15 0x00007fffdff0956b in F68656c702d636f6d6d616e642d6572726f722d636f6e66757361626c652d73756767657374696f6e73_help_command_error_confusable_suggestions_0 ()
>>    from /home/reitero/build/sources/emacs/emacs/src/../native-lisp/31.0.50-8ba3f656/preloaded/help-59d8049f-833688ae.eln
>> #16 0x000055555572f297 in funcall_subr (subr=subr@entry=0x7fffbbda37f8, numargs=numargs@entry=3,
>>     args=args@entry=0x7fffffffd7e8) at /home/reitero/build/sources/emacs/emacs/src/eval.c:3176
>> #17 0x000055555572dacb in funcall_general (fun=0x7fffbbda37fd, numargs=numargs@entry=3,
>>     args=args@entry=0x7fffffffd7e8) at /home/reitero/build/sources/emacs/emacs/src/lisp.h:2290
>> #18 0x000055555572dbe3 in Ffuncall (nargs=4, args=0x7fffffffd7e0)
>>     at /home/reitero/build/sources/emacs/emacs/src/eval.c:3104
>> #19 0x00005555556b4be7 in cmd_error_internal (data=data@entry=0x7fffb59141b3,
>>     context=context@entry=0x7fffffffd830 "")
>>     at /home/reitero/build/sources/emacs/emacs/src/keyboard.c:1053
>> #20 0x00005555556b4d55 in cmd_error (data=0x7fffb59141b3)
>>     at /home/reitero/build/sources/emacs/emacs/src/keyboard.c:1021
>> #21 0x000055555572c431 in internal_condition_case (bfun=0x5555556b7b61 <command_loop_1>,
>>     handlers=<optimized out>, hfun=0x5555556b4c1e <cmd_error>)
>>     at /home/reitero/build/sources/emacs/emacs/src/eval.c:1619
>
> Translation:
>
>   . Emacs invoked some command
>   . the command signaled an error
>   . as part of processing the error, Emacs needed to show some object
>   . print_object segfaulted trying to print the object
>
> Now, your clone repository is slightly out-of-sync with what we
> currently have, so the crash seems to be here:
>
>     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

The source file is at the same revision than the build, not sure why I
get this warning...

> It is quite possible GDB will say "xtype" is unknown, in which case do
>
>  (gdb) source /path/to/emacs/src/.gdbinit
>
> and then repeat the above 3 commands.  Also try
>
>  (gdb) fr 20
>  (gdb) p data
>  (gdb) xtype
(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

HTH

Oliver