fix(scheduler): stop sim threads before releasing trace settings on quit (bug-1925)

repl_cmd_quit() (quit and EOF) released the trace settings while the
picker and allocator threads could still run; at a mid-session
breakpoint the allocator reads core->trace_ctl unlocked on every job
pop, a possible use-after-free just before exit. quit now cancels and
joins both threads first, as sched_sim_driver_run() does on return.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Rongsong Shen 2026-10-08 15:44:53 +00:00
parent a1cb9cba4b
commit fcca4c9cfa
Signed by untrusted user: rshen
GPG key ID: 80533536B0EB651C
3 changed files with 109 additions and 6 deletions

View file

@ -2863,6 +2863,9 @@ sched_repl_trace_wiring_test = executable(
sched_repl_trace_wiring_test_srcs,
include_directories:[incdir],
dependencies: [scheduler_deps, unity_dep],
# bug-1925: the wrap checks the quit/EOF path stops the picker and
# allocator threads before it releases the trace settings.
link_args: ['-Wl,--wrap=repl_trace_shutdown'],
install: false)
test('scheduler repl trace wiring test',