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

bpo-34521: Fix tests in test_multiprocessing_spawn to use correctly CMSG_SPACE #9613

Merged
merged 1 commit into from
Sep 28, 2018

Conversation

pablogsal
Copy link
Member

@pablogsal pablogsal commented Sep 28, 2018

After some failures in AMD64 FreeBSD CURRENT Debug 3.x buildbots
regarding tests in test_multiprocessing_spawn and after examining
similar failures in test_socket, some errors in the calculation of
ancillary data buffers were found in multiprocessing.reduction.

CMSG_LEN() can often be used as the buffer size for recvmsg() to
receive a single item of ancillary data, but RFC 3542 requires portable
applications to use CMSG_SPACE() and thus include space for padding,
even when the item will be the last in the buffer.

The failures we experience are due to the usage of CMSG_LEN instead of
CMSG_SPACE.

https://bugs.python.org/issue34521

…MSG_SPACE

After some failures in AMD64 FreeBSD CURRENT Debug 3.x buildbots
regarding tests in test_multiprocessing_spawn and after examining
similar failures in test_socket, some errors in the calculation of
ancillary data buffers were found in multiprocessing.reduction.

CMSG_LEN() can often be used as the buffer size for recvmsg() to
receive a single item of ancillary data, but RFC 3542 requires portable
applications to use CMSG_SPACE() and thus include space for padding,
even when the item will be the last in the buffer.

The failures we experience are due to the usage of CMSG_LEN instead of
CMSG_SPACE.
@pablogsal
Copy link
Member Author

Tested on the buildbot itself:

CURRENT-amd64% uname -a
FreeBSD CURRENT-amd64 12.0-ALPHA6 FreeBSD 12.0-ALPHA6  r338678  amd64
CURRENT-amd64% ./python -m test test_multiprocessing_spawn

Run tests sequentially
0:00:00 load avg: 0.17 [1/1] test_multiprocessing_spawn
test_multiprocessing_spawn passed in 3 min 24 sec

== Tests result: SUCCESS ==

1 test OK.

Total duration: 3 min 24 sec
Tests result: SUCCESS

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Good job, I didn't know that there were two functions for the length!

cc @pitrou

@vstinner vstinner merged commit 077061a into python:master Sep 28, 2018
@vstinner
Copy link
Member

I will wait for the FreeBSD CURRENT buildbot to see if it fixes the issue. If yes, we can backport the change.

@miss-islington
Copy link
Contributor

Thanks @pablogsal for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Thanks @pablogsal for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 28, 2018
…MSG_SPACE (pythonGH-9613)

After some failures in AMD64 FreeBSD CURRENT Debug 3.x buildbots
regarding tests in test_multiprocessing_spawn and after examining
similar failures in test_socket, some errors in the calculation of
ancillary data buffers were found in multiprocessing.reduction.

CMSG_LEN() can often be used as the buffer size for recvmsg() to
receive a single item of ancillary data, but RFC 3542 requires portable
applications to use CMSG_SPACE() and thus include space for padding,
even when the item will be the last in the buffer.

The failures we experience are due to the usage of CMSG_LEN() instead of
CMSG_SPACE().
(cherry picked from commit 077061a)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
@bedevere-bot
Copy link

GH-9618 is a backport of this pull request to the 3.6 branch.

@bedevere-bot
Copy link

GH-9619 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 28, 2018
…MSG_SPACE (pythonGH-9613)

After some failures in AMD64 FreeBSD CURRENT Debug 3.x buildbots
regarding tests in test_multiprocessing_spawn and after examining
similar failures in test_socket, some errors in the calculation of
ancillary data buffers were found in multiprocessing.reduction.

CMSG_LEN() can often be used as the buffer size for recvmsg() to
receive a single item of ancillary data, but RFC 3542 requires portable
applications to use CMSG_SPACE() and thus include space for padding,
even when the item will be the last in the buffer.

The failures we experience are due to the usage of CMSG_LEN() instead of
CMSG_SPACE().
(cherry picked from commit 077061a)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
miss-islington added a commit that referenced this pull request Sep 28, 2018
…MSG_SPACE (GH-9613)

After some failures in AMD64 FreeBSD CURRENT Debug 3.x buildbots
regarding tests in test_multiprocessing_spawn and after examining
similar failures in test_socket, some errors in the calculation of
ancillary data buffers were found in multiprocessing.reduction.

CMSG_LEN() can often be used as the buffer size for recvmsg() to
receive a single item of ancillary data, but RFC 3542 requires portable
applications to use CMSG_SPACE() and thus include space for padding,
even when the item will be the last in the buffer.

The failures we experience are due to the usage of CMSG_LEN() instead of
CMSG_SPACE().
(cherry picked from commit 077061a)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
vstinner pushed a commit that referenced this pull request Sep 28, 2018
…MSG_SPACE (GH-9613) (GH-9619)

After some failures in AMD64 FreeBSD CURRENT Debug 3.x buildbots
regarding tests in test_multiprocessing_spawn and after examining
similar failures in test_socket, some errors in the calculation of
ancillary data buffers were found in multiprocessing.reduction.

CMSG_LEN() can often be used as the buffer size for recvmsg() to
receive a single item of ancillary data, but RFC 3542 requires portable
applications to use CMSG_SPACE() and thus include space for padding,
even when the item will be the last in the buffer.

The failures we experience are due to the usage of CMSG_LEN() instead of
CMSG_SPACE().
(cherry picked from commit 077061a)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
pablogsal added a commit that referenced this pull request Oct 14, 2018
* Add News entry for the change in multiprocessing.reduction.recvfds
made in GH-9613.
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 15, 2018
* Add News entry for the change in multiprocessing.reduction.recvfds
made in pythonGH-9613.
(cherry picked from commit bd036d3)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 15, 2018
* Add News entry for the change in multiprocessing.reduction.recvfds
made in pythonGH-9613.
(cherry picked from commit bd036d3)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
miss-islington added a commit that referenced this pull request Oct 15, 2018
* Add News entry for the change in multiprocessing.reduction.recvfds
made in GH-9613.
(cherry picked from commit bd036d3)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
miss-islington added a commit that referenced this pull request Oct 16, 2018
* Add News entry for the change in multiprocessing.reduction.recvfds
made in GH-9613.
(cherry picked from commit bd036d3)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
ned-deily pushed a commit to ned-deily/cpython that referenced this pull request Oct 20, 2018
* Add News entry for the change in multiprocessing.reduction.recvfds
made in pythonGH-9613.
(cherry picked from commit bd036d3)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
ned-deily pushed a commit to ned-deily/cpython that referenced this pull request Oct 20, 2018
* Add News entry for the change in multiprocessing.reduction.recvfds
made in pythonGH-9613.
(cherry picked from commit bd036d3)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
@pablogsal pablogsal deleted the bpo34521-2 branch May 19, 2021 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants