$ tcsh -fc 'set -r status;:'
set: $status is read-only.
set: $status is read-only.
set: $status is read-only.
set: $status is read-only.
set: $status is read-only.
set: $status is read-only.
set: $status is read-only.
[after a veeeeeery loooong while of this repeated stream of read-only errors]
set: $status is read-only.
set: $status is read-only.
set: $status is read-only.
set: $status is read-only.
set: $status is read-only.
set: $status is read-only.
set: $status is read-only.
Segmentation fault (core dumped)
Tested it on master and can confirm it still occurs there.
It seems likely to me that this is what's happening:
tcsh uses $status for the purposes of holding the last command return status.
set -r status sets $status to be read-only, meaning any attempts to write to it result in an error
tcsh tries to set $status to the result of the command at some point, I don't really know exactly what triggers it but "finishing" a part of syntax that gives a status and having something after it seems to be what's triggering it for me (as not having the ;: part doesn't crash it)
this results in an error since $status is read-only
the error recovery routine attempts to "end" the command
it goes back to step 2 and dies in a stack overflow due to the infinite recursive loop
MCVE:
Tested it on master and can confirm it still occurs there.
It seems likely to me that this is what's happening:
$status
for the purposes of holding the last command return status.set -r status
sets$status
to be read-only, meaning any attempts to write to it result in an error$status
to the result of the command at some point, I don't really know exactly what triggers it but "finishing" a part of syntax that gives a status and having something after it seems to be what's triggering it for me (as not having the;:
part doesn't crash it)$status
is read-only