[issue37811] [FreeBSD, OSX] Socket module: incorrect usage of poll(2)

2019-08-14 Thread STINNER Victor


STINNER Victor  added the comment:

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 the PEP 475 (Retry system calls failing with EINTR).

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions:  -Python 2.7, Python 3.5, Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37811] [FreeBSD, OSX] Socket module: incorrect usage of poll(2)

2019-08-14 Thread miss-islington


miss-islington  added the comment:


New changeset b0b178a2b80974da910ce6a344d66cc4d9a2fcfa 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


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37811] [FreeBSD, OSX] Socket module: incorrect usage of poll(2)

2019-08-14 Thread miss-islington


miss-islington  added the comment:


New changeset 123f6c4914827c4ced65d032fab74de62db31cd6 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


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37811] [FreeBSD, OSX] Socket module: incorrect usage of poll(2)

2019-08-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 28146206578ebe1b84b48e6f255738a227058c04 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


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37811] [FreeBSD, OSX] Socket module: incorrect usage of poll(2)

2019-08-14 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15014
pull_request: https://github.com/python/cpython/pull/15290

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37811] [FreeBSD, OSX] Socket module: incorrect usage of poll(2)

2019-08-14 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15013
pull_request: https://github.com/python/cpython/pull/15289

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37811] [FreeBSD, OSX] Socket module: incorrect usage of poll(2)

2019-08-14 Thread STINNER Victor


STINNER Victor  added the comment:

> See Also: #31334

Oh, I didn't know bpo-31334. This issue is basically a duplicate of bpo-31334, 
but triggered differently.

--
nosy: +vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37811] [FreeBSD, OSX] Socket module: incorrect usage of poll(2)

2019-08-13 Thread Artem Khramov


Change by Artem Khramov :


--
components: +FreeBSD, IO, Library (Lib), macOS
nosy: +ned.deily, ronaldoussoren

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37811] [FreeBSD, OSX] Socket module: incorrect usage of poll(2)

2019-08-11 Thread Kubilay Kocak


Kubilay Kocak  added the comment:

See Also: #31334

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37811] [FreeBSD, OSX] Socket module: incorrect usage of poll(2)

2019-08-11 Thread Kubilay Kocak


Change by Kubilay Kocak :


--
nosy: +koobs

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37811] [FreeBSD, OSX] Socket module: incorrect usage of poll(2)

2019-08-11 Thread hai shi


hai shi  added the comment:

I found an OS distinguishing behavior in 
https://github.com/python/cpython/blob/master/Modules/selectmodule.c#L603-L612

--
nosy: +shihai1991

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37811] [FreeBSD, OSX] Socket module: incorrect usage of poll(2)

2019-08-10 Thread Artem Khramov


Change by Artem Khramov :


--
keywords: +patch
pull_requests: +14931
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/15202

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37811] [FreeBSD, OSX] Socket module: incorrect usage of poll(2)

2019-08-10 Thread Artem Khramov


New submission from Artem Khramov :

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 in https://bugs.python.org/issue23618 (see 
connect_eintr.py, attached). On GNU/Linux, the example runs as expected.

--
files: connect_eintr.py
messages: 349356
nosy: akhramov
priority: normal
severity: normal
status: open
title: [FreeBSD, OSX] Socket module: incorrect usage of poll(2)
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file48537/connect_eintr.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com