]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
scheduler: fix SMP waitpid reap race and harden socket file init
authorTulio A M Mendes <[email protected]>
Tue, 9 Jun 2026 06:19:17 +0000 (03:19 -0300)
committerTulio A M Mendes <[email protected]>
Tue, 9 Jun 2026 06:19:17 +0000 (03:19 -0300)
commit995fc6470d7e398f74a95f94900ad9870975bc56
tree320bcba91ac32d714cb9f2414a3bdae188bacc4d
parent053e66f888241c9171bd6259f926aa3a16a478f0
scheduler: fix SMP waitpid reap race and harden socket file init

Prevent process_waitpid() from reaping a zombie child while it is still the current process on another CPU. This avoids freeing a live process struct and kernel stack during the exit-to-schedule handoff under SMP, which matched the intermittent invalid-opcode panic seen after the job-control path in fulltest.

Also zero-initialize struct file allocations in the socket() and accept() paths so mount_root and any future fields cannot inherit heap garbage.

Validation: make -j$(nproc), make test-host, make test SMOKE_SMP=4, make test-battery (153/153 PASS).
src/kernel/scheduler.c
src/kernel/syscall.c