From: SourceForge.net <no...@so...> - 2003-04-04 19:33:30
|
Bugs item #597847, was opened at 2002-08-20 10:16 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112997&aid=597847&group_id=12997 Category: 85. Unix Build Group: 8.5a0 Status: Open >Resolution: Fixed Priority: 8 Submitted By: Don Porter (dgp) Assigned to: Mo DeJong (mdejong) Summary: panic with thread-enabled Tcl Initial Comment: On Solaris 8 / CDE, with 8.4b3 Tcl/Tk, and gcc 3.0.3: Build Tcl: ./configure --enable-threads --disable-shared make Build Tk: ./configure --with-tcl=... --disable-shared make Try to run wish: ./wish Tcl_InitNotifier: unable to start notifier thread Abort ---------------------------------------------------------------------- >Comment By: Mo DeJong (mdejong) Date: 2003-04-04 11:49 Message: Logged In: YES user_id=90858 I checked the patch into the CVS HEAD, but I think some further testing is needed before checking this into the 8.4 branch. I am leaving this bug report open until later. As far as the runtime loading issue goes, I think that should be entered as a separate bug. ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2003-04-03 15:42 Message: Logged In: YES user_id=80530 that patch works great with all my build systems. IMO, it's ready to commit to HEAD for more widespread testing. ---------------------------------------------------------------------- Comment By: Mo DeJong (mdejong) Date: 2003-04-03 15:10 Message: Logged In: YES user_id=90858 Here is my second attempt at a Tk threads fixup. This patch removes a bunch of checks from the Tk configure script and uses TCL_LIBS instead. It should fix the dup lib problem you were running into. ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2003-04-03 10:38 Message: Logged In: YES user_id=80530 When I try the same patch on my Linux/Alpha box, the linking of wish fails because the -lieee flags ends up on the link line twice. This is because it is in WISH_LIBS twice. This is apparently because it comes in as part of @LIBS@ and part of @MATH_LIBS@ ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2003-04-03 10:06 Message: Logged In: YES user_id=80530 Thanks, Mo. With this patch, the problem I reported with a panic in wish goes away. Running `make test` is see test window-2.9 hang, but that's probably another bug, just exposed by the lack of an early failure. ---------------------------------------------------------------------- Comment By: Mo DeJong (mdejong) Date: 2003-04-03 02:57 Message: Logged In: YES user_id=90858 I poked around in the configure.in for Tk and it does look like the TCL_LIBS var set in tclConfig.sh is being ignored by Tk. One fix could be to just use this variable when linking wish. I don't see any calls to pthread functions anywhere in Tk, so I don't see why we need to check for them via a call to SC_ENABLE_THREADS in Tk's configure.in. I am worried that _REENTRANT will not get passed to the compiler if this call is removed, so that may need to get fixed. There are also some uses of TCL_THREADS in the Win and Mac versions of Tk, but I think the unix one is ok. Here is a patch the implements the change I propose, could someone give it a test run to see if things are working? The configure script change as of todays CVS is included. ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2003-03-27 15:16 Message: Logged In: YES user_id=80530 note that the definition for TCL_LIBS in the tclConfig.sh file correctly includes the -lpthread flag, telling all programs that plan to embed the Tcl library that it should be included in the link. Apparently, Tk's Makefile is not taking note of this for its wish build. ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2003-03-27 15:08 Message: Logged In: YES user_id=80530 the problem is that the -lpthread flag is missing when wish is linked. ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2003-03-27 15:02 Message: Logged In: YES user_id=80530 tracing a bit more, the calls to pthread_create() return -1. ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2003-03-26 15:37 Message: Logged In: YES user_id=80530 Same symptoms when using $ cc -V cc: Sun WorkShop 6 update 1 C 5.2 2000/09/11 as the compiler. ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2003-03-26 15:22 Message: Logged In: YES user_id=80530 same observations on the HEAD (8.5a0) ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2003-03-26 14:55 Message: Logged In: YES user_id=80530 claiming to attempt to reproduce with latest release. ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2002-08-26 09:51 Message: Logged In: YES user_id=80530 OK, is this only a compile-time constraint, or does it need to be enforce at runtime as well? Say I avoid conflicts at build time, and I build and install thread-disabled Tcl and Tk and thread-enabled Tcl and Tk. What happens when I try to [load] threaded-Tk into nonthreaded-Tcl? What happens when I try to [load] nonthreaded-Tk into threaded-Tcl ? If either of these combinations is invalid, then the package index script for Tk needs to prevent them, and that's more than just a TEA warning. ---------------------------------------------------------------------- Comment By: Jeffrey Hobbs (hobbs) Date: 2002-08-26 09:46 Message: Logged In: YES user_id=72656 IMO, the configuration setup was invalid, but was "allowed" technically. The new TEA prints out a big warning when you configure incompatibly in this way, and the only fix that is needed is to make Tk whine the same way regarding --enable- threads. ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2002-08-26 07:58 Message: Logged In: YES user_id=80530 It appears that the requirement for --enable-threads consistency with Tcl only arises because Tk includes the tclInt.h header file. An alternative fix then woulld be to remove that #include. ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2002-08-20 10:32 Message: Logged In: YES user_id=80530 If I configure Tk with --enable-threads as well, this problem goes away. So, if Tk and Tcl need to have the same --enable-threads choice to work, then they should not be separately configurable. Tk should just take whatever choice was made by the Tcl it is configured against. Also, since Tk is now dynamically [load]able, there may need to be checks added to Tk's pkgIndex.tcl file to be sure that a thread-enabled Tk library [load]s only in a thread-enabled Tcl interp, and vice versa. Would be a lot nicer if these two modules could be configured separately and still work, though. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112997&aid=597847&group_id=12997 |