myxce/src/lib
Rongsong Shen f9146864a3
fix(lib,scheduler): allocation constructors and allocators report OOM instead of building NULL-name records (bug-1882)
make_alloc() and make_host_alloc() assigned strdup() results unchecked,
so under memory exhaustion they returned a record whose resname/reserve/
host was NULL; merge_job_alloc()'s same_alloc_slot() (bug-1863) then
strcmp()'d it (ASAN SEGV at xcealloc.c:337). make_alloc() also passed a
NULL resname straight to strdup().
- xcealloc.c: make_alloc()/make_host_alloc() reject a NULL name (EINVAL)
  and check every strdup(), freeing what they built and returning NULL
  (ENOMEM); on failure make_host_alloc()'s caller keeps `allocs`.
  dup_host_alloc() frees its partial copy on failure instead of leaking.
- scheduler.c sched_make_allocs(): a record that cannot be built fails
  the whole array (NULL, ENOMEM) instead of leaving a NULL entry.
- seqjob/parjob my_alloc(): check every constructor; on failure free
  what was built (parjob also rolls back the remaining claims) and
  return -ENOMEM with ctx->alloc NULL -- the caller moves ctx.alloc onto
  the job whatever the rc.

Tests: new xcealloc_oom_test (8, --wrap=strdup) and
sched_make_allocs_oom_test (real scheduler_srcs + --wrap=strdup); a new
-ENOMEM test in the seqjob and parjob allocator suites. All RED before
(SEGV / "Expected NULL" / "Expected -12 Was 1"), GREEN after.
xce-build.sh all asan: 115/115 suites OK, Go tests OK.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-28 08:49:51 +00:00
..
raft fix(ha): bug-1421 close term-desync AE-reject blindspot in HA election 2026-07-09 11:56:46 +00:00
testsuite fix(lib,scheduler): allocation constructors and allocators report OOM instead of building NULL-name records (bug-1882) 2026-09-28 08:49:51 +00:00
bitset.c - introduce bitset 2026-02-13 11:01:33 +08:00
CLAUDE.md update documents 2026-08-10 17:51:51 +08:00
client.c feat: acknowledged job start/finish/fail reports (bug-1741) 2026-09-27 06:47:47 +00:00
client_failover.c fix(lib): retry a NOT_READY controller in place instead of failing over (bug-1850) 2026-09-25 15:04:47 +00:00
client_internal.h fix(libxce): bug-1425 -- populate jobsubmit's *jobid on idempotent-replay success 2026-08-16 10:47:09 +00:00
cluster.c feat(component-failover-adoption): add candidate-list-to-client-config helper 2026-08-11 04:57:31 +00:00
configobj.c save works 2026-03-04 18:18:53 +08:00
dataq.c fix(lib): keep per-endpoint message order in the vtask dispatcher (bug-1864) 2026-09-25 14:44:14 +00:00
delay.c fix(lib): normalize delaymgr to one CLOCK_MONOTONIC ms timescale, fixing seconds-task starvation 2026-07-02 03:40:08 +00:00
group.c fix(scheduler): fix limit-plugin usergroup/scope/error-code cascade (gitea#46) 2026-09-07 12:44:16 +00:00
helper.c fix(lib): name the newer opcodes in xce_request_op_name 2026-09-27 07:01:38 +00:00
hook.c fix bug-1060 bug-1067 2026-06-24 17:05:43 +08:00
htab.c docs: mark Phase 6 complete in phase6-scheduler-integration-plan 2026-04-30 07:17:32 +00:00
idgen.c jobid generate 2025-11-07 18:17:34 +08:00
jobj.c fix(controller): job_ctrl lock/reference and dispatch retry requeue (bug-448, bug-1626, bug-1631) 2026-09-27 03:05:20 +00:00
kv.c feat: implement kvmgr_capture_keys for lock-free checkpoint serialization (P0-14a) 2026-05-07 11:07:41 +00:00
kvmgr.c fix(job-array-single-wal-record): close bug-1443's bulk-insert partial-visibility gap 2026-07-16 15:08:02 +00:00
meson.build fix(lib,scheduler): allocation constructors and allocators report OOM instead of building NULL-name records (bug-1882) 2026-09-28 08:49:51 +00:00
misc.c fix(lib): free host_account.host and job_account test fixtures (bug-1723, bug-1621) 2026-09-08 09:16:20 +00:00
mylock.c fix(lib): stop cbuf_put/get orphaning their mutex on cancellation, hanging vtaskmgr_fini 2026-09-15 04:13:53 +00:00
netio.c fix(netio): bug-1447 same-batch endpoint use-after-free in io_worker dispatch 2026-07-18 13:28:04 +00:00
ordq.c pass pend reason back to controller 2025-12-23 15:29:26 +08:00
preason.c support limit 2026-01-12 15:27:54 +08:00
qobj.c save works 2026-03-05 16:03:37 +08:00
request.c feat: acknowledged job start/finish/fail reports (bug-1741) 2026-09-27 06:47:47 +00:00
resobj.c fix(scheduler): re-pushed resource definitions are not errors (bug-1854) 2026-09-25 15:09:49 +00:00
resreq.c fix(apiserver): reject a malformed rusage[] at job submit (bug-1744) 2026-09-27 03:27:32 +00:00
rusage.peg fix typo of perflag && reformat .peg 2026-02-09 10:58:30 +08:00
section.peg docs: mark Phase 6 complete in phase6-scheduler-integration-plan 2026-04-30 07:17:32 +00:00
threshold.c reformat code and job array 2025-11-07 16:14:27 +08:00
utils.c feat(scheduler-sim-diagnostics): promote byte-unit formatting to shared lib (task 7) 2026-09-20 04:40:44 +00:00
vtaskmgr.c fix(lib): keep per-endpoint message order in the vtask dispatcher (bug-1864) 2026-09-25 14:44:14 +00:00
window.c reformat code and job array 2025-11-07 16:14:27 +08:00
wobj.c fix(controller): string resvals own their bytes -- rejoin use-after-free killed new primary (bug-1851) 2026-09-24 08:41:55 +00:00
wrap.c reformat code and job array 2025-11-07 16:14:27 +08:00
xce_resreq.peg docs: mark Phase 6 complete in phase6-scheduler-integration-plan 2026-04-30 07:17:32 +00:00
xce_select.c fix: sel_key_cmp_fn padding-byte mismatch in kvtab lookups 2026-05-12 09:53:59 +00:00
xce_select.peg docs: mark Phase 6 complete in phase6-scheduler-integration-plan 2026-04-30 07:17:32 +00:00
xcealloc.c fix(lib,scheduler): allocation constructors and allocators report OOM instead of building NULL-name records (bug-1882) 2026-09-28 08:49:51 +00:00
xceapi.c feat: acknowledged job start/finish/fail reports (bug-1741) 2026-09-27 06:47:47 +00:00
xcectx.c fix(component-failover-adoption): Phase 6 -- close apiserver's idle-period rejoin gap (bug-1548/bug-1549) 2026-08-16 03:42:03 +00:00
xcelimit.c fix(scheduler): percent-limit capacity reads maxmem/maxswap, not mem/swap (bug-1834) 2026-09-20 13:18:05 +00:00
xcelist.c remove extralib 2026-09-04 11:24:43 +08:00
xlist.c fix(lib): zarray_fini/xlist_fini must reset caps/count, not just free data 2026-09-16 02:31:53 +00:00
xstring.c docs: mark Phase 6 complete in phase6-scheduler-integration-plan 2026-04-30 07:17:32 +00:00
xvec.c using xvec related api in scheduler 2026-01-16 18:21:37 +08:00
zarray.c fix(lib): zarray_fini/xlist_fini must reset caps/count, not just free data 2026-09-16 02:31:53 +00:00