bsdsocket: drain parked closes past transient holds (#53) - #88
Merged
Merged
Conversation
bsd_close_all() drained only at sb_StackRefs <= 1, so an async AddressAllocation's transient hold kept the last opener from draining, and the worker's release tore the stack down with closing sockets still created. The gate now discounts transient refs, shared with the handoff flush as bsd_stack_last_opener(). ami_ns_destroy() discarded nx_ip_delete()'s NX_SOCKETS_BOUND and freed the stack block under a live IP thread; it now retains it. Tests: expunge_refusal(_cork) t_transient_last_opener_drains, expunge_joint t_bound_socket_keeps_ip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #70
Steps 2 and 3 of #70: the scanner is a CI gate, and the remaining test sites are fixed.
Gate.
tools/check-lvo-clobbers.shrunstools/check-lvo-clobbers.pyover src/ and tests/. It flags every extended asm statement that calls through a6 and does not list d0, d1, a0 and a1 as outputs or clobbers. It reads register declarations through object-like macros (BSD_SCRATCH,NETDEV_REG_A1) from the file and from its"..."includes, and it skips top-level asm. Output is key=value, and the exit code is 1 on any flagged site. The gate runs instage_hostnext tocheck-lvo-matrix.sh, is registered incheck-gates-wired.sh, and is on the shellcheck list.Validation
src/tools/toolsock.calonetests/sockopt/sockopt_test.c:332(pre-sockopt_test: the recvfrom helper declares a1 clobbered #68) is flaggedmissing=a1.BSD_SCRATCHmacro sites in ipv6_socket_test, sockopt_test and udpdrillTH()macro, which lists all eight registersFixes (14 test sites). A missing register that is also an input becomes an output: a dummy
"=r", or"+r"as in #71. A missing register that is not an input becomes a clobber.Repro:
tools/check-lvo-clobbers.sh; echo $?🤖 Generated with Claude Code