Artifacts Associated With Ticket 3033027
Ticket change [43d8e5a9e7] (rid 116627) by petasis on 2010-07-22 11:47:32:
- assignee initialized to: "kennykb"
- cmimetype initialized to: "text/plain"
- comment initialized to:
I have observed that under OS X 10.6 (at least), libraries loaded with Tcl's load are not visible from other libraries, also loaded with load. Thus if you load a library A, and then load a library B that depends on A, library B is not loaded if A does not resides on a directory the dynamic linker searches for libraries. It is not recognised that library A is already loaded in the process. This seems OS X specific, as I cannot reproduce at least under windows & linux. I know that load calls dlopen(..., RTLD_GLOBAL); which does not seem to do as advertised. I had to call NSAddImage(NSADDIMAGE_OPTION_RETURN_ON_ERROR | NSADDIMAGE_OPTION_WITH_SEARCHING | NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME ), after I loaded lib A, to be able to load lib B. However, NSAddImage is already deprecated in 10.6. The relevant thread is here: http://groups.google.gr/group/comp.lang.tcl/browse_thread/thread/87266afd63143a11/f9b735ee56100d57
- foundin initialized to: "obsolete: 8.6b1"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "petasis"
- subsystem initialized to: "40. Dynamic Loading"
- title initialized to:
load: loaded shared libraries don't export symbols (OS X)
- type initialized to: "Bug"
Ticket change [6374d576a3] (rid 92582) by petasis on 2010-07-22 18:48:12:
- assignee changed to: "das"
Ticket change [67cc2699b5] (rid 102953) by ferrieux on 2010-07-22 19:41:15:
- icomment:
On second thought, I realize that the error message is not at the symbol level, but at the dependency level, so indeed RTLD_GLOBAL is not really concerned. Now, there are two ways of loading a library: either implicitly through dependency, or programmatically with dlopen(). A is loaded through dlopen(), then B too, and B implicitly needs A, but at this point in time, A is *not* "implicitly loaded". So, *if* OSX maintains two separate lists of dylds, one implicitly loaded, the other dlopened(), that could explain the behavior. Daniel, is this possible ? And if it is the case, then the solution is to refactor A so that it contains only the Tcl API entry points needed for an extension, and shove all the useful shareable code into a 3rd library C, on which A depends. Hence, [load A] also loads C but on the implicit list. Then do the same for B, and C should be reused as is.
- login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Ticket change [b3ce54497e] (rid 124916) by das on 2010-07-26 03:10:39:
- icomment:
Can you clarify the versions of Tcl and OS X involved? tcl/unix/tclLoadDyld.c was switched to use RTLD_GLOBAL on 2009-04-10, anything built from sources earlier than that is using RTLD_LOCAL.
- login: "das"
- mimetype: "text/plain"
- username: "das"
- icomment:
Ticket change [c731b6a428] (rid 121892) by petasis on 2010-07-26 13:22:56:
- icomment:
I have observed this behaviour under OS X 10.6, and ActiveTcl 8.6.0.0b3. I don't remember the date ActiveTcl 8.6.0.0b3 was released. And it is true that I looked at the latest CVS head for the sources, when concluding that RTLD_GLOBAL is used by load. Looking at the dates of files, i.e. wish8.6 in /usr/local/bin, I see a date of May 20. But I don't know if they include the change or not.
- login: "petasis"
- mimetype: "text/plain"
- username: "petasis"
- icomment:
Ticket change [dbcdc31fe2] (rid 108022) by nijtmans on 2012-11-08 19:21:56:
- assignee changed to: "nijtmans"
- icomment:
See: <http://www.tcl.tk/cgi-bin/tct/tip/416>
- login: "nijtmans"
- mimetype: "text/plain"
- username: "nijtmans"
Ticket change [d2549bc32b] (rid 113517) by nijtmans on 2013-01-02 22:18:53:
- closedate changed to: "2013-01-02T15:18:53"
- closer changed to: "nijtmans"
- icomment:
allow_comments - 1 Since Tcl 8.6, [load -global] can be used to remedy this.
- login: "nijtmans"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "nijtmans"