Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2001-04-16
23:10 • Ticket [218611ffff] bug in "append" command status still Closed wi... artifact: 348d428565 user: dgp
2000-10-26
08:25 • Closed ticket [218611ffff]. artifact: f60f601181 user: welch
01:03 • New ticket [218611ffff]. artifact: 8bd9782bc6 user: nobody

bug in "append" command

Closed / Fixed218611ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 01:03:05
OriginalBugID: 1442 Bug
Version: 8.0.4
SubmitDate: '1999-03-04'
LastModified: '1999-09-13'
Severity: LOW
Status: Released
Submitter: pat
ChangedBy: hobbs
OS: Solaris
OSVersion: 2.5 Sparc
Machine: Other
FixedDate: '1999-09-13'
FixedInVersion: 8.1
ClosedDate: '2000-10-25'


Name:
mo

ReproducibleScript:
interp create i

i eval {
    set env(VAR) 123455789ABCDEF
    append env(VAR) G

    puts "env(VAR) is \"$env(VAR)\""
}




ObservedBehavior:
This code is broken under tcl 8.0.4 but it works under tcl 8.1b1.

(under 8.1b1)
env(VAR) is "123455789ABCDEFG"


(under 8.0.4 and earlier)
env(VAR) is ""




DesiredBehavior:
The variable value should be "123455789ABCDEFGH", not "".

I attempted to figure out what was going on here
with little luck. I found that Tcl_AppendObjCmd
would call Tcl_ObjSetVar2 to append the "G" to
the array variable but after the append in
Tcl_ObjSetVar2 some write traces got invoked and
on the second write trace Tcl_ObjSetVar2 got
called again but this time the value of the var
got set to "". If this code is run outside of
a sub interp then it will invoke a single write
trace but a second write trace (the one that
incorrectly sets the value to "") will not get
run. Does anyone have any clue what is going on
here and how I can fix it?


Any help would be great.
Mo DeJong
dejong at cs.umn.edu




I've verified that this does happen.  Very odd.  Maybe a ref count bug.  However,
we will probably not take time to fix this as it has been fixed in 8.1.  Please
upgrade to get the fix.  03/13/1999 15:34 - rjohnson -
welch Closed ticket [218611ffff]. [History diff]2000-10-26 08:25:10
dgp Ticket [218611ffff]: 4 changes [History diff]2001-04-16 23:10:06
Log in (anonymous is fine) to add a comment.