Artifacts Associated With Ticket 1802895fff
Ticket change [f5681750a5] (rid 130101) by dgp on 2007-09-26 16:02:18:
- assignee initialized to: "kennykb"
- cmimetype initialized to: "text/plain"
- comment initialized to:
On 32-bit Linux (Centos 5): % after [expr 0b1101111010111101100000000000000000000000] % Returns immediately. Seems to be something amiss in AfterDelay() perhaps some long vs. Tcl_WideInt calculations?
- foundin initialized to: "obsolete: 8.5a7"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "03. Timer Events"
- title initialized to: "AfterDelay weirdness"
- type initialized to: "Bug"
Ticket change [b66fa1c1ce] (rid 125423) by dgp on 2007-09-28 02:41:54:
- icomment:
Logged In: YES user_id=80530 Originator: YES the trouble is that the Tcl_Time .sec field is a long, limited to the long range, and when sizeof(Tcl_WideInt) > sizeof(long) the endTime can overflow that limit. after [expr 1000<30]
- login: "dgp"
- mimetype: "text/plain"
- title changed to: "AfterDelay overflow"
- username: "dgp"
- icomment:
Ticket change [56703159b3] (rid 94316) by dgp on 2007-10-23 00:29:19:
- icomment:
Logged In: YES user_id=80530 Originator: YES any chance to address this for 8.5b2 ?
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [d47bb1fefa] (rid 123449) by dgp on 2007-11-28 01:03:09:
- icomment:
Logged In: YES user_id=80530 Originator: YES status?
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [08380f4819] (rid 89526) by ferrieux on 2008-04-01 05:20:44:
- icomment:
Logged In: YES user_id=496139 Originator: NO To allow for delays larger than the internal syscall's limit, what about a self-reposting large timer ? This would allow for alternative syscalls (like in TIP 302) even though they may reduce the span of one-shot timers.
- login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Ticket change [f7de59c695] (rid 203110) by oehhar on 2022-08-18 12:32:32:
- assignee changed to: "aku"
- closer changed to: "nobody"
- comment changed to:
On 32-bit Linux (Centos 5): % after [expr 0b1101111010111101100000000000000000000000] % Returns immediately. Seems to be something amiss in AfterDelay() perhaps some long vs. Tcl_WideInt calculations?
- foundin changed to: "8.6"
- icomment:
Still present in TCL 8.6.12 and TCL 8.7b5. So, updating the version field from 8.5a7 to 8.6. This is not severe, as we don't crash or block. To say, it could be worse ;-). Take care, Harald
- login: "oehhar"
- mimetype: "text/x-fossil-wiki"
- severity changed to: "Minor"
- username: "oehhar"
Ticket change [3ba9e47b17] (rid 203111) by sebres on 2022-08-18 13:27:58:
- icomment:
Fixed in RFE [fdfbd5e10].<br/> Just to point to possible fix - take a look for <code>TclpGetUTimeFromObj</code> (that used in <code>Tcl_AfterObjCmd</code> now) in [/tcl/vdiff?diff=2&from=23eaea57edea4be8&to=2a854432fbb13877|diff]. Basically it falls back to <code>0x7FFFFFFFFFFFFFFFL µs</code> when double representing time offset is larger than <code>0x7FFFFFFFFFFFFFFFL µs</code>. (The branch has better timer granularity and timers are microseconds precise, so even floating point values are possible). And <code>0x7FFFFFFFFFFFFFFFL µs</code> corresponds to <code>292277024</code> years.
- login: "sebres"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [810623ccdd] (rid 203112) by oehhar on 2022-08-18 14:18:51:
- icomment:
Thanks, Sergey ! That is your magic wizard stuff nobody can take, as nobody understands it, but you. We all would love to have it in, at least 9.0. I would really say, that "after" with more than 1 year does not make any sense and should run into an error. Thanks and take care, Harald
- login: "oehhar"
- mimetype: "text/x-fossil-wiki"
- username: "oehhar"
- icomment:
Ticket change [b511655eaa] (rid 203113) by sebres on 2022-08-18 16:13:04:
- icomment:
> *I would really say, that "after" with more than 1 year does not make any sense and should run into an error.* No. Not if your tcl's internal clock (which can be virtualized) runs a year in a second.<br/> The time is scalable in Tcl - `tclGetTimeProcPtr`,`tclScaleTimeProcPtr` are mostly `NativeGetTime`,`NativeScaleTime`, but some things may expect different speed of time (very very fast clock even).
- login: "sebres"
- mimetype: "text/x-markdown"
- icomment:
Ticket change [fb435b3693] (rid 203114) by oehhar on 2022-08-18 16:22:35:
- icomment:
Ok, thank you ;-). That is really weared stuff. Harald
- login: "oehhar"
- mimetype: "text/plain"
- username: "oehhar"
- icomment:
Ticket change [5c9ed9a033] (rid 259315) by serhiy.storchaka on 2026-10-19 18:00:22:
- foundin changed to: "8.6.18, 9.0.5"
- icomment:
Fixed on main by TIP 723 (too large delays give "time too far away"). Still present in 9.0 and 8.6: a blocking <tt>after 0x7fffffffffffffff</tt> returns at once on 64-bit systems (the millisecond arithmetic overflows), and where <tt>long</tt> is 32 bits any delay over about 11 years does. Proposed fix in branches [/timeline?r=after-overflow-9-0|after-overflow-9-0] and [/timeline?r=after-overflow-8-6|after-overflow-8-6]: both forms of <nowiki>[after]</nowiki> add the delay with a saturating <tt>TimeAddMs()</tt>. Tests timer-11.3 (fails without the fix on 9.0; its script returns at once on 8.6.18 too) and 11.4.
- login: "serhiy.storchaka"
- mimetype: "text/x-fossil-wiki"
Ticket change [272c443b4e] (rid 263170) by serhiy.storchaka on 2026-11-26 17:34:32:
- icomment:
Jan, could you please merge [/timeline?r=after-overflow-9-0|after-overflow-9-0] into core-9-0-branch and [/timeline?r=after-overflow-8-6|after-overflow-8-6] into core-8-6-branch? Both still merge cleanly; timer.test passes, and timer-11.3 fails without the fix on current 9.0 and 8.6.
- login: "serhiy.storchaka"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [ed08d851c0] (rid 263173) by jan.nijtmans on 2026-11-27 07:59:07:
- assignee changed to: "jan.nijtmans"
- closedate changed to: "2461371.8327218057"
- closer changed to: "jan.nijtmans"
- icomment:
Now merged to core-9-0-branch and core-8-6-branch too Thanks for reminding me!
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Closed"