
louise
Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.
Dernier runRéussi#1199 · main · 10 min 33 s
1Étoiles
0Forks
0Issues
Codegen: a CPR worker's call consumes its arguments when unwinding (#477)
`let_n` emitted a CPR worker's call (`let (a, b) = f$wrk(x)`) without
taking its owned arguments out of the references the frame holds, as
`let_` does for every other call. Every yield check from that call on
dropped `x` again when the frame unwound (a `final ctl`, a cancelled
body, a kill), though the worker had consumed it. The second drop of a
freed block wrote into mimalloc's free list, and the corruption showed
when the scheduler threads walked their heaps at exit: a SIGSEGV in
`_mi_thread_done` -> `_mi_page_free_collect`, or a hang in
`mi_process_done`. A program's exit stops every actor where it is, so
an actor handling a message unwound there: toki2's job runner tests,
stopping the in-process job store after `job_table.enqueued$wrk`.
Measured on toki2 3075488's runner tests, same runtime, only the C's
unwinding lists differing: 108 crashes in 6,000 runs before (five
tests at 2, 4 and 8 threads), none after; 88 in 2,400 runs with 8 loops
in parallel before, none after.
Tests: the C of a worker's caller (louise_codegen_c/tests/cpr_unwinding),
tests/run/cpr_unwinding.lse (a use after free under ASan before), and
tests/stress/exit_while_stopping.lse, also run 100 times natively by
crates/louise/tests/exit_while_stopping.rs.
`louise test --native` kept nothing of a crashed test but "the test
process failed": it now shows the test's stderr (the runtime's panic
report excepted, which the verdict carries) and names the signal that
killed it ("killed by signal 11 (SIGSEGV)"), or its exit status.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>Parents 0ed2e0e
8 fichiers modifiés, 503 ajouts, 9 suppressions
crates/louise/src/test.rs+79−9crates/louise/tests/exit_while_stopping.rs+64−0crates/louise/tests/native_test_crash.rs+102−0crates/louise_codegen_c/src/emit/mod.rs+8−0crates/louise_codegen_c/tests/cpr_unwinding.rs+99−0docs/adr/0043-a-core-optimiser.md+8−0tests/run/cpr_unwinding.lse+74−0tests/stress/exit_while_stopping.lse+69−0