Overview
| Artifact ID: | d8e474a13713dfb1da70b812538c80d4f18ee9494a2737bcfa6f96a3d97308ea |
|---|---|
| Ticket: | 688fcc7082fa99a4bd934098c58666841e9e0b0a
trace on imported alias deletes alias and then calls import and triggers memory error |
| User & Date: | pooryorick on 2020-08-16 09:52:56 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/x-fossil-wiki"
- comment changed to:
In Tcl built with <code>-DPURIFY</code> and <code>--enable-symbols</code>, the following script results in a segmentation fault: <code><verbatim> variable res {} namespace eval ns1 { namespace export * proc p1 {} { return success } interp alias {} [namespace current]::p2 {} [namespace current]::p1 } namespace eval ns2 { namespace import [namespace parent]::ns1::p2 } proc ondelete {oldname newname op} { variable res catch { $oldname } cres set res [string match {invalid command name*ns1::p1*} $cres] } trace add command ns2::p2 delete ondelete namespace delete ns1 </verbatim></code> The issue is that the delete trace on the imported routine deletes the namespace of the underlying routine, resulting in the deletion of both the underlying routine and the alias, but then the imported command is called, and its <code>ImportedCmdData</code> structure still holds a reference to the now-deleted Alias structure. - is_private changed to: "0"
- login: "pooryorick"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "pooryorick"
- subsystem changed to: "- New Builtin Commands"
- title changed to:
trace on imported alias deletes alias and then calls import and triggers memory error
- type changed to: "Bug"