summaryrefslogtreecommitdiffstats
path: root/tests/trace.test
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2001-12-07 13:55:59 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2001-12-07 13:55:59 (GMT)
commite69719ee4125cc09779401e3dda6c4b67651d382 (patch)
treebe9d02ee7c40c6fd4919fc83c406315d3807c43d /tests/trace.test
parent6425a01b7a2896172c65f9883f0b56792a6fd263 (diff)
downloadtcl-e69719ee4125cc09779401e3dda6c4b67651d382.zip
tcl-e69719ee4125cc09779401e3dda6c4b67651d382.tar.gz
tcl-e69719ee4125cc09779401e3dda6c4b67651d382.tar.bz2
restored consistency in refCount accounting by array traces [Bug #4484339]
Diffstat (limited to 'tests/trace.test')
-rw-r--r--tests/trace.test16
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/trace.test b/tests/trace.test
index beab9c6..6a5cc88 100644
--- a/tests/trace.test
+++ b/tests/trace.test
@@ -11,7 +11,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: trace.test,v 1.15 2001/12/05 20:43:58 msofer Exp $
+# RCS: @(#) $Id: trace.test,v 1.16 2001/12/07 13:55:59 msofer Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -56,6 +56,18 @@ proc traceCommand {oldName newName op} {
global info
set info [list $oldName $newName $op]
}
+
+test trace-0.0 {memory corruption in trace (Tcl Bug 484339)} {
+ # You may need Purify or Electric Fence to reliably
+ # see this one fail.
+ catch {unset z}
+ trace add variable z array {set z(foo) 1 ;#}
+ set res "names: [array names z]"
+ catch {unset ::z}
+ trace variable ::z w {unset ::z; error "memory corruption";#}
+ list [catch {set ::z 1} msg] $msg
+} {1 {can't set "::z": memory corruption}}
+
# Read-tracing on variables
test trace-1.1 {trace variable reads} {
@@ -913,7 +925,7 @@ test trace-15.3 {special list-handling in trace commands} {
trace add variable "x y z(a\n\{)" write traceProc
set "x y z(a\n\{)" 33
set info
-} "{x y z} a\\n\\{ write"
+} "{x y z} a\\n\\\{ write"
# Check for proper handling of unsets during traces.