Six refusals in the runtime called _exit(134) where every other error had learned to park: no restart by that name, a restart taken with the wrong arguments or with none, a defer that invoked one, a null allocator, and free-all on something with no region. Under a merged flan dev the compiler is in that process, so a program that named a restart nobody established took the session down with it, which is the one thing the break loop exists to prevent. They park now. Not through flan_break_hook, which is what bounds and arithmetic use: that hook may answer by aiming a transfer channel, and these six are called by emitted code that falls off the end with no channel anywhere in the call, so a restart chosen against one would be accepted and dropped. flan_trap_hook says the other thing instead — stop here, let everything be read, and refuse the resume with a reason. All six park, for two reasons rather than one. Four are guards that fire before the operation they guard, so nothing is half done and the frame reads like any other. The other two fire mid-transfer, with the frame's defers possibly half run, and they park only to be looked at: stopping on a torn unwind is strictly more than exiting before anyone can ask what tore it. The break loop grew a per-snapshot resumable flag for it. Restarts are still listed and still numbered, the terminal marks them untakeable and the socket reports the same positions as unreachable, and the listener refuses a choice with the trap's own sentence rather than the thunk-boundary one. Standalone builds die exactly as they did: nothing installs the hook in a program that did not import the agent, and the acceptance case for free-all still wants exit 134 and the same message. The review entry that asked for this named flan_exit_hook, which is normal termination and not this at all; it is struck out with the correction.
19 lines
804 B
Plaintext
19 lines
804 B
Plaintext
;;;; The same claim as dev-trap-free-all.flan over the other allocator trap,
|
|
;;;; and with nothing on the restart stack.
|
|
;;;;
|
|
;;;; `nowhere` is a zeroed `Allocator` — a `defvar` nobody assigned — and
|
|
;;;; `free-all` on it is the "I released the region" / "I never made one"
|
|
;;;; collapse the runtime refuses to let a program spell the same way. The
|
|
;;;; refusal is a trap with no transfer channel, so it parks rather than
|
|
;;;; resumes, and here there is not even a restart to list: the break loop says
|
|
;;;; so and stands still, which is the whole difference between a session you
|
|
;;;; can fix the program in and a daemon that is gone.
|
|
(import agent "vendor:agent")
|
|
|
|
(defvar nowhere Allocator)
|
|
|
|
(defn main [] i32
|
|
(agent/start "/tmp/flan-dev-trap-null-alloc-fallback.sock")
|
|
(free-all nowhere)
|
|
0)
|