fix(scheduler): a batch replay exits 0 under LeakSanitizer (bug-1884, part 6)
- kill_sched_resval() (every resource-value array's item killer) frees the value, not only a string's buffer: each replaced or torn-down value leaked its struct, including every WORKERS_PUSH value update. - put_resvals() shares the value it creates with later entries for the same index in one call; it created a second one that replaced (and now freed) the first while still writing through it. - JOB_UPDATE and the duplicate-JOBS_PUSH path kill_resreq() the old parsed resreq, and free the rejected job's schedobj (xce_core_free_schedobj(), exported from core.c), instead of freeing only the containers. - The previous attempt's (or ALTER alternative's) pend reason is freed when a new one replaces it. - kill_resreq_ctx() frees the parser context's error message, and the primary-resreq PEG action frees an earlier primary's message first. - write_snapshot_entry() frees the snapshot it builds (config and resource objects detached, they are the core's); the save side strdup()s its strings so the generated free_SnapshotData() applies. Test: test_cli_batch_replay_exits_clean_under_leak_detection (test_sim_discrete_clock.c) runs the real binary on a two-session fixture with detect_leaks=1 and requires exit 0: RED before (exit 1), GREEN now. All nine HA-soak recordings replay with exit 0 and no LeakSanitizer report. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
f6cab0ab87
commit
90b99d91e9
12 changed files with 107 additions and 14 deletions
|
|
@ -505,6 +505,9 @@ void kill_resreq_ctx(resreq_context_t* ctx)
|
|||
if (ctx == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* bug-1884: a primary's parse error lands here (xce_resreq.peg) */
|
||||
FREEUP(ctx->errmsg);
|
||||
}
|
||||
|
||||
int parse_resreq(xce_resreq_t* resreq, char* data, var resmgr, char** errmsg)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue