libkernel: sigwaitinfo and sigtimedwait report si_code 0 for every signal; FreeBSD 11.4 reports the sender #8496
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-20T13:51:35Z.
Repro
Block SIGINT, send it with
kill(getpid(), SIGINT),raise(SIGINT)orpthread_kill(thread, SIGINT), thensigwaitinfo(&set, &info):info.si_codeis 0 each time. The same for SIGALRM fromalarm/setitimer.Expected (FreeBSD 11.4):
killqueues the signal withSI_USER0x10001 (sys/kern/kern_sig.c:1788),thr_kill, whichraiseandpthread_killuse, withSI_LWP0x10007 (kern_thr.c:401; raise.c:52), and the interval timer expiry withSI_KERNEL0x10006 and pid 0 (kern_time.c:899, kern_sig.c:2087); constants in sys/sys/signal.h:400-409.Actual:
FillSiginfo(libkernelSystem/src/Signals.cpp) writesGuestSiuser = 0and the pending set keeps no sender.Test:
core/libs/tests/GuestSigtimedwait.cpp(changed expectations and new cases;guest_sigtimedwaitexits with 0xc0000409 before the fix).Fix branch: https://github.com/xXPBSXx/AnyPS5/tree/fix/siginfo-sender-code
AI-assisted (Claude Code).