Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent closing socket handle twice #1205

Merged

Conversation

tobil4sk
Copy link
Member

If the socket handle has been closed once, it no longer belongs to us and it is unsafe to close it again as it could have been assigned somewhere else in the program. On android for example, this is detected at runtime by fdsan and causes a hard crash.

We could also consider throwing an error on the second close, however, for now this is already a step forward.

If the socket handle has been closed once, it no longer belongs to us
and it is unsafe to close it again as it could have been assigned
somewhere else in the program. On android for example, this is detected
at runtime by fdsan and causes a hard crash.

We could also consider throwing an error on the second close, however,
for now this is already a step forward.
@tobil4sk tobil4sk force-pushed the fix/prevent-socket-double-close branch from d1e626b to 5828abd Compare March 21, 2025 13:50
@Simn Simn merged commit a1007b5 into HaxeFoundation:master Mar 21, 2025
120 checks passed
@tobil4sk tobil4sk deleted the fix/prevent-socket-double-close branch March 21, 2025 17:44
@skial skial mentioned this pull request Mar 24, 2025
1 task
charlesisfeline pushed a commit to charlesisfeline/hxcpp that referenced this pull request Mar 26, 2025
If the socket handle has been closed once, it no longer belongs to us
and it is unsafe to close it again as it could have been assigned
somewhere else in the program. On android for example, this is detected
at runtime by fdsan and causes a hard crash.

We could also consider throwing an error on the second close, however,
for now this is already a step forward.
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.

2 participants