Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 5f7653bd7c6e4cd32d426eb791e08d852dd2eafebb86a2e7ad4543e859993010
Ticket: 1eb488b699d74e0f9d22ea5fc78aa41aa5a77a14
double free when deleting namespace containing the origin routine for some imported routine
User & Date: pooryorick on 2020-08-16 14:45:03
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-fossil-wiki"
  4. comment changed to:
    In Tcl <code>-DPURIFY --enable-symbols</code> the following script results in a
    memory error:
    
    
    <code><verbatim>
    namespace eval test_ns_export {
        namespace export cmd1
        proc cmd1 args {}
    }
    namespace eval test_ns_import {
        namespace import [namespace parent]::test_ns_export::cmd1
    }
    proc test_ns_export::cmd1 args {}
    catch {namespace delete {*}[namespace children :: test_ns_export]}
    return success
    </verbatim></code>
    
    The issue is that <code>TclCreateObjCommandInNs()</code> stores in the table of
    routines for the namespace a pointer to the structure for the new
    routine, but does not increment the reference count.  Eventually this results
    in the routine structure being freed a second second time.
    
  5. is_private changed to: "0"
  6. login: "pooryorick"
  7. priority changed to: "5 Medium"
  8. resolution changed to: "None"
  9. severity changed to: "Minor"
  10. status changed to: "Open"
  11. submitter changed to: "pooryorick"
  12. subsystem changed to: "- New Builtin Commands"
  13. title changed to:
    double free when deleting namespace containing the origin routine for some imported routine
    
  14. type changed to: "Bug"