Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2003-10-03
01:08 • Closed ticket [807243ffff]: trace info empty op plus 7 other changes artifact: d49826367a user: dgp
2003-09-24
09:17 • Ticket [807243ffff]: 5 changes artifact: d14b8b8b57 user: dgp
09:11 • Add attachment 807243.patch to ticket [807243ffff] artifact: ed0b5001fd user: dgp
09:11 • Ticket [807243ffff] trace info empty op status still Open with 4 other chang... artifact: 5b8ef40b9d user: dgp
08:59 • Ticket [807243ffff]: 5 changes artifact: 27a94713e8 user: dgp
08:14 • Ticket [807243ffff]: 5 changes artifact: f4d939b1f5 user: dgp
07:09 • Ticket [807243ffff]: 4 changes artifact: 7bd0f2707d user: dgp
2003-09-16
16:31 • New ticket [807243ffff]. artifact: 51dfafceac user: markgsaye

trace info empty op

Closed / Fixed807243ffffffffffffffffffffffffffffffffffCreated 23 years agoUpdated 23 years ago
Descriptionplain2003-09-16 16:31:05
Consider:

proc test {args} {}

proc trace:command {oldName newName op} {
  puts "proc trace:command \[$oldName\] \[$newName\]
\[$op\]"
}

proc trace:execution {string op} {
   puts "proc trace:execution \[$string\] \[$op\]"
}

trace add command  ::test delete [list trace:command]
trace add execution ::test enter [list trace:execution]


Now doing:
% trace info command ::test
{delete trace:command} {{} trace:execution}

% trace info execution ::test
{{} trace:command} {enter trace:execution}

Note how the execution trace adds to the 'trace info
command' with an empty 'op', and vice versa.
dgpplain2003-09-24 07:09:09
Logged In: YES 
user_id=80530


Both [t i command] and [t i execution]
call on Tcl_CommandTraceInfo()
to introspect the traces, even though
Tcl_CTI is documented only to return
information on "command" traces,
not "execution" ones.

For 8.4.x, it seems the bogus entries
could be filtered out of the returned
lists.

For 8.5, these separate trace sets
should be separated in their
implementation as well.
dgpplain2003-09-24 08:14:57
Logged In: YES 
user_id=80530


Here's a test case inspired by the report:

test trace-31.1 {command and execution traces shared struct} {
    proc foo {} {}
    trace add command foo delete foo
    trace add execution foo enter foo
    set result [trace info command foo]
    rename foo {}
    set result
} [list [list delete foo]]


This test causes a segfault.

There are bigger problems here.
dgpplain2003-09-24 08:59:30
Logged In: YES 
user_id=80530


Ok, that's a separate problem.
Let's not confuse these matters.

That segfault is apparently due
to an attempt to trigger a delete
trace that calls the traced command.
That's pretty tricky; perhaps not
too surprising it's broken.
dgpplain2003-09-24 09:11:08
File Added - 62331: 807243.patch

Logged In: YES 
user_id=80530

here's an 8.4 patch just for
the reported problem.
dgpplain2003-09-24 09:17:10
Logged In: YES 
user_id=80530


Patch committed for 8.4.5

Bug still open on 8.5 branch
pending a better fix.
dgpplain2003-10-03 01:08:40
Logged In: YES 
user_id=80530

commiting same fix to HEAD.

Cleaner fixes will be a long time
in coming.  Test suite entry
should stop us making the same
bug again.
Log in (anonymous is fine) to add a comment.

Attachments: