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

sendMsg is likely not GC-safe and may crash #450

Closed
vdukhovni opened this issue May 13, 2020 · 4 comments
Closed

sendMsg is likely not GC-safe and may crash #450

vdukhovni opened this issue May 13, 2020 · 4 comments
Assignees

Comments

@vdukhovni
Copy link

The sendMsg implementation is likely not GC-safe. It uses pointer values outside withForeignPtr. The underlying ByteStrings that own the pointers may be deallocated before the pointers are used.

I think it is necessary to retain and touch# all the foreign pointers of each ByteString. Similar issues may be present in some of the other new functions.

@vdukhovni
Copy link
Author

For example the [Cmsg] argument of recvMsg is likely also used in an unsafe way.

@vdukhovni
Copy link
Author

Also withIOVecfromBS, which is then used in sendMany... The issue (if I'm not mistaken) is pervasive.

@kazu-yamamoto
Copy link
Collaborator

Nice catch!

@vdukhovni Would you review #451?

@kazu-yamamoto
Copy link
Collaborator

Closing via #451.

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

No branches or pull requests

2 participants