73 lines
3.9 KiB
Markdown
73 lines
3.9 KiB
Markdown
# Queue 46: invalid-group fixture shutdown race
|
|
|
|
Base `185b4a89`. This fixes a deterministically reproduced fixture race;
|
|
it does not claim attribution of Claude's original intermittent gate
|
|
failure without its original diagnostic. The queue/outbox only records
|
|
one failure followed by three standalone passes and a full rerun pass.
|
|
Parent's saved bank/binder gate also passed the target in 0.45 seconds.
|
|
Those successful results were reused, not rerun as exploratory stress tests.
|
|
|
|
## Bounded assessment
|
|
|
|
`listen()` binds port 0 on loopback, keeps both sockets open, and calls
|
|
listen before starting the peer thread or child. No fixed port or
|
|
close-and-rebind allocation race was found. `serve` owns the listener
|
|
contexts and joins after the child. The in-memory auth driver's subsequent
|
|
transport preparation is socket-free: opening a typed native transport
|
|
neither connects to nor authenticates the world endpoint. Thus a proposed
|
|
world-listener readiness delay would not repair the demonstrated failure.
|
|
|
|
The actual race is in the `wrong-group` negative case. The fixture sends a
|
|
119-byte challenge one byte at a time. The client consumes status/B/group
|
|
metadata and the 32-byte modulus (70 bytes total). In
|
|
`src/legacy_client.cpp` it rejects the incorrect modulus immediately,
|
|
before reading salt or security fields, and closes its socket. The fixture
|
|
continues sending the remaining 49 bytes. Depending on scheduling, it
|
|
finishes before the close or receives EPIPE. The existing exception policy
|
|
allows ConnectionResetError for this expected rejection, but BrokenPipeError
|
|
is a generic fixture failure even when the child correctly exits 1.
|
|
|
|
No production authentication or SRP correctness change is implicated by
|
|
this reproducer. Five-second socket deadlines, ten-second child timeout,
|
|
six-second join bound and thirty-second CTest timeout are unchanged.
|
|
|
|
## Deterministic reproduction and correction
|
|
|
|
`tests/loopback_rejection_schedule_test.py` wraps only the fixture's send
|
|
schedule. It sends the real invalid challenge through byte 70, then waits
|
|
for EOF from the real native driver. If the fixture attempts a trailer, it
|
|
sends one actual trailer byte and waits for real TCP POLLERR using the
|
|
existing socket deadline, before resuming bytewise sends. This forces the
|
|
actual peer-close-before-write ordering without sleeps, repeated attempts,
|
|
mock exceptions or synthetic socket faults.
|
|
|
|
Before the change it deterministically fails:
|
|
|
|
wrong-group: fixture failed: [BrokenPipeError(32, 'Broken pipe')]; child_returncode=1
|
|
|
|
The fix ends the deliberately invalid challenge at its rejection boundary
|
|
instead of sending a trailer the client must never consume. The existing
|
|
EOF assertion remains mandatory. A client that accepts the invalid group
|
|
and waits for the trailer times out and fails; this is not a truncated-input
|
|
shortcut that permits acceptance. No exception is newly ignored.
|
|
|
|
The regression is called from the existing --wire-memory-ipv4 fixture
|
|
entry point, so the already registered gate covers it with no CMake change.
|
|
The wrapper restores the original sender in finally, including on failure.
|
|
It is independently runnable for before/after evidence.
|
|
|
|
## Results and scope
|
|
|
|
The existing built native memory-auth driver was reused without a native
|
|
or codec build. The changed fixture passes all eight existing IPv4 cases
|
|
(success, multiple realms, bad M2, PIN, zero public value, wrong group,
|
|
proof rejection and challenge rejection), followed by the forced-order
|
|
wrong-group regression. Exact command, binary hash, before diagnostic and
|
|
after output are in host-validation.json. git diff --check passes.
|
|
|
|
Only the shared loopback fixture, its deterministic regression helper and
|
|
this evidence are changed. No client, external network, install, full gate,
|
|
retry policy, timeout increase, production wire code, or CMake mutation.
|
|
The missing historical failure remains a narrow attribution hold; if its
|
|
error differs, investigate that distinct failure using its own evidence.
|