Itk - the [incr Tk] extension

View Ticket
Login
Ticket Hash: 6cb97a121190134fb252351a6429a743046948d8
Title: infinite loop in iwidgets Panedwindow-2.5
Status: Closed Type: Code_Defect
Severity: Critical Priority: Immediate
Subsystem: Resolution: Fixed
Last Modified: 2017-07-28 16:44:39
Version Found In: 4.1.0
User Comments:
dgp added on 2017-07-11 19:24:19:
With the Iwidgets test suite:

$ make test TESTFLAGS='-file panedwindow.test -match "Panedwindow-1.1 Panedwindow-2.5"'
...
==== Panedwindow-2.5 configuration options, -orient FAILED
==== Contents of test case:

            .pw configure $option [lindex $test 1]
            lindex [.pw configure $option] 4

---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
---- errorInfo: too many nested evaluations (infinite loop?)
    while executing
"destroy .pw.sash1"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 destroy .pw.sash1"
    invoked from within
...
"destroy .pw.sash1"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 destroy .pw.sash1"
    invoked from within
"destroy $itk_component($sash)"
    (object "::.pw" method "::iwidgets::Panedwindow::_makeSashes" body line 12)
    invoked from within
"_makeSashes"
    (while configuring option "-orient" for widget "::.pw")
    invoked from within
".pw configure $option [lindex $test 1]"
    ("uplevel" body line 2)
    invoked from within
"uplevel 1 $script"
---- errorCode: TCL LIMIT STACK
==== Panedwindow-2.5 FAILED

dgp added on 2017-07-11 19:28:50:
The cause of the problem is that

uplevel #0 destroy $widget

is (properly) expecting that the namespace
of level #0 is the global namespace so that
"destroy" resolves to the Tk command "::destroy".

What is happening instead is that Itk has done
some shenanigans under the covers to force the
namespace of that frame to be ::iwidgets::Panedwindow
so that some resolutions in the config script
happen as they need to.

This is clearly an incorrect solution, and another
one has to be found, probably involving the pushing
and popping of a callframe.

dgp added on 2017-07-28 16:44:39:
Fixed in release 4.1.0