Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue37811

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:[FreeBSD, OSX] Socket module: incorrect usage of poll(2)
Type:Stage:resolved
Components:FreeBSD, IO, Library (Lib), macOSVersions:Python 3.9, Python 3.8, Python 3.7
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: akhramov, koobs, miss-islington, ned.deily, ronaldoussoren, shihai1991, vstinner
Priority:normalKeywords:patch

Created on2019-08-10 20:29 byakhramov, last changed2022-04-11 14:59 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
connect_eintr.pyakhramov,2019-08-10 20:29Repro
Pull Requests
URLStatusLinkedEdit
PR 15202mergedakhramov,2019-08-10 20:32
PR 15289mergedmiss-islington,2019-08-14 21:22
PR 15290mergedmiss-islington,2019-08-14 21:22
Messages (8)
msg349356 -(view)Author: Artem Khramov (akhramov)*Date: 2019-08-10 20:29
FreeBSD implementation of poll(2) restricts timeout argument to be either zero, or positive, or equal to INFTIM (-1).Unless otherwise overridden, socket timeout defaults to -1. This value is then converted to milliseconds (-1000) and used as argument to the poll syscall.poll returns EINVAL (22), and the connection fails.I have discovered this bug during the EINTR handling testing, and have naturally found a repro code inhttps://bugs.python.org/issue23618 (see connect_eintr.py, attached). On GNU/Linux, the example runs as expected.
msg349382 -(view)Author: Hai Shi (shihai1991)*(Python triager)Date: 2019-08-11 09:42
I found an OS distinguishing behavior inhttps://github.com/python/cpython/blob/master/Modules/selectmodule.c#L603-L612
msg349383 -(view)Author: Kubilay Kocak (koobs)(Python triager)Date: 2019-08-11 09:47
See Also:#31334
msg349753 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2019-08-14 21:18
> See Also:#31334Oh, I didn't knowbpo-31334. This issue is basically a duplicate ofbpo-31334, but triggered differently.
msg349754 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2019-08-14 21:21
New changeset28146206578ebe1b84b48e6f255738a227058c04 by Victor Stinner (Artem Khramov) in branch 'master':bpo-37811: FreeBSD, OSX: fix poll(2) usage in sockets module (GH-15202)https://github.com/python/cpython/commit/28146206578ebe1b84b48e6f255738a227058c04
msg349760 -(view)Author: miss-islington (miss-islington)Date: 2019-08-14 21:47
New changeset123f6c4914827c4ced65d032fab74de62db31cd6 by Miss Islington (bot) in branch '3.8':bpo-37811: FreeBSD, OSX: fix poll(2) usage in sockets module (GH-15202)https://github.com/python/cpython/commit/123f6c4914827c4ced65d032fab74de62db31cd6
msg349761 -(view)Author: miss-islington (miss-islington)Date: 2019-08-14 21:48
New changesetb0b178a2b80974da910ce6a344d66cc4d9a2fcfa by Miss Islington (bot) in branch '3.7':bpo-37811: FreeBSD, OSX: fix poll(2) usage in sockets module (GH-15202)https://github.com/python/cpython/commit/b0b178a2b80974da910ce6a344d66cc4d9a2fcfa
msg349772 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2019-08-14 22:38
Thanks Artem Khramov for the nice analysis of the root issue! And thanks for the fix! The bug is now fixed in 3.7, 3.8 and master branches.Python 2.7 is not affected: I added sock_call_ex() helper function in Python 3 when I implemeneted thePEP 475 (Retry system calls failing with EINTR).
History
DateUserActionArgs
2022-04-11 14:59:18adminsetgithub: 81992
2019-08-14 22:38:37vstinnersetstatus: open -> closed
versions: - Python 2.7, Python 3.5, Python 3.6
messages: +msg349772

resolution: fixed
stage: patch review -> resolved
2019-08-14 21:48:07miss-islingtonsetmessages: +msg349761
2019-08-14 21:47:49miss-islingtonsetnosy: +miss-islington
messages: +msg349760
2019-08-14 21:22:21miss-islingtonsetpull_requests: +pull_request15014
2019-08-14 21:22:15miss-islingtonsetpull_requests: +pull_request15013
2019-08-14 21:21:52vstinnersetmessages: +msg349754
2019-08-14 21:18:25vstinnersetnosy: +vstinner
messages: +msg349753
2019-08-14 03:22:20akhramovsetnosy: +ned.deily,ronaldoussoren
components: + Library (Lib), macOS, IO, FreeBSD
2019-08-11 09:47:38koobssetmessages: +msg349383
2019-08-11 09:43:58koobssetnosy: +koobs
2019-08-11 09:42:12shihai1991setnosy: +shihai1991
messages: +msg349382
2019-08-10 20:32:19akhramovsetkeywords: +patch
stage: patch review
pull_requests: +pull_request14931
2019-08-10 20:29:31akhramovcreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp