Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 74333d1cd23213ffd9728e28b93bcebdc70c989b532ea235c78b47e5d63a2cd7
Ticket: fb4a0a66752423622d38c070f89ad81e3b4c2bb8
signed integer overflow in TclpGetClicks()
User & Date: chrstphrchvz on 2022-02-17 00:55:29
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-fossil-wiki"
  4. comment changed 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>.
    
  5. foundin changed to: "core-8-6-branch"
  6. is_private changed to: "0"
  7. login: "chrstphrchvz"
  8. priority changed to: "5 Medium"
  9. resolution changed to: "None"
  10. severity changed to: "Minor"
  11. status changed to: "Open"
  12. submitter changed to: "chrstphrchvz"
  13. subsystem changed to: "16. Commands A-H"
  14. title changed to: "signed integer overflow in TclpGetClicks()"
  15. type changed to: "Patch"