Skip to content

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

Description

@vdukhovni

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.

Activity

  1. vdukhovni commented on May 13, 2020

    @vdukhovni
    Author

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

  2. vdukhovni commented on May 13, 2020

    @vdukhovni
    Author

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

  3. kazu-yamamoto commented on May 14, 2020

    @kazu-yamamoto
    Collaborator

    Nice catch!

    @vdukhovni Would you review #451?

  4. kazu-yamamoto commented on May 15, 2020

    @kazu-yamamoto
    Collaborator

    Closing via #451.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions