From: Jan N. <jan...@gm...> - 2011-03-16 13:39:10
|
Hi, tcl-core members, I would like to start a discussion about [tcl-Bugs-3216070]. As I already described in: <https://sourceforge.net/tracker/index.php?func=detail&aid=1961211&group_id=10894&atid=110894> the RTLD_GLOBAL flag is dangerous. This is the first report I see related to Tcl describing this, even though it still is not fully understood what's happening here. Outside of Tcl, there are more examples, e.g.: <http://www.mail-archive.com/tnt...@li.../msg00168.html> My proposal would be to change the flag to RTLD_LOCAL, but there are situation where that would break: - [Tcl bug #1961211] would be re-introduced. - On platforms where SHLIB_LD_LIBS="", we will lose the dynamic loadability of libtk. Currently those platforms are: dgux* MP-RAS-* OSF1-1.* QNX-6* SCO_SV-3.2* SINIX*5.4* SunOS-4* UNIX_SV* | UnixWare-5* Most of them are removed now from TEA, the only two remaining are: QNX-6* SCO_SV-3.2* (I don't even know if dynamical loading of libtk works on those platforms anyway......) Two questions arise: - Do we still care about those 2 platforms? - If we do, could we make a change to: SHLIB_LD_LIBS='${LIBS}' maybe that just works, I don't think anyone tried that yet. Anyone???? Before we make this change, first there should be a clear view about what would break practically. If too much would break, I see two alternatives: - Let RTLD_LOCAL be the default, but provide a new option to load libraries using RTLD_GLOBAL - Only make the change in Tcl8.6, and flag it with *POTENTIAL INCOMPATIBILITY* Any other ideas? Regards, Jan Nijtmans 2011/3/16 SourceForge.net <no...@so...>: > Bugs item #3216070, was opened at 2011-03-16 12:37 > Message generated for change (Tracker Item Submitted) made by mxmanghi > You can respond by visiting: > https://sourceforge.net/tracker/?func=detail&atid=110894&aid=3216070&group_id=10894 > > Please note that this message will contain a full copy of the comment thread, > including the initial issue submission, for this request, > not just the latest update. > Category: 40. Dynamic Loading > Group: current: 8.5.9 > Status: Open > Resolution: None > Priority: 5 > Private: No > Submitted By: Massimo Manghi (mxmanghi) > Assigned to: Kevin B KENNY (kennykb) > Summary: Loading extension libraries from embedded Tcl applications > > Initial Comment: > 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. > > ---------------------------------------------------------------------- > > You can respond by visiting: > https://sourceforge.net/tracker/?func=detail&atid=110894&aid=3216070&group_id=10894 > > ------------------------------------------------------------------------------ > Colocation vs. Managed Hosting > A question and answer guide to determining the best fit > for your organization - today and in the future. > http://p.sf.net/sfu/internap-sfd2d > _______________________________________________ > Tcl-Bugs mailing list > Tcl...@li... > https://lists.sourceforge.net/lists/listinfo/tcl-bugs > |