Artifacts Associated With Ticket 16e4fc3096
Ticket change [d37ea78007] (rid 138548) by sebres on 2014-06-26 21:52:24:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
int overflow while format of very large date: % clock format 0xfffffffffffffff Sun Feb 05 14:56:15 CET 1269743 % clock format 0xffffffffffffff Thu Apr 28 13:52:15 CET 2127340 % clock format 0xfffffffffffff Sun Apr 12 04:48:15 CET 1604708 todo: check trunc + other branch todo: check overflow in tcl::clock::__intern_functions__ or ::tcl::clock::format only, possible leap year calculation.
- foundin initialized to: "8.5 (check trunc)"
- is_private initialized to: "0"
- login: "sebres"
- priority initialized to: "5 Medium"
- private_contact initialized to: "6933eee2776ead023a149cbd20ebded8477a02d4"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "sebres"
- subsystem initialized to: "06. Time Measurement"
- title initialized to: "int overflow - clock format of very large date."
- type initialized to: "Bug"
Ticket change [4ca285bee0] (rid 138549) by sebres on 2014-06-26 21:53:34:
- assignee changed to: "sebres"
- login: "sebres"
- mimetype: "text/plain"
- priority changed to: "1 Zero"
Ticket change [2326537117] (rid 138550) by sebres on 2014-06-26 22:01:40:
- comment changed to:
year int overflow while format of very large date: % clock format 0xfffffffffffffff Sun Feb 05 14:56:15 CET 1269743 % clock format 0xffffffffffffff Thu Apr 28 13:52:15 CET 2127340 % clock format 0xfffffffffffff Sun Apr 12 04:48:15 CET 1604708 todo: check trunc + other branch todo: check overflow in tcl::clock::__intern_functions__ or ::tcl::clock::format only, possible leap year calculation.
- login: "sebres"
- mimetype: "text/plain"
- title changed to:
year int overflow - clock format of very large date.
- comment changed to:
Ticket change [ec61309cea] (rid 155271) by sebres on 2017-08-08 15:22:46:
- icomment:
Fixed in branch <a href="http://core.tcl.tk/tcl/timeline?r=sebres-8-6-clock-speedup-cr1">sebres-8-6-clock-speedup-cr1</a> (commit [3efed18ef8]). Can be closed if branch get merged.
- login: "sebres"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [7a37811735] (rid 168552) by sebres on 2019-01-23 17:11:24:
- icomment:
I found still another similar issue (because minor, won't open new ticket): <pre style="padding-left:10pt"> % clock format [expr {-210866803200 - 0}] -format {%J -- %Y-%m-%d %T} -gmt true 0000000 -- 4713-01-01 00:00:00 % clock format [expr {-210866803200 - 1}] -format {%J -- %Y-%m-%d %T} -gmt true <b style="color:red">- 0000000 -- 4713-01-01 23:59:59</b> <b style="color:green">+ -000001 -- 4714-12-31 23:59:59</b> % clock format [expr {-210866803200 - 86400}] -format {%J -- %Y-%m-%d %T} -gmt true <b style="color:red">- -000001 -- 4714-12-31 00:00:00</b> <b style="color:green">+ -000002 -- 4714-12-31 00:00:00</b> </pre> Julian day, if traverses over 0 into negative (from year 4713 B.C.E to 4714 B.C.E), becomes negative value first if it is switched a complete day back (24 hours are invalid).<br/> Because julian day used also in the internal calculations, as one can see in the second call (red-marked result), the formated date is therefore totally wrong. Expected value is green-marked. There are 2 variants to fix this:<br/> 1. JD to -1, and seconds of day to 86399 (simplest case to implement or to fix it)<br/> 2. JD to 0, and seconds of day to -1 (more complex case, because at the moment value of day-seconds is rather positive everywhere in internal calculations, thus then many adjustments are necessary in this case). I've fixed it (variant 1) in my internal branches (and tclclockmod), will port it later in sebres-8-6-clock-speedup branch. BTW, I don't understand also, why it has padding 7 at all (and for which reasons it may be necessary). - login: "sebres"
- mimetype: "text/x-fossil-wiki"
- title changed to:
year int overflow - clock format of very large date / JD is wrong - if switches into negative value (+24 hours difference).
- icomment:
Ticket change [dd96d83924] (rid 168633) by sebres on 2019-01-25 20:57:50:
- icomment:
Fix is pushed for below-mentioned JD-bug (as announced, using variant 1), see [1a47e63d8d], thus ticket could be closed, if branch gets merged.
- login: "sebres"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [da3e0ea907] (rid 202959) by sebres on 2022-08-02 11:35:33:
- icomment:
Basically all current tcl-versions overflow after year 5874790: ``` % clock format [set i 185628797193599] -gmt 1 Mon Dec 31 23:59:59 GMT 5874790 % clock format [incr i] -gmt 1 Tue Jan 01 00:00:00 GMT 5874789 ``` The fix in tclclockmod or speedup branches is minimalist, since without large effort it was possible only up to y2e9 (so I set an internal range TCL_MIN_SECONDS to TCL_MAX_SECONDS as ±0x00F0000000000000L), because by some larger values the internal calculation may also overflow (somewhere by the julianday which is signed 32-int now)... ``` % package require tclclockmod % clock format [set i 0x00F0000000000000] -gmt 1 Mon Dec 19 09:04:00 GMT 2140702833 % clock format [incr i] -gmt 1 integer value too large to represent ``` Anyway it is more than 360 times larger than by tcl now (and most important **it would not overflow silently anymore**).
- login: "sebres"
- mimetype: "text/x-markdown"
- private_contact changed to: "da39a3ee5e6b4b0d3255bfef95601890afd80709"
- resolution changed to: "Fixed"
- status changed to: "Pending"
- icomment:
Ticket change [0fc348aa50] (rid 258153) by serhiy.storchaka on 2026-10-15 11:39:51:
- icomment:
Fixed in Tcl 9.0 by the TIP 688 clock rewrite ([dd916eacf3], containing [3efed18ef8] and [1a47e63d8d]), first released in 9.0b2/9.0.0.
- login: "serhiy.storchaka"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- icomment:
Ticket change [fbf11ef4f8] (rid 259945) by serhiy.storchaka on 2026-10-22 17:19:27:
- closedate changed to: "2461328.9860151852"
- closer changed to: "serhiy.storchaka"
- login: "serhiy.storchaka"