Author pitrou
Recipients PythonInTheGrass, amaury.forgeotdarc, belopolsky, cgohlke, loewis, pitrou, terry.reedy
Date 2011-02-05.15:21:42
SpamBayes Score 2.96763e-13
Marked as misclassified No
Message-id <1296919303.13.0.0120885436984.issue11077@psf.upfronthosting.co.za>
In-reply-to
Content
The "UpdateStringProc should not be invoked for type cmdName" message (as quoted above in the traceback) apparently can mean that there's a mismanagement of Tcl reference counts.

From http://sourceforge.net/tracker/?func=detail&atid=110894&aid=1326087&group_id=10894:

“This crash (actually, a panic) hints at defective Tcl_Obj
handling - possibly in the core, more likely in an extension
if you're using one. It indicates that Tcl_GetString() or
Tcl_GetStringFromObj() has been called on a cmdNameType
Tcl_Obj that has no string representation, a state that
should never occur.”

Intuitively, cmdNameType seems to refer to createcommand() / deletecommand(). Also, the following code in Tkinter.py looks a bit suspicious:

    def after(self, ms, func=None, *args):
        """Call function once after given time.

        MS specifies the time in milliseconds. FUNC gives the
        function which shall be called. Additional parameters
        are given as parameters to the function call.  Return
        identifier to cancel scheduling with after_cancel."""
        if not func:
            # I'd rather use time.sleep(ms*0.001)
            self.tk.call('after', ms)
        else:
            def callit():
                try:
                    func(*args)
                finally:
                    try:
                        self.deletecommand(name)
                    except TclError:
                        pass
            name = self._register(callit)
            return self.tk.call('after', ms, name)

That is, we call deletecommand() while the command is still being executed.
Perhaps that, together with concurrent memory allocation from another thread (Tcl_Alloc() doesn't use Python's "Tcl lock"), might explain why the cmdName or other things sometimes become corrupted ("Tcl_DeleteCommand deletes a command from a command interpreter. Once the call completes, attempts to invoke cmdName in interp will result in errors").
History
Date User Action Args
2011-02-05 15:21:43pitrousetrecipients: + pitrou, loewis, terry.reedy, amaury.forgeotdarc, belopolsky, cgohlke, PythonInTheGrass
2011-02-05 15:21:43pitrousetmessageid: <1296919303.13.0.0120885436984.issue11077@psf.upfronthosting.co.za>
2011-02-05 15:21:42pitroulinkissue11077 messages
2011-02-05 15:21:42pitroucreate