Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 2e0b723819a8c0e21c6f8b7674daaea5ce74890a39449c7be5aa28910c91aaa2
Ticket: f9764cd7a938fca3a91b087a6a5bd635cea1a216
tcl Tcl_CreateTimerHandler has flaws which may never invoker input function
User & Date: anonymous on 2023-09-21 15:08:44
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-markdown"
  4. comment changed to:
    # Steps to reproduce the problem:
    
     Current date:Thu Sep 21 02:55:28 PM UTC 2023
     Step1: cat << EOF > test.sh   #!/usr/bin/expect
    
      sleep 10
    
      EOF
    
     Step2: date -s "Thu Sep 14 20:13:49 CST 2138" ; expect -d test.sh &
    
     Step3: date -s "Thu Sep 14 20:13:49 CST 2023"
    
    # Expected behaviour
    
    'expect -d test.sh' will be executed after 10 seconds.
    
    # Real outcome
    
    'expect -d test.sh' not executed until 7 days later (Sep 14 to Sep 21)
    
    # Possible fix
    
    I think this is becuase expect software uses Tcl_CreateTimerHandler()function, which use absolutetime to measure how many seconds to wait before invoking function. And the amoung of seconds to wait can be changed by modifying current date of OS system.
    
    Question is: is this an expected behavior of TCL? And change the Tcl_GetTime() function to retrieve relative time by using CLOCK_MONOTONIC
    
  5. foundin changed to: "TCL 8.6.8"
  6. is_private changed to: "0"
  7. login: "anonymous"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "7eb5a4a5a930a2650d5e6092d9ecc69e6a0101fd"
  10. resolution changed to: "None"
  11. severity changed to: "Important"
  12. status changed to: "Open"
  13. submitter changed to: "anonymous"
  14. subsystem changed to: "55. Other Tools"
  15. title changed to:
    tcl Tcl_CreateTimerHandler has flaws which may never invoker input function
    
  16. type changed to: "Bug"