Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: fbd1248dcc4af898127b87c370a91cb8d1782f0b
Ticket: 3098302fffffffffffffffffffffffffffffffff
Bytecode for [catch] causes crash
User & Date: kennykb on 2010-10-29 15:29:43
Changes

  1. assignee changed to: "dgp"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    If a [catch {some script} result] or [catch {some script} result options] has a write trace fail on the 'result' or 'options' variables, the 'endCatch' bytecode for the catch block gets bypassed, and the exception stack becomes unbalanced. The result is somewhat unpredictable, but likely to be unamusing:
    
    Test case:
    
    proc failtrace {n1 n2 op} {
        return -code error "trace on $n1 fails by request"
    }
    trace add variable result1 write failtrace
    
    proc x {} {
        variable result1
        for {set i 0} {$i < 100} {incr i} {
    set status2 [catch {
        set status1 [catch {
    return -code error -level 0 "original failure"
        } result1 options1]
    } result2 options2]
    lappend retval $status2 $result2 $options2
        }
    }
    
    puts [x]
    
    Test result:
    
    Bad stack top 7 at pc 144 in TclNRExecuteByteCode (min 0, max 6)
     executing lappend retval $status2 $result2 $options2
    TclNRExecuteByteCode execution failure: bad stack top
    
    Will follow up on tcl-core.
    
    
  4. foundin changed to: "obsolete: 8.6b1.1"
  5. is_private changed to: "0"
  6. priority changed to: "7 High"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "kennykb"
  10. subsystem changed to: "47. Bytecode Compiler"
  11. title changed to: "Bytecode for [catch] causes crash"
  12. type changed to: "Bug"