New submission from Artem Khramov <akhramov+pyb...@pm.me>:

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 <rep...@bugs.python.org>
<https://bugs.python.org/issue37811>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to