Tcl Source Code

View Ticket
Login
Ticket UUID: 5bd41844e62aceb2969f4f1ff60de84ad2291c4e
Title: tracing: (self) deleted command or coroutine after exit doesn't invoke leavestep handler, so it's not paired to enterstep
Type: Bug Version: any
Submitter: sebres Created on: 2025-03-18 18:58:08
Subsystem: 46. Traces Assigned To: sebres
Priority: 5 Medium Severity: Minor
Status: Pending Last Modified: 2025-03-23 18:37:14
Resolution: Fixed Closed By: nobody
    Closed on:
Description:

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.

User Comments: jan.nijtmans added on 2025-03-23 18:37:14:

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


sebres added on 2025-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.