Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: b9f3f993583553018ce5ddf2a0b660effcd7f9345219be3211d648a2506bd77a
Ticket: 24d7f1a69572ef507638447eb87ccce0c9d489b9
Recursive [namespace delete] causes a segfault
User & Date: teclab on 2025-12-06 22:56:14
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-markdown"
  4. comment changed to:
    Dear TCL Team,
    
    might be an artifial problem, but this code below makes TCL crash:
    
    
    ```
    namespace eval rpc {
        namespace ensemble create -parameters name
        namespace export create
    
        proc create {name args} {
            variable _unique
            if {$name == "#auto"} {set name "rpc[incr _unique]"}
            namespace eval ::$name {
                namespace ensemble create
                namespace export init
                trace add command [namespace current] delete [namespace current]::delete
                proc init args {puts doneinit}
                proc delete {oldName newName op} {
                    puts cleanup
                    namespace delete [namespace current]
                }
            }
            ::${name}::init {*}$args
            return $name
        }
    }
    ```
    
    
    That's how you call it:
    
    `rpc r create`
    
    Now a second time:
    
    `rpc r create`
    
    *boom*
    
    
    Thank You!
    
  5. foundin changed to: "core-8-6-branch"
  6. is_private changed to: "0"
  7. login: "teclab"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "6bac77948ef91492d41f70b5be732fdb60f91282"
  10. resolution changed to: "None"
  11. severity changed to: "Minor"
  12. status changed to: "Open"
  13. submitter changed to: "teclab"
  14. subsystem changed to: "21. [namespace]"
  15. title changed to: "Recursive [namespace delete] causes a segfault"
  16. type changed to: "Bug"