Closed jpco closed 10 months ago
The command echo ~
also seems to go poorly when GCALWAYS enabled -- if GCPROTECT is on, it results in a segfault; if not, echo ~
literally echoes ~
(expected behavior is printing whatever %home
returns). Bug is somewhere around glob.c:278
.
@jpco thanks for raising this. I'm not planning to look into it any time soon, but any PRs gratefully accepted :)
Enabling the GCDEBUG flag (equivalent to both GCALWAYS and GCPROTECT) causes two segfaults to occur, one in
$&fsplit
, and one in exception-handling code.The
$&fsplit
segfault happens atsplit.c:99
, because with GCALWAYS, themkstr
andmklist
calls start a GC, which makess
point to invalid memory, which causes a segfault when GCPROTECT is enabled. I have a fix implemented for this (essentially, a re-entrant implementation ofsplitstring
) which I'll create a PR with later.The exception-handling segfault happens at
prim-etc.c:254
when GCALWAYS is enabled (this case does not require GCPROTECT to be enabled to happen, though it's a fatal failure either way). I suspect one of the GCs that get triggered during the chainedmklist
andmkstr
s aroundprim-ctl.c:70
are to blame, but I'm not confident enough with theRef
s to know quite how to fix it.