Repository navigation
Conversation
Contributor
|
there is a conflict now |
Contributor
Author
|
Thanks, Dulma. I merged main and resolved the conflict with #2302 in PulseModelsJava.ml; the test expectations now include both. Should be good to import. |
Contributor
|
Sorry it says there are still conflicts |
ServerSocket.accept was Basic.skip, so the Socket it returns was never tracked. Closing the listener and leaving the accepted socket open was not reported. Model accept with Resource.allocate_returned so the returned Socket is an IOException-throwing java.net.Socket resource. The listener stays tracked.
tanvir-ux
force-pushed
the
cursor/serversocket-accept-resource-71c2
branch
from
November 12, 2026 12:58
8f5a6a9 to
ec09ee0
Compare
Contributor
Author
|
Sorry about that, Dulma. I've rebased the branch onto the latest main as a single commit with no merge commit, so it should import cleanly now. |
This branch has not been deployed
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.
ServerSocket.acceptwas modeled asBasic.skip, so Pulse never tracked theSocketit returns. Closing the listener while leaving the accepted socket open was not reported.This models
acceptwithResource.allocate_returned(java.net.Socket, throwsjava.io.IOException), the same pattern as the other factories that return a fresh resource.getInputStreamandgetOutputStreamare unchanged.Notes:
acceptcan now throw,serverSocketNotClosedAfterAcceptBadandFN_serverSocketNotClosedBadreport the listener on the exceptional path.serverSocketWithSocketClosedOk, a throwingPrintWriter.close()skippedsocket.close()in the samefinally; the socket close is now in a nestedfinally, and the test stays clean.allocated by constructor java.net.Socket(), which is howallocate_returnedrecords the resource class.Test plan:
serverSocketAcceptNotClosedBadwas not reported.PULSE_RESOURCE_LEAKforjava.net.Socket;serverSocketAcceptClosedOk,serverSocketAcceptTryWithResourcesOk,serverSocketClosedOk,serverSocketClosedAfterAcceptOkandserverSocketWithSocketClosedOkare clean.make -C infer/tests/codetoanalyze/java/pulse testpasses;ocamlformat0.29.0 clean.