Artifacts Associated With Ticket 2055782fffffffff
Ticket change [6e533f6d47] (rid 100131) by lars_h on 2008-08-17 11:37:10:
- assignee initialized to: "msofer"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Calling [namespace inscope] with an empty script argument crashes Tcl 8.5 (both .0 and .4 tested), but appears to work in previous versions (two 8.4 and one 8.3 tested). Compare % info pa 8.5.4 % namespace inscope tcl {} HistInfo alloc: invalid block: 0xebc70: 0 2 Abort [hexley:Tcl/build/tcl] lars% uname -a Darwin hexley.local 8.11.0 Darwin Kernel Version 8.11.0: Wed Oct 10 18:26:00 PDT 2007; root:xnu-792.24.17~1/RELEASE_PPC Power Macintosh powerpc to % info pa 8.4.16 % namespace inscope tcl {} HistInfo 1 info pa 2 namespace inscope tcl {} HistInfo % Why would anyone want to do this, then? It turns out that interp alias {} ::foo {} namespace inscope ::foo "" is a fairly good emulation of namespace eval ::foo { namespace export * namespace ensemble create } which works also in older Tcl versions. (The emulation can be further improved by using an auxiliary interpreter, but that's probably more trouble than it's worth.) - foundin initialized to: "obsolete: 8.5.4"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "lars_h"
- subsystem initialized to: "21. [namespace]"
- title initialized to: "Crash in [namespace inscope]"
- type initialized to: "Bug"
Ticket change [4d52f795e8] (rid 127036) by msofer on 2008-08-17 21:17:46:
- closedate changed to: "2008-08-17T14:17:46"
- closer changed to: "msofer"
- icomment:
Logged In: YES user_id=148712 Originator: NO My commit of 2007-10-28 turned Tcl_ConcatObj from reader to hairy monster (see [Bug 1447328]), exposing "unsafe" Tcl_Obj handling in NamespaceInscopeCommand(). That is a bug in the commit, as Tcl_ConcatObj() is documented to be a reader. This is just a symptom of [Bug 1447328], now fixed in CVS.
- login: "msofer"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "msofer"
Ticket change [2d4cf2f362] (rid 119039) by lars_h on 2008-08-17 23:48:19:
- icomment:
Logged In: YES user_id=938835 Originator: YES Pasting in msofer's 2008-08-17 comment in [Bug 1447328], since it is a bit clearer than what he wrote here (crash reported here is not a symptom of what is reported in that bug, but a symptom of a new bug introduced by the fix to the old one). (Begin quote) Oops ...this turned Tcl_ConcatObj from reader to hairy monster, see [Bug 2055782]. This is against the documented behaviour. This only happens when concat'ing one or more empty objs with a single list. Additionally Tcl_ConcatObj() would corrupt its input when: all things to be concat'ed were either empties or canonical lists, and at least 2 were not empty, and the first one was unshared. In that case it would add the new elements in place, hence modifying its input. THIS IS VERY BAD! Fixed now in 8-5-branch and HEAD. (End quote.) The remark about empties or canonical lists suggests that a work-around is to use a noncanonical empty list as script argument, e.g. namespace inscope tcl " " HistInfo Testing confirms that it avoids the crash. Unfortunately it also leads to shimmering (of all arguments), so it's probably not worth bothering about; should anyway use ensembles in 8.5.
- login: "lars_h"
- mimetype: "text/plain"
- username: "lars_h"
- icomment: