Hide Forgot
Description of problem: The tk libraries were built without threading built in. Version-Release number of selected component (if applicable): tk-8.5.7-5.el6 How reproducible: Every time Steps to Reproduce: 1. Run a python script dealing with tk and threads. --- import threading import Tkinter lbl = Tkinter.Label(text="hi") threading.Thread(target=lambda: lbl.configure(text="hi there")).start() lbl.mainloop() --- 2. Or do a ldd on libtk8.5.so 3. Actual results: 1) Script fails with 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 "python.tk.thread.py", line 5, in <lambda> threading.Thread(target=lambda: lbl.configure(text="hi there")).start() 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?) 2) There is no thread linked in you get # ldd /usr/lib64/libtk8.5.so linux-vdso.so.1 => (0x00007fffc2dff000) libX11.so.6 => /usr/lib64/libX11.so.6 (0x0000003ca5000000) libXft.so.2 => /usr/lib64/libXft.so.2 (0x0000003cad200000) libXrender.so.1 => /usr/lib64/libXrender.so.1 (0x0000003ca7000000) libfontconfig.so.1 => /usr/lib64/libfontconfig.so.1 (0x0000003ca6800000) libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x0000003ca6000000) libdl.so.2 => /lib64/libdl.so.2 (0x0000003ca2400000) libm.so.6 => /lib64/libm.so.6 (0x0000003ca2c00000) libc.so.6 => /lib64/libc.so.6 (0x0000003ca2000000) libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x0000003ca4c00000) libexpat.so.1 => /lib64/libexpat.so.1 (0x0000003ca6400000) /lib64/ld-linux-x86-64.so.2 (0x0000003ca1c00000) libXau.so.6 => /usr/lib64/libXau.so.6 (0x0000003ca5400000) Expected results: 1) A nice little window should pop up, without a traceback. 2) Somewhere in the ldd there should be "libpthread.so.0" Additional info: Although this looks like a tkinter bug, this page explains why it is a tk bug. http://bugs.python.org/issue3835#msg73304
This request was evaluated by Red Hat Product Management for inclusion in the current release of Red Hat Enterprise Linux. Because the affected component is not scheduled to be updated in the current release, Red Hat is unfortunately unable to address this request at this time. Red Hat invites you to ask your support representative to propose this request, if appropriate and relevant, in the next release of Red Hat Enterprise Linux. If you would like it considered as an exception in the current release, please ask your support representative.
TCL threading implementation does not work correctly with fork which can results in locking - it causes problems to customers, that's why it was disabled, bug #478961
TCL threading needs rewrite, because locking is dangerous. Closing as WONTFIX according to comment 3.
I am afraid that this will hit also Ruby, sooner or later. This message comes from Ruby build process: ***************************************************************************** ** ** NATIVETHREAD SUPPORT MODE WARNING: ** ** Ruby is compiled with --enable-pthread, but your Tcl/Tk library ** seems to be compiled without nativethread support. Although you can ** create the tcltklib library, this combination may cause errors (e.g. ** hangs or segmentation faults). If you have no reason to keep the ** current nativethread support status, we recommend you reconfigure and ** recompile the libraries so that both or neither support nativethreads. ** ** If you want change the status of nativethread support, please recompile ** Ruby without "--enable-pthread" configure option (If you use Ruby 1.9.x ** or later, you cannot remove this option, because it requires native- ** thread support.) or recompile Tcl/Tk with "--enable-threads" configure ** option (if your Tcl/Tk is later than or equal to Tcl/Tk 8.1). ** *****************************************************************************
This request was evaluated by Red Hat Product Management for inclusion in the current release of Red Hat Enterprise Linux. Because the affected component is not scheduled to be updated in the current release, Red Hat is unfortunately unable to address this request at this time. It has been proposed for the next release. If you would like it considered as an exception in the current release, please ask your support representative.
Cloning to tcl.
Thank you for submitting this issue for consideration in Red Hat Enterprise Linux. After careful review, we've determined that this is not technically feasible in Red Hat Enterprise Linux 6. We will continue to monitor the maturity of multi-threading capabilities in tcl/tk in the upstream project and will consider including it in a later major version of Red Hat Enterprise Linux. While we cannot make any commitment, this is likely a target for Red Hat Enterprise Linux 7.
Created attachment 1016964 [details] Backported fix I think that going the RHEL-5 way (i.e. having two tcl builds - one for threading and one for non-threading tcl) is not the best way to go. The original underlying problem (as reported in bug 478961) that lead to the disablement of the threading, has been recently fixed in Fedora by rebase. The attached patch is an attempt to backport the fix. It shouldn't break the API/ABI. With this patch applied the threading can be enabled and it no longer triggers the original bug 478961.
Created attachment 1016966 [details] Backported fix
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-2407.html