tobogganSe connecter

louise

Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.

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>

olivier · il y a 6 j · 3d9dc5bc67fc59aca67050badc8cee37c570cb12

Parents 0ed2e0e

8 fichiers modifiés, 503 ajouts, 9 suppressions