Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2001-11-22
02:55 • Ticket [453805ffff] Tcl_Preserve CommandTraces in CallCommandTraces status s... artifact: 1e1e08fb6e user: dgp
02:55 • Closed ticket [453805ffff]. artifact: 64949a3d56 user: dgp
2001-11-21
22:35 • Ticket [453805ffff]: 5 changes artifact: a6b1fc59e8 user: dkf
18:55 • Ticket [453805ffff]: 5 changes artifact: da5b729b28 user: msofer
07:07 • Add attachment cmdtrace.patch to ticket [453805ffff] artifact: 3b8e29546e user: dgp
07:07 • Ticket [453805ffff] Tcl_Preserve CommandTraces in CallCommandTraces status s... artifact: 45058681a8 user: dgp
06:05 • Ticket [453805ffff]: 4 changes artifact: 23542ece9b user: dgp
2001-09-20
16:38 • Ticket [453805ffff]: 4 changes artifact: 4210830280 user: dkf
03:26 • Ticket [453805ffff]: 4 changes artifact: ef757be75e user: dgp
03:19 • Ticket [453805ffff]: 4 changes artifact: 658c65cbd3 user: hobbs
02:10 • Ticket [453805ffff]: 5 changes artifact: c52e6ddb77 user: dgp
2001-09-07
23:12 • Ticket [453805ffff]: 4 changes artifact: 4335272291 user: dgp
21:16 • Ticket [453805ffff]: 5 changes artifact: 520f6de493 user: msofer
03:55 • Ticket [453805ffff]: 5 changes artifact: 2adb49ecfb user: vincentdarley
2001-08-23
23:00 • Ticket [453805ffff]: 4 changes artifact: ffb68adc6f user: dgp
22:15 • Ticket [453805ffff]: 4 changes artifact: 3bec0194c6 user: vincentdarley
20:26 • Ticket [453805ffff]: 4 changes artifact: b68a75295e user: dgp
19:44 • Ticket [453805ffff]: 5 changes artifact: 65ed5e6dfc user: msofer
2001-08-22
01:01 • Ticket [453805ffff]: 4 changes artifact: a7af3be3f5 user: msofer
00:23 • Ticket [453805ffff]: 4 changes artifact: a0253a6d49 user: dgp
2001-08-21
23:26 • Ticket [453805ffff]: 6 changes artifact: 5669c14d46 user: hobbs
16:12 • New ticket [453805ffff]. artifact: e1f7fe93aa user: msofer

Tcl_Preserve CommandTraces in CallCommandTraces

Closed / Fixed453805ffffffffffffffffffffffffffffffffffCreated 25 years agoUpdated 25 years ago
Descriptionplain2001-08-21 16:12:22
Tcl Version: 8.4a3 (today's HEAD)
OS: linux 2.2.19 (RH 6.2)
Compiler: egcs-2.91.66 (gcc)
Comp flags: default + "-march=pentiumpro"

Description: segfault in trace.test

  ./configure --disable-shared
  make
  make test

All is OK till here,  _but_:

[mig@mini unix]$ ./tcltest ../tests/trace.test  
Segmentation fault (core dumped)
[mig@mini unix]$ ./tcltest ../tests/trace.test -verbose
trace.test:     Total   185     Passed  185     Skipped
0       Failed  0

Categorizing as "tcltest" bug due to the different
behaviour when verbose switch is on; may well be a bug
somewhere else though ...
hobbsplain2001-08-21 23:26:55
Logged In: YES 
user_id=72656

This is likely due to a bug in the actual trace changes in 
8.4, which should be hunted down.  Assigning back to Miguel 
since he can reproduce this.  Might need to go to Vince.
dgpplain2001-08-22 00:23:47
Logged In: YES 
user_id=80530


This is very likely related to bug 219393.

I don't see segfaults, but:
trace.test:     Total   185     Passed  185     Skipped
0      
Failed  0
clover:unix: ./tcltest ../tests/trace.test -verbose

==== trace-9.1 be sure variable is unset before trace is
called FAILED
==== Contents of test case:

    catch {unset x}
    set x 33
    set info {}
    trace add variable x unset {traceCheck {uplevel set x}}
    unset x
    set info

---- Result was:
1 {can't read "x": no such variaale}
---- Result should have been (exact matching):
1 {can't read "x": no such variable}
==== trace-9.1 FAILED

trace.test:     Total   185     Passed  184     Skipped
0       Failed  1

Note the memory corruption mangling the error message.
msoferplain2001-08-22 01:01:59
Logged In: YES 
user_id=148712

Doh ... today's head would be 8.4a4, not 8.4a3!
msoferplain2001-08-23 19:44:49
Logged In: YES 
user_id=148712

Vince: any ideas?
dgpplain2001-08-23 20:26:05
Logged In: YES 
user_id=80530

Does application of Patch 402501 have any
effect on solving this bug?
vincentdarleyplain2001-08-23 22:15:33
Logged In: YES 
user_id=32170

I have to say I have no obvious ideas of how the 8.4 
changes would have affected this at all.  I've never seen 
the problem, but can try to reproduce it.
dgpplain2001-08-23 23:00:42
Logged In: YES 
user_id=80530

Patch 402501 is now updated.
vincentdarleyplain2001-09-07 03:55:03
Logged In: YES 
user_id=32170

With both debug and release builds and with and without '-
verbose' I can't reproduce this on my Win2000 setup, so I'm 
afraid I'm not going to be able to help.  I really can't 
think what can have changed here.
msoferplain2001-09-07 21:16:38
Logged In: YES 
user_id=148712

It's a miracle, the bug seems to have fixed itself! I cannot
reproduce it anymore with today's HEAD.

As nobody seems to have found a probable cause, I'd be
tempted to "close" or at least "works for me" the ticket if
the segfault can't be reproduced. 

Assigning to Don: is it also fixed in your setup?
dgpplain2001-09-07 23:12:50
Logged In: YES 
user_id=80530

Don't close it.  I confirm that the CVS HEAD
no longer demonstrates the bug while
running the trace.test, but in another
patched version of Tcl, I do still see a
segfault in trace.test.  There's still a
memory corruption problem in there.

It might be the one identified in bug
219393, or it's possible it could be 
another one.  Let's check again after
219393 is fixed.
dgpplain2001-09-20 02:10:28
Logged In: YES 
user_id=80530

Latest commits brought back memory corruption
in test trace-9.1 for me.  Did it bring back
segfaults for others?

Increasing priority, so I'll actually get around
to fixing this.
hobbsplain2001-09-20 03:19:12
Logged In: YES 
user_id=72656

which latest commits?  I still don't see anything (nor did 
I before) on Linux or Windows.
dgpplain2001-09-20 03:26:31
Logged In: YES 
user_id=80530

Not to worry, Jeff.  You haven't caused anything to go
wrong.

There's a memory corruption bug in the machinery of
[trace].  I believe it's the bug described in 219393.
The bug's existence is constant.  The bugs visibility
during 'make test' comes and goes depending on how
unrelated code changes shift the memory corruption into
areas where it does/doesn't matter.  The commits of
2001-09-19 shifted it back into visibility for me.

As we've established many times before, the memory allocator
on Linux/Alpha tends to re-use freed memory more rapidly
than many other platforms, so memory corruption bugs 
often make themselves visible only there.
dkfplain2001-09-20 16:38:03
Logged In: YES 
user_id=79902

219393 is a nasty bug, but fixing it will require an API
change.  In my spare moments (hah!) I'm working on the TIP
required...
dgpplain2001-11-21 06:05:05
Logged In: YES 
user_id=80530

Now that TIP 68 took care of the big problem, we
can focus again on clearing away all memory problems
with traces.

Running the test suite with ElectricFence reveals
that CallCommandTraces() in tclBasic.c needs some
Tcl_Preserve() calls.  Patch coming soon.
dgpplain2001-11-21 07:07:58
File Added - 13607: cmdtrace.patch

Logged In: YES 
user_id=80530

Here's the patch.  Assigning to maintainer for review and
commit.
msoferplain2001-11-21 18:55:14
Logged In: YES 
user_id=148712

The patch lokks fine to me; testsuite approves too, on
linux. As it patches tclCmdMZ.c, I'll ask Donal to give his
OK too before committing.
dkfplain2001-11-21 22:35:14
Logged In: YES 
user_id=79902

The tclCmdMZ.c changes look OK to me (the preservations are
all done on internal structures so there are no non-obvious
requirements on extensions using command traces, which is
what I was really looking for.)  Assigning back to Don for
commit (and ChangeLog entry, which is main thing missing.)
dgpplain2001-11-22 02:55:43
Logged In: YES 
user_id=80530

committed to HEAD.
dgp Ticket [453805ffff]: 2 changes [History diff]2001-11-22 02:55:44
Log in (anonymous is fine) to add a comment.

Attachments: