sched_sim_driver_run() started the picker and allocator threads on &sim->core and returned with them still running; only sched_sim_driver_fini() stopped them, and 24 test files (35 call sites) run the driver on a stack-local sim without calling it. The leftover threads kept a pointer into the dead frame, and ASAN occasionally caught one reading it (stack-use-after-return in cbuf_get) in sched_sim_verify_test and sched_sim_record_output_test. sched_sim_driver_run() now wraps the loop and stops both threads on every return (new sched_sim_driver_stop_threads(), shared with fini). If the allocator fails to start, the running picker is stopped too. The stop no longer pushes a jobid 0 to wake the allocator: cbuf_get/put wait in pthread_cond_wait, a cancellation point, and the fake end-of-session was visible to the allocator. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| autoscaler | ||
| configs | ||
| controller | ||
| docs | ||
| frontend | ||
| harness | ||
| include | ||
| lib | ||
| nixSupport | ||
| scheduler | ||
| schema | ||
| tools | ||
| worker | ||
| xceadmin | ||
| flake.lock | ||
| flake.nix | ||
| meson.build | ||
| meson.options | ||