Home / Docs / Diagnostics
U6007: The host stopped the run before it finished
una run and native executables end a run with this error when the hard stop of a host stop cancels it (spec/26 §6, ADR 0116 rule 16). The output so far stays printed, the trace is written, and the exit code is 1.
Why Una rejects it
A host stop request is one of:
- SIGINT or SIGTERM,
- the end of
--deadline <seconds>, - a driver's shutdown, or
- the run's own stop after
--stop-after-iterations <n>.
After the first request, every for ever ends at its next iteration start and runs its on stop, and the rest of the program runs on.
The hard stop comes at the end of the grace period, --stop-grace <seconds> (10 by default), or at a second request. It cancels the run at its next call or loop iteration, on stop blocks included.
A run that ends within the grace period ends normally, with exit code 0.
How to fix it
- Keep the work after a stop short: an
on stopthat releases what the loop holds, and no long computation or wait there. - A run that must not be cut gets a longer grace period.
The repair at a glance
module demo
pub main() -> Unit
diverges
=
let edit n = 0
for ever
n = n + 1
on stop
- for i in 0..<1000000000
+ for i in 0..<10
n = n + 1
unitFailing example
Run it with una run --deadline 1 --stop-grace 1: the on stop block counts far past the grace period.
ita demo
version 0.1.0
edition 0.4
run
entry demolock 1
solver
encoding "una-smt-1"
name "z3"
version "5.1.0"
logic "QF_UFLIA"
steps 5000000
seed 0module demo
pub main() -> Unit
diverges
=
let edit n = 0
for ever
n = n + 1
on stop
for i in 0..<1000000000
n = n + 1
unitFixed example
Run it with una run --deadline 1 --stop-grace 1: the on stop block ends well within the grace period.
ita demo
version 0.1.0
edition 0.4
run
entry demolock 1
solver
encoding "una-smt-1"
name "z3"
version "5.1.0"
logic "QF_UFLIA"
steps 5000000
seed 0module demo
pub main() -> Unit
diverges
=
let edit n = 0
for ever
n = n + 1
on stop
for i in 0..<10
n = n + 1
unit