kernel: do not release a waiter on a zero-count syncOnAddress wake (linux only) #168
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!168
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/168/head"
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?
@StefanosCosta on GitHub · 2026-08-04 21:02 UTC · original
StefanosCosta:fix/sync-on-address-zero-count-wake→main· +5 −0 · 1 files · 2 commits · merged 2026-08-08 06:17 UTCSummary
sceKernelSyncOnAddressWakewith a count of 0 behaves differently on Linux than on every otherhost.
WakePortableshort-circuitscount == 0and releases nobody;WakeLinuxpasses the countstraight to
FUTEX_WAKE, which does not treat 0 as "wake nobody" — measured directly,FUTEX_WAKEwith
val = 0returns 1 and releases a waiter.Wakeadmits 0 as valid (it rejects onlycount < 0), andSyncOnAddressTests::TestWakeZeroIsNoOpasserts that it releases no waiters, sothe Linux path contradicts both the portable backend and the test — which is red on
mainon Linux.What's included
Guest threading
WakeLinuxwhencount == 0instead of issuing the syscall — without it azero-count wake releases a waiter, which returns from
sceKernelSyncOnAddressWaitreportingsuccess while the watched word is unchanged. Confirmed against the raw syscall:
FUTEX_WAKEwith
val = 0returns 1.Platform impact
WakeLinux, inside#if KYTY_PLATFORM == KYTY_PLATFORM_LINUX && !defined(__APPLE__); Windows goes throughWakePortable, which already had this guard.uses
WakePortable.Testing
Built Release on Linux (Clang, Ninja).
SyncOnAddressTests::TestWakeZeroIsNoOpcovers exactlythis and fails on current
main: 10/10 runs abort on "zero-count wake releases no waiters". Withthe fix,
ctest -R sync_on_addresspasses 20/20 consecutive runs (36 checks).