Artifacts Associated With Ticket fb4a0a6675
Ticket change [74333d1cd2] (rid 198194) by chrstphrchvz on 2022-02-17 00:55:29:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-wiki"
- comment initialized to:
Except for maybe 35 minutes before and after the epoch, there is always signed integer overflow in <tt>TclpGetClicks()</tt> implementations: <blockquote><pre> % clock clicks <span style="font-weight:bold">tcl/unix/tclUnixTime.c:152:19:<span style="color:red"> runtime error: </span>signed integer overflow: 1645057584 * 1000000 cannot be represented in type 'long int'</span> 3505507099 </pre></blockquote> The attached patch should avoid this, however I have only tested the case for Unix with <tt>gettimeofday()</tt>, and not the cases for Unix without <tt>gettimeofday()</tt> nor Windows without <tt>NativeGetMicroseconds()</tt>.
- foundin initialized to: "core-8-6-branch"
- is_private initialized to: "0"
- login: "chrstphrchvz"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "chrstphrchvz"
- subsystem initialized to: "16. Commands A-H"
- title initialized to: "signed integer overflow in TclpGetClicks()"
- type initialized to: "Patch"
Add attachment "clock-clicks.diff" [b95f9b6a5f] (rid 198195) by chrstphrchvz on 2022-02-17 00:55:46.
Ticket change [449c4bab98] (rid 198196) by chrstphrchvz on 2022-02-17 00:58:35:
- comment changed to:
Except for maybe 35 minutes before and after the epoch, there is always signed integer overflow in <tt>TclpGetClicks()</tt> implementations when <tt>long</tt> is 32-bit: <blockquote><pre> % clock clicks <span style="font-weight:bold">tcl/unix/tclUnixTime.c:152:19:<span style="color:red"> runtime error: </span>signed integer overflow: 1645057584 * 1000000 cannot be represented in type 'long int'</span> 3505507099 </pre></blockquote> The attached patch should avoid this, however I have only tested the case for Unix with <tt>gettimeofday()</tt>, and not the cases for Unix without <tt>gettimeofday()</tt> nor Windows without <tt>NativeGetMicroseconds()</tt>.
- login: "chrstphrchvz"
- mimetype: "text/plain"
- comment changed to:
Ticket change [a467401033] (rid 198426) by jan.nijtmans on 2022-02-23 14:16:29:
- assignee changed to: "jan.nijtmans"
- closedate changed to: "2459634.09478338"
- closer changed to: "jan.nijtmans"
- icomment:
Fixed [8779e57115edee5c|here] Thanks for the report and the patch!
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Closed"