Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: ce3e84d80df7085e702b03bc400375668baedff3
Ticket: 1220058fffffffffffffffffffffffffffffffff
namespace delete in rename trace causes bus error
User & Date: duquette on 2005-06-14 00:44:26
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    Problem Behavior: Tcl halts with a bus error
    
    The following code creates an ensemble command using
    "namespace ensemble", and then renames the ensemble to "".
    A rename trace fires which deletes the namespace, which is when 
    Tcl terminates with a bus error.  The code is a much simplified
    version of something I found while working on Snit 2.0.  Note that in 
    Snit 1.0 the only difference is that the command is a standard proc, 
    not a namespace ensemble, and there's no error.
    
    namespace eval ::foo:: {
        namespace ensemble create -command ::bar
    }
    
    trace add command ::bar delete DeleteTrace
    
    proc DeleteTrace {old new op} {
        puts "DeleteTrace [list $old $new $op]"
    
        trace remove command ::bar delete DeleteTrace
        
        # If this line is removed, there's no bus error,
        rename $old ""
    
        # This next line causes the bus error
        namespace delete ::foo::
    }
    
    rename ::bar ""
    
    
  4. foundin changed to: "obsolete: 8.5a3"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "duquette"
  9. subsystem changed to: "None"
  10. title changed to: "namespace delete in rename trace causes bus error"
  11. type changed to: "Bug"