[Tkinter-discuss] Tcl/TK issue with viewVC (UNCLASSIFIED)

Michael Lange klappnase at web.de
Fri Mar 29 20:48:07 CET 2013


Hi,

On Fri, 29 Mar 2013 16:01:46 +0000
"Glasgow, Steven R CIV USARMY TRADOC ANALYSIS CTR (US)"
<steven.r.glasgow.civ at mail.mil> wrote:

(...)
> Exception in thread Thread-1:
> Traceback (most recent call last):
>   File "/usr/lib64/python2.​6/threading.py", line 532, in
> __bootstrap_inner self.run()
>   File "/usr/lib64/python2.​6/threading.py", line 484, in run
>     self.__target(*self.__args, **self.__kwargs)
>   File "/awars2a/Applicatio​ns/viewvc/viewvc-1.1​.18/bin/standalone.p​
> y", line 421, in serve ViewVCHTTPServer(host, port,
> callback).serve_until_quit() File "/awars2a/Applicatio​
> ns/viewvc/viewvc-1.1​.18/bin/standalone.p​y", line 349, in __init__
> BaseHTTPServer.HTTPS​erver.__init__(self,​ self.address, self.handler)
> File "/usr/lib64/python2.​6/SocketServer.py", line 403, in __init__
> self.server_activate() File "/awars2a/Applicatio​ns/viewvc/viewvc-1.1​
> .18/bin/standalone.p​y", line 361, in server_activate self.callback
> (self) File "/awars2a/Applicatio​ns/viewvc/viewvc-1-1​
> -18/bin/standalone.p​y", line 671, in ready self.title_lbl.confi​g
> (text='ViewVC standalone server at\n' + server.url) File
> "/usr/lib64/python2.​6/lib-tk/Tkinter.py"​, line 1202, in configure
> return self._configure('configure', cnf, kw) File "/usr/lib64/python2.​
> 6/lib-tk/Tkinter.py"​, line 1193, in _configure self.tk.call(_flatten
> ((self._w, cmd)) + self._options(cnf)) TclError: out of stack space
> (infinite loop?)
> 
> I first tried getting support from the viewVC community, but were told,
> "Looks like a problem in the Tcl/TK Python bindings."  They thought I
> might want to raise my issue with the community that maintains those
> bindings and that maybe someone there might quickly recognize the
> problem and give me (or the viewVC community) immediate feedback on a
> solution.

I haven't looked deeply into this, but several sources suggest that this
error might be caused by a Tk that is compiled without thread support.
You can check if the Tk your Tkinter uses supports threads with:

    $ python
    Python 2.6.6 (r266:84292, Dec 27 2010, 00:02:40) 
    [GCC 4.4.5] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from Tkinter import *
    >>> root = Tk()
    >>> root.tk.call('info', 'exists', 'tcl_platform(threaded)')
    1
    >>> 

Apparently, if this call returns 0 instead, threads are not suported.

I also found the following example:
http://stackoverflow.com/questions/14521319/tkinter-threads-exception-out-of-stack-space-infinite-loop
where the same error message was caused by a buggy implementation of
threads in a Tkinter app (they tried to call mainloop() from a child
thread there, which is certainly a bad idea ;) , so from the little I
know I would not bet my savings that the app in question is innocent
either; maybe you can look through their code, in case the application is
not too complex, to make sure that none of the program's child threads
does touch Tk (something that should be avoided at any rate because
it will make the app behave more or less unpredictable)?

Regards

Michael


.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

Violence in reality is quite different from theory.
		-- Spock, "The Cloud Minders", stardate 5818.4


More information about the Tkinter-discuss mailing list