|
2026-11-18
| ||
| 14:54 | Fix [281138]: unexpected 'result' in trace execution leave check-in: 203474325b user: jan.nijtmans tags: core-9-0-branch | |
| 14:25 | Fix [281138]: unexpected 'result' in trace execution leave check-in: f3c792fd13 user: jan.nijtmans tags: trunk, main | |
|
2026-10-17
| ||
| 06:59 | • Ticket [2811381fff] unexpected 'result' in trace execution leave sta... artifact: b52a03a3b4 user: serhiy.storchaka | |
| 06:58 | Fix [2811381fff]: since 8.5 each leave or leavestep trace got the result of the previous trace inste... check-in: 6fd61eb7c4 user: serhiy.storchaka tags: leave-trace-own-result | |
|
2014-09-23
| ||
| 11:07 | • Ticket [2811381fff] unexpected 'result' in trace execution leave sta... artifact: 6d7ed4afad user: anonymous | |
|
2009-06-24
| ||
| 08:48 | • New ticket [2811381fff]. artifact: e8f12d7eac user: quantifier | |
| Ticket UUID: | 2811381 | ||
| Title: | unexpected 'result' in trace execution leave | ||
| Type: | Bug | Created on: | 2009-06-24 08:48:13 |
| Submitter: | quantifier | Assigned to: | dgp |
| Subsystem: | 46. Traces | Severity: | Minor |
| Priority: | 5 Medium | Last modified: | 2026-10-17 06:59:46 |
| Status: | Open | Closed by: | nobody |
| Resolution: | None | Closed on: | |
| Version: | 8.6.18, 9.0.5, 9.1.0 | ||
| Description: | ||||
trace manpage says:
For leave and leavestep operations: command command-string code result op
[...] result [gives] the result string.
When multiple traces are set on name, then [...] for leave and leavestep operations, the traced commands are invoked in the original order of creation.
However, it doesn't say that the 'result' is taken from original command only for first trace. Each following trace takes 'result' from previous traced command. This is not completely unwanted, but rather unexpected. For multiple traces, each of them has to return it's 'result' argument, in other case next trace might fail. Manual should be clearer on that.
Example:
% proc traced {} {return hello}
% proc trace_1st {cmdstr code result op} {puts "first: $result"; return first}
% trace add execution traced leave trace_1st
% traced
first: hello
hello
% proc trace_2nd {cmdstr code result op} {puts "second: $result"; return second}
% trace add execution traced leave trace_2nd
% traced
first: hello
second: first
hello
%
| ||||
| User Comments: | ||||
serhiy.storchaka added on 2026-10-17 06:59:46:
8.4 passed the result of the traced command to every leave trace; since 8.5 TclCheckExecutionTraces() and TclCheckInterpTraces() restore the saved result only after the last trace, so each trace gets the result of the previous one. The documentation describes the 8.4 behaviour. Proposed fix in branch leave-trace-own-result: restore the result after each trace. Test trace-40.2. | ||||
