Skip to content

Multiprocessing resource tracker incorrectly checks pipe write length #96819

@grgsrs

Description

@grgsrs

I think this line should be:

if len(msg) > 512:

Activity

saito828koki

saito828koki commented on Sep 17, 2022

@saito828koki
Contributor

@grgsrs
Thanks for your report!

Your suggestion seems to be correct. To guarantee that a write operation is atomic, the length of msg has to be less than or equal to PIPE_BUF(the kernel pipe buffer size).
According to this page, the minimum acceptable value of PIPE_BUF is set to 512 bytes in POSIX system , so checking if len(msg) is not greater than 512 is enough.

I will create a PR for this issue.

grgsrs

grgsrs commented on Sep 17, 2022

@grgsrs
Author
added a commit that references this issue on Oct 3, 2022
19ca114
added a commit that references this issue on Oct 3, 2022
added 3 commits that reference this issue on Oct 3, 2022
added a commit that references this issue on Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ronaldoussoren@JelleZijlstra@grgsrs@saito828koki

        Issue actions

          Multiprocessing resource tracker incorrectly checks pipe write length · Issue #96819 · python/cpython