Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2024-02-03
14:47 • Closed ticket [fe4d7305a8]: Renaming history command results in infinite loop</i... artifact: 729c9f137f user: kjnash
2018-07-09
17:27 • New ticket [fe4d7305a8]. artifact: e089fc5d5f user: euller

Renaming history command results in infinite loop

Closed / Fixedfe4d7305a87451030c8e87ab22e314c8bdbb4ca1Created 8 years agoUpdated 3 years ago
Descriptionplain2018-07-09 17:27:48
The issue is related to renaming the history command. Upon rename, the interpreter enters recursion, which triggers an infinite loop error.

Steps to reproduce:

- Run the following code with Tcl version 8.6.4. There are no errors issued:
~~~
    % rename history _history
    % proc history {args} {_history {*}$args}
    % history add example_cmd
~~~

- Run the same code under version 8.6.8. The execution errors out with the following message:
~~~
    too many nested evaluations (infinite loop?)
~~~
kjnashplain2024-02-03 14:47:33
The bug (renaming ::history) has been fixed.  It is not present in Tcl 8.6.13.

::history is a proc that calls the binary command ::tcl::history.  If ::history is renamed or deleted, the interpreter regenerates the proc ::history.

However this regeneration has a bug of its own - see [8e666d7c95]
Log in (anonymous is fine) to add a comment.