Message348358
| Author |
Arun Sharma |
| Recipients |
Arun Sharma |
| Date |
2019年07月23日.23:42:44 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1563925364.59.0.529540614468.issue37665@roundup.psfhosted.org> |
| In-reply-to |
| Content |
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.
====
>>> import threading
>>> threading.TIMEOUT_MAX
9223372036.0
====
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. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2019年07月23日 23:42:44 | Arun Sharma | set | recipients:
+ Arun Sharma |
| 2019年07月23日 23:42:44 | Arun Sharma | set | messageid: <1563925364.59.0.529540614468.issue37665@roundup.psfhosted.org> |
| 2019年07月23日 23:42:44 | Arun Sharma | link | issue37665 messages |
| 2019年07月23日 23:42:44 | Arun Sharma | create |
|