Skip to content

fix: roost panics on musl (noq-udp SCM_TIMESTAMPNS) - #16

Merged
dignifiedquire merged 2 commits into
mainfrom
fix/roost-panic-musl
Aug 3, 2026
Merged

fix: roost panics on musl (noq-udp SCM_TIMESTAMPNS)#16
dignifiedquire merged 2 commits into
mainfrom
fix/roost-panic-musl

Conversation

@dignifiedquire

@dignifiedquire dignifiedquire commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Fixes #15.

The test treated "Connection closed" in ssh's output as reaching the
authentication stage. That string is exactly what ssh prints when the
`fly` proxy command dies, so a panic in roost or fly produced a green
run. A second fallback counted ssh's exit code 255 as success, which is
ssh's generic connection-failure code.

Both masked a real crash: every musl job since 0.2.0 aborted with
`assertion failed: align_of::<T>() <= align_of::<C>()` in noq-udp and
still reported SUCCESS.

Require the run to reach publickey/password rejection, which only
happens once the tunnel has carried the SSH handshake end to end, and
fail outright on a panic in either process or on a roost that is no
longer alive after the connection attempt. Windows had the same two
holes and gets the same treatment.
noq-udp 1.1.0 enables SO_TIMESTAMPNS unconditionally on Linux, so the
kernel attaches an SCM_TIMESTAMPNS control message to every packet we
receive. Decoding it asserts align_of::<timespec>() <= align_of::<cmsghdr>().
musl's cmsghdr is socklen_t + padding + two c_int, so it aligns to 4 while
timespec aligns to 8, and the first inbound packet aborts the process.
glibc's cmsg_len is a size_t, so the assert holds there.

Our Linux release artifacts are musl on both arches, which is why this
reproduced everywhere in #15 and never on macOS or Windows.

noq-udp 1.1.1 disables the socket option (n0-computer/noq#774) and
changes nothing else.
@dignifiedquire
dignifiedquire marked this pull request as ready for review August 3, 2026 10:16
@dignifiedquire
dignifiedquire merged commit 373f626 into main Aug 3, 2026
24 checks passed
@dignifiedquire
dignifiedquire deleted the fix/roost-panic-musl branch August 3, 2026 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pigeons roost always panics

2 participants