Artifacts Associated With Ticket 3216070
Ticket change [18af8c1fca] (rid 122701) by mxmanghi on 2011-03-16 11:37:48:
- assignee initialized to: "kennykb"
- cmimetype initialized to: "text/plain"
- comment initialized 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 initialized to: "obsolete: 8.5.9"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "mxmanghi"
- subsystem initialized to: "40. Dynamic Loading"
- title initialized to:
Loading extension libraries from embedded Tcl applications
- type initialized to: "Bug"
Add attachment "3216070.patch" [b0cede26e9] (rid 98042) by nijtmans on 2011-03-16 19:26:42.
Ticket change [22bae7cca9] (rid 130806) by nijtmans on 2011-03-16 19:26:42:
- icomment:
File Added - 404492: 3216070.patch
- login: "nijtmans"
- mimetype: "text/plain"
- username: "nijtmans"
- icomment:
Ticket change [07aafd748e] (rid 89445) by nijtmans on 2011-03-22 22:12:04:
- assignee changed to: "nijtmans"
- closedate changed to: "2011-03-22T15:12:04"
- closer changed to: "nijtmans"
- icomment:
allow_comments - 1 See discussion about this among TCT members: <https://sourceforge.net/mailarchive/message.php?msg_id=27211924> Conclusion: dlopen should use: (RTLD_NOW|RTLD_LOCAL) If this causes problems for anyone, please report this, there sure is another solution without breaking applications that embed Tcl (that's what this issue is about....). Fixed on trunk and core-8-5-branch. Untouched on core-8-4-branch.
- login: "nijtmans"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "nijtmans"
Ticket change [267692ac6d] (rid 88351) by andreas_kupries on 2011-03-25 01:38:32:
- icomment:
Note for people getting tripped by the reintroduced bug #1961211, notably on Darwin, i.e. OS X. If your library is linked using -flat_namespace and fails to load with a message like dyld: Symbol not found: ... Referenced from: ... Expected in: flat namespace Trace/BPT trap then this option has to be removed, and a possibly present -undefined suppress|warning as well, to make the library loadable again. This happened for Metakit.
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
- icomment: