You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
viewer: socket identity check misses a replaced socket on ext4 #404
Found in the release dry run 40748393366 for PR #400. The Lab gates failed in packages/cli/test/native-viewer.test.ts > "refuses dead readiness whose socket was replaced": stopNativeViewerHost resolved instead of throwing "Unsafe stale viewer socket".
removeDeadReadiness in packages/desktop-linux/src/viewer-host.ts and removeNativeReadiness in packages/desktop-linux/src/viewer-state.ts decide that host.sock is the recorded socket when its ino and dev match host.json. ext4 gives a freed inode number to the next file created in the same directory. A socket replaced at host.sock therefore usually keeps the recorded ino and dev. On an ext4 loop mount, a new socket at the same path reused the inode in 50 of 50 tries. tmpfs and btrfs did not reuse it. GitHub runners keep /tmp on ext4, so the test fails there whenever no other file takes the inode first.
Impact: stop or prune can unlink a socket that another process of the same user created at host.sock after the host died. The path is inside Pickforge's private viewer directory and the check runs under the session lock, so the impact is low.
Record and compare a socket identity that a replacement cannot share, such as the ctime in nanoseconds from a bigint lstat
Make the test replace the socket on any filesystem and expect the refusal again
PR #400 changes the test to record a socket identity that cannot match, so it checks the refusal itself until this is fixed.
The same ino and dev pair also decides whether a request may use host.sock, in packages/desktop-linux/src/viewer-host.ts:49. A fix should cover that check too.
Activity
ElbertePlinio commentedon Oct 28, 2026
The same
inoanddevpair also decides whether a request may usehost.sock, inpackages/desktop-linux/src/viewer-host.ts:49. A fix should cover that check too.test: record a socket identity a replaced socket cannot share