Skip to content
Tcl Source Code View Ticket
Login

View Ticket

tracing: (self) deleted command or coroutine after exit doesn't invoke leavestep handler, so it's not paired to enterstep

Closed / Fixed5bd41844e62aceb2969f4f1ff60de84ad2291c4eCreated 2 years agoUpdated 42 days ago
Descriptionwiki2025-03-18 18:58:08
Execution trace (leave or leavestep handler) will be avoided if command gets deleted during the executing and tracing process, so the leave/leavestep calls becomes unpaired to the enterstep calls (no matter how deep by nesting/recursion).

The same is also valid for coroutine after its exit (what basically equal to its deletion) and probably therefore more important here, because the deletion is not avoidable in case of coro.

The traces behind the behaviour lead to [571385ffffffffffffff], where the "fix" was introduced as preventive measures against a segfault, but the root of that issue was obviously different (and also already fixed now, I guess with the NRE).

The fix is more or less trivial, so I'll provided it as a branch soon.

sebreswiki2025-03-19 15:12:19

There is new 8.6-based branch bug-5bd41844e6-coro-exec-trace that fixes the behaviour (see new tests).

I'm waiting for a feedback... Tests and reviews are welcome.

sebres Ticket [5bd41844e6]: 3 changes [History diff]2025-03-19 15:12:28
sebres Ticket [5bd41844e6]: 3 changes [History diff]2025-03-21 11:39:21
jan.nijtmanswiki2025-03-23 18:37:14

Looks good to me. And gibhub actions tell's it's OK too!

serhiy.storchakawiki2026-10-15 11:29:07

Closing: fixed, see above.

serhiy.storchaka Ticket [5bd41844e6]: 3 changes [History diff]2026-10-22 17:19:26
Log in (anonymous is fine) to add a comment.