Summary
SRFI-18 time objects store time span as fixnums, which can overflow
Metadata
- Id: 9e92a867b7640a90c951e28b735aab762d3d01d3
- Trac id: 298
- Type: defect
- Reporter: felix
- Owner:
- Cc:
- Status: closed
- Component: core libraries
- Estimated difficulty:
- Resolution: fixed
- Priority: critical
- Milestone:
- Version: 4.5.x
- Changetime: 2010-08-10 09:37:34 UTC
- Created: 2010-07-29 12:14:10 UTC
- Keywords: timeout srfi-18 time
Description
(reported by Nicolas Pelletier)
After 12 days, fixnums will overflow on 32-bit platforms. It would be better to store the milliseconds span as flonum and use flonum comparisons in srfi-18.scm and scheduler.scm.
Changes and comments
[2010-07-29 14:46:59 UTC] felix set keywords to timeout srfi-18 time
[2010-07-29 14:46:59 UTC] felix removed milestone 4.6.0
[2010-07-29 14:46:59 UTC] felix wrote:
This is quite serious. `(##sys#fudge 6)`, `(##sys#fudge 16)` and the C runtime functions `milliseconds()' and `cpu_milliseconds()`, including all variables that are set to results of these are affected. The `tcp` unit uses them for timeout calculations as does the scheduler (which is compiled in fixnum mode).
Damn.
[2010-08-10 09:37:34 UTC] felix changed status from new to closed
[2010-08-10 09:37:34 UTC] felix set resolution to fixed
[2010-08-10 09:37:34 UTC] felix wrote:
Implemented in the `flonmu-milliseconds` branch and merged into experimental. Need more testing.