| Ticket UUID: | 708422a066c634e914c10fdf21bac97f239d602 | ||
| Title: | unset traces enable calling an object command mid-destruction | ||
| Type: | Bug | Created on: | 2024-09-04 04:13:52 |
| Submitter: | andy | Assigned to: | dkf |
| Subsystem: | 35. TclOO Package | Severity: | Severe |
| Priority: | 5 Medium | Last modified: | 2024-09-17 08:36:44 |
| Status: | Closed | Closed by: | dkf |
| Resolution: | Duplicate | Closed on: | 2024-09-17 08:36:44 |
| Version: | 8.6.14 | ||
| Description: | ||||
|
unset traces can inject arbitrary code right in the middle of destroying an object. In this halfway state, the object command exists, [info object isa object] says it's valid, but the object namespace is gone. Deleting the object namespace is what triggers the unset trace. The following code dies with SIGSEGV inside TclOOGetCallContext (tclOOCall.c:1024) when it does
The above prints:
For now, my workaround is to check for namespace existence in my unset trace, allowing me to distinguish between variables being unset for normal reasons and variables being unset because the object is being destroyed. | ||||
| User Comments: | ||||
oehhar added on 2024-09-09 08:46:19:
TTT meeting today accknowledged this bug but does not want to delay 9.0.0 for this. It is planned to address this in 9.0.1. Harald dkf added on 2024-09-16 14:58:29:
This is very tricky. The problem is that once the namespace itself has started to go, lookup of things gets very very messy. I'd not thought about using unset traces to put callbacks in at that point; I need to extend the battery of tests for destruction sequences a bit more. I'm guessing that the resolution will be to make Thank you for reporting this! dkf added on 2024-09-16 15:58:21:
Seems to be a duplicate of [7842f33a5c], which wasn't fixed in 8.6.14 but has been fixed since. But I like the test case. | ||||
