Subject: Re: Segfault when printing a call-with-values stack frame in backtrace

From: Maxime Devos <[email-masked]>
Date: Sun, 7 May 2023 17:06:48 +0200

> Hello there,
> 
> Guile seems to segfault when trying to print certain backtraces with a
> 'call-with-values' stack frame.  Here's a minimal reproducer program:
> 
> (symbol? (call-with-values (lambda () (error 'oh-no)) list))

Here is a more minimal reproducer, from
<https://debbugs.gnu.org/cgi/bugreport.cgi?bug=50153>:

> Write the following to "crash.scm":
> 
>> (call-with-values backtrace list)
>> #t
> 
> (the trailing #t is important) and run
> 
>> # --auto-compile works too, but --no-auto-compile doesn't cause a crash
>> guile --fresh-auto-compile -l crash.scm

(i.e., it doesn't seem to be a bug in the exception mechanism, itself 
rather it seems a bug in something _used_ by the exception mechanism.)

I don't know if it has exactly the same cause, but it looks familiar.

For some other backtrace suspiciousness, see 
<https://debbugs.gnu.org/cgi/bugreport.cgi?bug=48422>, though possibly 
that issue has a different cause.

Because of the ‘It seems that the data stored in the stack frames for
'call-with-values' calls is incorrect [...]’ it seems plausible 
something similar is going on in 
<https://debbugs.gnu.org/cgi/bugreport.cgi?bug=46232>, though possibly 
that is unrelated.

Greeitngs,
Maxime.