From: <no...@so...> - 2001-12-28 19:40:21
|
Bugs item #220916, was opened at 2000-10-31 17:31 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=112997&aid=220916&group_id=12997 Category: 61. Tk_Win Functions Group: = 8.3.1 Status: Open Resolution: None Priority: 5 Submitted By: Brent B. Welch (welch) Assigned to: Don Porter (dgp) Summary: Tk commands callable before Tk_Init bombs accessing Tcl stub table Initial Comment: OriginalBugID: 5494 Bug Version: 8.3.1 SubmitDate: '2000-05-15' LastModified: '2000-05-15' Severity: SER Status: UnAssn Submitter: techsupp ChangedBy: hobbs RelatedBugIDs: 2269 OS: All Windows Name: Per Mildner ReproducibleScript: There are Tk_ routines that can reasonably be called before Tk_Init (and thus Tcl_InitStubs) is called. In particular Tk_GetNumMainWindows (should return zero) and Tk_MainWindow (explicitly documented as callable on non-Tk interpreters), perhaps there are more. When Tk is built using TCL stubs (always the case on Windows) these routines will crash while trying to access Tcl_GetThreadData trough the (NULL) Tcl stub table. The patch for Bug DB ticket#2269 solves this problem in another context and could be adapted. (explicitly check for tclStubsPtr==NULL) ---------------------------------------------------------------------- >Comment By: Don Porter (dgp) Date: 2001-12-28 11:40 Message: Logged In: YES user_id=80530 Looking this over, I think the submitter is correct. There are some Tk_* routines that one may want/need to call before calling Tk_Init on any interp. Those routines should work (or at least return a sensible error message instead of crashing) before Tcl stubs have been initialized. Most Tk_* routines -- that operate on an interp assumed to have Tk loaded in it -- do not need this capability. This issue should only arise when one writes his own "big wish" application, and does not make use of Tk_Main(). A possible workaround would be for someone needing this to build a copy of Tk without -DUSE_TCL_STUBS. Only folks coding in C need this, and they have the ability to build their own Tk libraries from source in such a way that they don't need it anymore. Next step would be to compose a list of the Tk_* routines needing this improvement. ---------------------------------------------------------------------- Comment By: Jeffrey Hobbs (hobbs) Date: 2001-12-27 16:47 Message: Logged In: YES user_id=72656 While it notes that Tk_MainWindow can be called on non-Tk interpreters, it doesn't explicitly say it can be called before Tk has been initialized. In fact, I don't seem to see that for any function. If you look at bug #219996, which is the source of the above mentioned (with patch in #220542), the cause is harder to avoid because the Tk dll just has to exist and it blows on dll unload. Referring this to dgp as he was working on this before, and can comment on the validity here. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=112997&aid=220916&group_id=12997 |