Overview
| Artifact ID: | 18af8c1fca970e31d2b396e738550a56c4bc24b9 |
|---|---|
| Ticket: | 3216070fffffffffffffffffffffffffffffffff
Loading extension libraries from embedded Tcl applications |
| User & Date: | mxmanghi on 2011-03-16 11:37:48 |
Changes
- assignee changed to: "kennykb"
- cmimetype changed to: "text/plain"
- comment changed to:
Shared libraries providing Tcl extensions are loaded for the Unix family by the code in tclLoadDl.c, which interfaces Tcl with the dlopen(<library_path>,flags) system call. Tcl chose to set dlopen's flags argument as RTLD_NOW | RTDL_GLOBAL. Globally loading the extension symbols was found to crash an application (Apache Rivet) that embeds a Tcl interpreter, which in turn gains access to a subset of the application commands by loading an extension library. The application successfully loads the library by calling Tcl_PkgRequire, but crashes shortly after in a function unrelated to the extension library. Replacing Tcl_PkgRequire with a direct call to dlopen and passing RTLD_NOW | RTLD_LOCAL as second argument restores mod_rivet (and Apache) full functionality. On the other hand, it was also verified that setting in tclLoadDl.c the flags argument as RTLD_NOW | RTLD_LOCAL and building a custom Tcl installation against which Rivet gets linked, preserves Apache functioning even when the extension is loaded by calling Tcl_PkgRequire, thus fully identifying the problem with the RTLD_GLOBAL flag.
- foundin changed to: "obsolete: 8.5.9"
- is_private changed to: "0"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "mxmanghi"
- subsystem changed to: "40. Dynamic Loading"
- title changed to:
Loading extension libraries from embedded Tcl applications
- type changed to: "Bug"