Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 23a7c0edf5563738fff0b29073f628c82e5b236eb90a51d1b478f663bbbc9c5a
Ticket: a34733451b2cf189528061944466cf7ce7015008
Regression with TIP #636 in foreach
User & Date: fvogel on 2023-07-09 15:39:52
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-fossil-wiki"
  4. comment changed to:
    Github Actions testing Tk trunk on Linux with the main Tcl (9.0) branch [https://github.com/tcltk/tk/actions/runs/5498558004/jobs/10023375244|results in three errors] that were not present before.
    
    <verbatim>
    ==== imgPhoto-4.79 ImgPhotoCmd, transparency get: no option FAILED
    ==== Contents of test case:
    
        set pixelCoords {{156 239} {76 207} {153 213} {139 43} {75 112}}
        foreach coord $pixelCoords {
    	lappend result [photo1 transparency get {*}$coord]
        }
        set result
    
    ---- Test generated error; Return code was: 1
    ---- Return code should have been one of: 0 2
    ---- errorInfo: can't read "coord": no such variable
        while executing
    "photo1 transparency get {*}$coord"
        ("foreach" body line 2)
        invoked from within
    "foreach coord $pixelCoords {
    	lappend result [photo1 transparency get {*}$coord]
        }"
        ("uplevel" body line 3)
        invoked from within
    "uplevel 1 $script"
    ---- errorCode: TCL LOOKUP VARNAME coord
    ==== imgPhoto-4.79 FAILED
    
    
    ==== imgPhoto-4.81 ImgPhotoCmd, transparency get: -alpha FAILED
    ==== Contents of test case:
    
        set pixelCoords {{156 239} {76 207} {153 213} {139 43} {75 112}}
        foreach coord $pixelCoords {
    	lappend result [photo1 transparency get {*}$coord -alpha]
        }
        set result
    
    ---- Test generated error; Return code was: 1
    ---- Return code should have been one of: 0 2
    ---- errorInfo: can't read "coord": no such variable
        while executing
    "photo1 transparency get {*}$coord -alpha"
        ("foreach" body line 2)
        invoked from within
    "foreach coord $pixelCoords {
    	lappend result [photo1 transparency get {*}$coord -alpha]
        }"
        ("uplevel" body line 3)
        invoked from within
    "uplevel 1 $script"
    ---- errorCode: TCL LOOKUP VARNAME coord
    ==== imgPhoto-4.81 FAILED
    
    
    ==== panedwindow-17.1 MoveSash, move right FAILED
    ==== Contents of test case:
    
        panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
        foreach w {.f1 .f2} c {red blue} {
            .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
        }
    
        # Get the requested width of the paned window
        lappend result [winfo reqwidth .p]
    
        .p sash place 0 30 0
    
        # Get the reqwidth again, to make sure it hasn't changed
        lappend result [winfo reqwidth .p]
    
        # Check that the sash moved
        lappend result [.p sash coord 0]
    
    ---- Test generated error; Return code was: 1
    ---- Return code should have been one of: 0 2
    ---- errorInfo: unknown color name "3"
        (processing "-bg" option)
        invoked from within
    "frame $w -height 20 -width 20 -bg $c"
        ("foreach" body line 2)
        invoked from within
    "foreach w {.f1 .f2} c {red blue} {
            .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
        }"
        ("uplevel" body line 3)
        invoked from within
    "uplevel 1 $script"
    ---- errorCode: TK LOOKUP COLOR 3
    ==== panedwindow-17.1 FAILED
    
    </verbatim>
    
    plus an additional error message:
    
    <verbatim>
    [...]
    unixWm.test
    Test file error: can't read "geom": no such variable
    util.test
    [...]
    </verbatim>
    
    Bisection shows that the first commit triggering this regression is [91c2f411e7], that is the merge of [https://core.tcl-lang.org/tips/doc/trunk/tip/636.md|TIP #636] implementation into trunk.
    
    In all the four cases, the problem is in a foreach loop apparently not assigning a value to the loop variable.
    
    Warning: the problem cannot be reproduced when running only the imgPhoto.test or panedwindow.test file from Tk. Running the entire test suite of Tk allows however to reproduce.
    
  5. foundin changed to: "main"
  6. is_private changed to: "0"
  7. login: "fvogel"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "a013af67114eccc19ad12b04f14923acea9e96b7"
  10. resolution changed to: "None"
  11. severity changed to: "Critical"
  12. status changed to: "Open"
  13. submitter changed to: "fvogel"
  14. subsystem changed to: "16. Commands A-H"
  15. title changed to: "Regression with TIP #636 in foreach"
  16. type changed to: "Bug"