Tcl_InitStubs failure crashes wish
Closed / Fixed1091431fffffffffffffffffffffffffffffffffCreated 22 years agoUpdated 21 years ago
Descriptionplain2004-12-26 20:12:58
On Linux and possibly other ELF-based systems, the global variable "tclStubsPtr" defined in tclStubLib.c may be shared by all extensions. That is, even though each shared library includes its own copy of the variable, the runtime loader will merge all copies into a single location. This causes serious problems if Tcl_InitStubs() ever fails. For example, if an extension that calls Tcl_InitStubs(..., "8.5", ...) is loaded into an 8.4 wish, then Tcl_InitStubs() sets tclStubsPtr to NULL, causing wish to immediately crash (if, as is the usual case, Tk was compiled with -DUSE_TCL_STUBS).
jenglishplain2004-12-27 03:37:09
Logged In: YES user_id=68433 Attached patch to generic/tclStubLib.c attempts to fix the problem. Unfortunately it can't really work without retroactively patching all the existing copies of wish8.4; when an extension that calls Tcl_InitStubs() is loaded into wish8.4, the runtime loader will use the copy of Tcl_InitStubs from libtk8.4.so, not the one from the extensions' library.
jenglishplain2004-12-27 03:37:11
File Added - 113585: tcl-stublib.patch
dgpplain2004-12-29 09:21:15
Logged In: YES user_id=80530 Is Feature Request 540378 relevant here?
kennykb Ticket [1091431fff]: 1 change
[History diff]2004-12-30 06:10:30
jenglish Closed ticket [1091431fff].
[History diff]2005-11-21 01:37:34
jenglishplain2005-11-21 01:37:35
Logged In: YES user_id=68433 Committing refreshed patch to CVS HEAD and backported to core-8-4 branch, so at least this will be fixed with 8.4.12. Also removed some TCL_STORAGE_CLASS monkey business that had no effect.
jenglish Ticket [1091431fff]: 2 changes
[History diff]2005-11-21 01:37:37
jenglishplain2005-11-21 01:37:40
File Added - 156958: tcl-stublib.patch
Log in (anonymous is fine) to add a comment.
Attachments:
- tcl-stublib.patch [download] added by jenglish on 2005-11-21 01:37:40. [details]