halt
ed wait
ing robots are stuck in limbo and cannot be reprogram
med
#2253
Labels
Bug
The observed behaviour is incorrect or unexpected.
C-Low Hanging Fruit
Ideal issue for new contributors.
G-CESK machine
This issue has to do with the CESK machine (the Swarm language interpreter).
G-Robots
An issue having to do with robots.
S-Nice to have
The bug fix or feature would be nice but doesn't currently have much negative impact.
Describe the bug
If a robot is
wait
ing and is killed viahalt
, it seems to get stuck in a state where its CESK machine isUp
, waiting to propagate an exception up to the top level to cancel its running process, but it never gets a chance to run since it is waiting. This means, for example, that it cannot bereprogram
med orsalvage
d, since the system still considers it to be actively running a program.To Reproduce
In creative mode:
This should work and result in the built robot disappearing. Instead, we get an error about not being able to reprogram a running robot. However, if you wait the 1024 ticks and then try
reprogram
again, it works.For comparison, if we replace the
wait
with a busy loop then it works fine:Expected behavior
Calling
halt
on a robot should move it out of the "waiting" state so it can immediately do finalization/cleanup and transition to an idle state.The text was updated successfully, but these errors were encountered: