You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
threading.TIMEOUT_MAX integer overflow on 32-bit builds with threading.Thread.join #81846
threading's TIMEOUT_MAX constant causes overflows when used as the timeout for threading.Thread.join on a 32-bit platform, like a Raspberry PI running Raspbian (2019-07-10-raspbian-buster).
The underlying code uses sem_timedwait. The timespec on this platform resolves seconds to a 32-bit integer, adding the current time to the timeout to get a deadline.
The deadline is larger than the int32 UNIX Epoch and results in an overflow.
Just changing the threading.TIMEOUT_MAX to be based on the time left until the UNIX Epoch would require changing the timeout over the duration of the program and would not be very viable as the Epoch gets closer.
Activity
ArunSharma commentedon Jul 23, 2019
threading's TIMEOUT_MAX constant causes overflows when used as the timeout for threading.Thread.join on a 32-bit platform, like a Raspberry PI running Raspbian (2019-07-10-raspbian-buster).
The underlying code uses sem_timedwait. The timespec on this platform resolves seconds to a 32-bit integer, adding the current time to the timeout to get a deadline.
====
====
The deadline is larger than the int32 UNIX Epoch and results in an overflow.
Just changing the threading.TIMEOUT_MAX to be based on the time left until the UNIX Epoch would require changing the timeout over the duration of the program and would not be very viable as the Epoch gets closer.
ZackerySpytz commentedon Jul 24, 2019
See also bpo-33632.