chore(buglog): bug-1885..1889 fixed

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Rongsong Shen 2026-09-29 10:35:43 +00:00
parent 9c51de88c6
commit 7b001cb0f7
Signed by untrusted user: rshen
GPG key ID: 80533536B0EB651C
6 changed files with 214 additions and 36 deletions

View file

@ -1,8 +1,8 @@
---
id: "bug-1886"
status: "open"
status: "fixed"
status_updated: "2026-09-29"
status_note: "newly logged"
status_note: ""
component: "scheduler"
severity: "leak"
timestamp: "2026-09-29T09:48:47Z"
@ -11,6 +11,7 @@ occurrences: 1
files: ["src/scheduler/src/scheduler.c", "src/scheduler/src/core_events.c"]
tags: ["scheduler", "leak", "config"]
related: ["bug-1884"]
fix_commits: ["3e873f0a"]
---
# bug-1886: scheduler leaks the rejected queue on each config re-apply and the old config on each CONFIG_PUSH
@ -44,15 +45,15 @@ related: ["bug-1884"]
- Evidence: not kept; code reading plus the test_config_push_deferred UAF seen with a freeing killer
## Root cause
TODO: required for fixed/partial
`sched_init_queues()` built a new `xce_sched_queue_t` for every configured queue on each config apply; for an existing name `sched_add_queue()` failed and the unregistered queue was handed to the picker (which then tracked it instead of the registered one) and leaked, while the registered queue kept its old settings. `sched_init_config()` and the core's CONFIG_PUSH replaced `core->config` without freeing the previous one.
## Fix
TODO: required for fixed/partial
`sched_init_queues()` updates the registered queue in place (attrs, status, priority, accept_interval, sched_delay -- what make_sched_queue() copies), as QUEUE_UPDATE's core_upsert_queue() does; a replaced config is freed after the new one is applied -- nothing points into it (queues, resources, groups and limits built from it are copies) (3e873f0a).
## Verification
- Test: TODO: name + file; RED before the fix, GREEN after
- Suites: TODO: suite results and build profile
- Live: TODO: soak/deploy run, or n/a and why
- Test: test_config_reapply_updates_queue_in_place_and_frees_old in src/scheduler/testsuite/test_config_push_deferred.c (applies a one-queue config twice, priority 1 then 7): RED before (priority stayed 1), GREEN after (same queue object, priority 7, first config freed per ASAN)
- Suites: ASAN debug build (src/xce.build.discrete), `meson test --no-suite xceadmin`: 117/117 OK, 0 sanitizer reports; xcelib_test 695 tests 0 failures (2026-09-29)
- Live: 3-round sequential HA soak on rebuilt ASAN binaries (/home/claude/tmp/xce-bug1885-soak, 2026-09-29): PASS, 15 jobs, zero job loss, all 3 nodes led; SIMVERIFY 4 files 0 mismatches; each recording replays with detect_leaks=1 at exit 0, 0 mismatches; no sanitizer report in the scheduler or controller stderr
## References
- Related: bug-1884