RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 676880 - No threading in tcl / tk
Summary: No threading in tcl / tk
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: tk
Version: 7.0
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: 7.1
Assignee: Jaroslav Škarvada
QA Contact: Ondřej Lysoněk
Jana Heves
URL:
Whiteboard:
Depends On: 869315
Blocks: 782183 835616 1110700 1133060 1191021 1205796
TreeView+ depends on / blocked
 
Reported: 2011-02-11 16:52 UTC by Troy Dawson
Modified: 2019-09-12 07:39 UTC (History)
8 users (show)

Fixed In Version: tk-8.5.13-5.el7
Doc Type: Bug Fix
Doc Text:
Previously, the threading support in the Tool Command Language (TCL) was not implemented optimally. If the fork() call was used together with thread extension enabled in the TCL interpreter, the process could become unresponsive. Because of that, the TCL interpreter and the TK application were previously shipped with the thread extension disabled. As a consequence, third-party applications depending on threaded TCL or TK did not work correctly. A patch has been implemented to fix this bug, and TCL and TK now have the thread extension enabled by default.
Clone Of:
: 869315 (view as bug list)
Environment:
Last Closed: 2015-11-19 12:48:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Backported fix (10.67 KB, patch)
2015-04-21 16:02 UTC, Jaroslav Škarvada
no flags Details | Diff
Backported fix (10.67 KB, patch)
2015-04-21 16:07 UTC, Jaroslav Škarvada
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2407 0 normal SHIPPED_LIVE tk bug fix update 2015-11-19 11:11:31 UTC

Description Troy Dawson 2011-02-11 16:52:19 UTC
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

Comment 2 RHEL Program Management 2011-02-11 17:08:04 UTC
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.

Comment 3 Jaroslav Škarvada 2011-02-11 20:44:50 UTC
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

Comment 4 Jaroslav Škarvada 2011-02-14 14:38:11 UTC
TCL threading needs rewrite, because locking is dangerous. Closing as WONTFIX according to comment 3.

Comment 5 Vít Ondruch 2011-03-01 13:42:55 UTC
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).
**
*****************************************************************************

Comment 7 Suzanne Logcher 2012-03-15 15:28:42 UTC
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.

Comment 18 Jaroslav Škarvada 2012-10-23 14:56:57 UTC
Cloning to tcl.

Comment 29 Siddharth Nagar 2013-05-13 13:52:47 UTC
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.

Comment 32 Jaroslav Škarvada 2015-04-21 16:02:18 UTC
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.

Comment 33 Jaroslav Škarvada 2015-04-21 16:07:19 UTC
Created attachment 1016966 [details]
Backported fix

Comment 44 errata-xmlrpc 2015-11-19 12:48:16 UTC
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


Note You need to log in before you can comment on or make changes to this bug.