Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: d6601c105e2cd8b657a7b42697c7c41b6a0bf40c4b2dd6a3aaa65a6fe84e76df
Ticket: 86dd172271f35ac4f08b15c440fa94ce7c6022c1
interp.test fails if clock is set to year 2040 (even on 64 bit machines)
User & Date: kanavin on 2023-08-07 11:44:44
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-markdown"
  4. comment changed to:
    When system date is set to 2040 (e.g. post-2038), interp.test starts producing failures, this is the output. I suspect there's a 32 bit integer in use for time somewhere? Note that this happens on 64 bit x86_64 machine, so the issue seems specific to tcl.
    
    ```
    FAIL: interp.test
    Tests running in interp:  /usr/lib/tcl/ptest/tcltest
    Tests located in:  /usr/lib/tcl/ptest/tests
    Tests running in:  /usr/lib/tcl/ptest
    Temporary files stored in /usr/lib/tcl/ptest
    Test files run in separate interpreters
    Running tests that match:  *
    Skipping test files that match:  l.*.test
    Only running test files that match:  interp.test
    Tests began at Thu Feb 02 00:01:54 GMT 2040
    interp.test
    
    
    ==== interp-34.3 basic test of limits - pure bytecode loop FAILED
    ==== Contents of test case:
    
        set i [interp create]
        $i eval {
    	proc foobar {} {
    	    while {1} {
    		# No bytecode at all here...
    	    }
    	}
        }
        # We use a time limit here; command limits don't trap this case
        $i limit time -seconds [expr {[clock seconds]+2}]
        $i eval foobar
    
    ---- Result was:
    seconds must be at least 0
    ---- Result should have been (exact matching):
    time limit exceeded
    ==== interp-34.3 FAILED
    
    
    
    ==== interp-34.3.1 basic test of limits - pure inside-command loop FAILED
    ==== Contents of test case:
    
        set i [interp create]
        $i eval {
    	proc foobar {} {
    	    set while while
    	    $while {1} {
    		# No bytecode at all here...
    	    }
    	}
        }
        # We use a time limit here; command limits don't trap this case
        $i limit time -seconds [expr {[clock seconds] + 2}]
        $i eval foobar
    
    ---- Result was:
    seconds must be at least 0
    ---- Result should have been (exact matching):
    time limit exceeded
    ==== interp-34.3.1 FAILED
    
    
    
    ==== interp-34.8 time limits trigger in vwaits FAILED
    ==== Contents of test case:
    
        set i [interp create]
        interp limit $i time -seconds [expr {[clock seconds] + 1}] -granularity 1
        $i eval {
    	set x {}
    	vwait x
        }
    
    ---- Result was:
    seconds must be at least 0
    ---- Result should have been (exact matching):
    limit exceeded
    ==== interp-34.8 FAILED
    
    
    
    ==== interp-34.9 time limits trigger in blocking after FAILED
    ==== Contents of test case:
    
        set i [interp create]
        set t0 [clock seconds]
        interp limit $i time -seconds [expr {$t0 + 1}] -granularity 1
        set code [catch {
    	$i eval {after 10000}
        } msg]
        set t1 [clock seconds]
        interp delete $i
        list $code $msg [expr {($t1-$t0) < 3 ? "OK" : $t1-$t0}]
    
    ---- Test generated error; Return code was: 1
    ---- Return code should have been one of: 0 2
    ---- errorInfo: seconds must be at least 0
        while executing
    "interp limit $i time -seconds [expr {$t0 + 1}] -granularity 1"
        ("uplevel" body line 4)
        invoked from within
    "uplevel 1 $script"
    ---- errorCode: TCL OPERATION INTERP BADVALUE
    ==== interp-34.9 FAILED
    
    
    
    ==== interp-34.11 time limit extension in callbacks FAILED
    ==== Contents of test case:
    
        set i [interp create]
        set t0 [clock seconds]
        $i limit time -seconds [expr {$t0 + 1}] -granularity 1  -command "cb1 $i [expr {$t0 + 2}]"
        set ::result {}
        lappend ::result [catch {
    	$i eval {
    	    for {set i 0} {$i<30} {incr i} {
    		after 100
    	    }
    	}
        } msg] $msg
        set t1 [clock seconds]
        lappend ::result [expr {$t1-$t0>=2 ? "ok" : "$t0,$t1"}]
        interp delete $i
        return $::result
    
    ---- Test generated error; Return code was: 1
    ---- Return code should have been one of: 0 2
    ---- errorInfo: seconds must be at least 0
        while executing
    "$i limit time -seconds [expr {$t0 + 1}] -granularity 1  -command "cb1 $i [expr {$t0 + 2}]""
        ("uplevel" body line 4)
        invoked from within
    "uplevel 1 $script"
    ---- errorCode: TCL OPERATION INTERP BADVALUE
    ==== interp-34.11 FAILED
    
    
    
    ==== interp-34.12 time limit extension in callbacks FAILED
    ==== Contents of test case:
    
        set i [interp create]
        set t0 [clock seconds]
        set ::times "[expr {$t0 + 2}] [expr {$t0 + 100}]"
        $i limit time -seconds [expr {$t0 + 1}] -granularity 1 -command "cb1 $i"
        set ::result {}
        lappend ::result [catch {
    	$i eval {
    	    for {set i 0} {$i<30} {incr i} {
    		after 100
    	    }
    	}
        } msg] $msg
        set t1 [clock seconds]
        lappend ::result [expr {$t1-$t0>=2 ? "ok" : "$t0,$t1"}]
        interp delete $i
        return $::result
    
    ---- Test generated error; Return code was: 1
    ---- Return code should have been one of: 0 2
    ---- errorInfo: seconds must be at least 0
        while executing
    "$i limit time -seconds [expr {$t0 + 1}] -granularity 1 -command "cb1 $i""
        ("uplevel" body line 5)
        invoked from within
    "uplevel 1 $script"
    ---- errorCode: TCL OPERATION INTERP BADVALUE
    ==== interp-34.12 FAILED
    
    
    
    ==== interp-34.13 time limit granularity and vwait: Bug 2891362 FAILED
    ==== Contents of test case:
    
        $i limit time -seconds [clock add [clock seconds] 1 second]
        $i eval {
    	after 2000 set x timeout
    	vwait x
    	return $x
        }
    
    ---- Result was:
    seconds must be at least 0
    ---- Result should have been (exact matching):
    limit exceeded
    ==== interp-34.13 FAILED
    
    
    Tests ended at Thu Feb 02 00:01:55 GMT 2040
    all.tcl:	Total	351	Passed	337	Skipped	7	Failed	7
    Sourced 1 Test Files.
    Files with failing tests: interp.test
    Number of tests skipped for each constraint:
    	7	knownBug
    ```
    
  5. foundin changed to: "8.6.13"
  6. is_private changed to: "0"
  7. login: "kanavin"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "316aee5d655ccb7cd0e5d969e9f2b16e4e95a50c"
  10. resolution changed to: "None"
  11. severity changed to: "Important"
  12. status changed to: "Open"
  13. submitter changed to: "kanavin"
  14. subsystem changed to: "20. [interp]"
  15. title changed to:
    interp.test fails if clock is set to year 2040 (even on 64 bit machines)
    
  16. type changed to: "Bug"