| Ticket UUID: | 29e8848eb9766b81413989ad8125b0c22d1d2c7e | ||
| Title: | calling an imported alias in a deletion trace on the alias causes Tcl to cycle on routine resolution | ||
| Type: | Bug | Created on: | 2020-08-10 14:03:11 |
| Submitter: | pooryorick | Assigned to: | nobody |
| Subsystem: | - New Builtin Commands | Severity: | Minor |
| Priority: | 5 Medium | Last modified: | 2020-08-17 16:39:55 |
| Status: | Open | Closed by: | nobody |
| Resolution: | Fixed | Closed on: | |
| Version: | |||
| Description: | ||||
|
A command is typically available while its deletion is in progress:
Output:
However, in the case of an imported alias, the result is instead an infinite loop in command dispatch:
Output:
What's happening here is that
A script-level workaround is to lookup up the alias and call it directly:
| ||||
| User Comments: | ||||
sebres added on 2020-08-10 19:17:53:
@Nathan: Is the fix [7eed2baf73] really fulfilled? Looks a bit strange. Because a new flag In this case alternative diff (doing the same as your code without new flag CMD_DEAD) relative previous version would be something like that:
Just... sebres added on 2020-08-10 19:31:09:
Here is alternative branch without new (unneeded?) flag CMD_DEAD. pooryorick added on 2020-08-10 19:56:27:
Yes, I created the new sebres added on 2020-08-11 08:01:54:
Sure, just I don't see why in pooryorick added on 2020-08-11 09:39:37:
I think my initial report answers that question: A command should be available
for calling in any deletion traces that are evaluated during the course of its
deletion. sebres added on 2020-08-11 10:22:24:
I'm agree, just I'm trying to follow where is this new flag CMD_DEAD really expected. For instance see my alternative branch (without CMD_DEAD at all). Everything works, the new test "namespace-57.0" is passed too. So either CMD_DEAD is completely superfluous at the moment or the test "namespace-57.0" is missing something yet (so would work within your commit and would fail in my branch bug-29e8848eb976-alt). At the moment I can still not follow from the test why this CMD_DEAD is expected at all. pooryorick added on 2020-08-11 17:39:05:
If the caller of sebres added on 2020-08-11 18:33:56:
Although I've "fixed" this new test in the manner how the branch work - invocation of deleting command in trace is prohibited; test case namespace-57.1 is covering "attempt to invoke a deleted command" now, I'm confused a bit. Related to Tcl 8.6 (before [7eed2baf73fbb1f9]) the fix that Nathan provided for this is rather a regression, because this test-case works exactly so as in my branch ("attempt to invoke a deleted command"). But related to Tcl 8.5 rather old 8.6th handling (and my branch) would be a regression (there it's possible to invoke the command in trace during a deletion)... So I'd really like to listen the opinion of TCT about the issue. pooryorick added on 2020-08-12 08:00:13:
To put the difference succinctly, sebres' fix treats a deletion trace on a routine as a post-deletion action, and my fix treats it as a pre-deletion action. | ||||
