Skip to content
Tcl Source Code History Of Ticket 3033027
Login

History Of Ticket 3033027

Artifacts Associated With Ticket 3033027

  1. Ticket change [43d8e5a9e7] (rid 116627) by petasis on 2010-07-22 11:47:32:

    1. assignee initialized to: "kennykb"
    2. cmimetype initialized to: "text/plain"
    3. 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
      
    4. foundin initialized to: "obsolete: 8.6b1"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "petasis"
    10. subsystem initialized to: "40. Dynamic Loading"
    11. title initialized to:
      load: loaded shared libraries don't export symbols (OS X)
      
    12. type initialized to: "Bug"
  2. Ticket change [6374d576a3] (rid 92582) by petasis on 2010-07-22 18:48:12:

    1. assignee changed to: "das"
  3. Ticket change [67cc2699b5] (rid 102953) by ferrieux on 2010-07-22 19:41:15:

    1. 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.
      
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  4. Ticket change [b3ce54497e] (rid 124916) by das on 2010-07-26 03:10:39:

    1. 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.
      
      
    2. login: "das"
    3. mimetype: "text/plain"
    4. username: "das"
  5. Ticket change [c731b6a428] (rid 121892) by petasis on 2010-07-26 13:22:56:

    1. 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.
      
      
    2. login: "petasis"
    3. mimetype: "text/plain"
    4. username: "petasis"
  6. Ticket change [dbcdc31fe2] (rid 108022) by nijtmans on 2012-11-08 19:21:56:

    1. assignee changed to: "nijtmans"
    2. icomment:
      See: <http://www.tcl.tk/cgi-bin/tct/tip/416>
      
      
    3. login: "nijtmans"
    4. mimetype: "text/plain"
    5. username: "nijtmans"
  7. Ticket change [d2549bc32b] (rid 113517) by nijtmans on 2013-01-02 22:18:53:

    1. closedate changed to: "2013-01-02T15:18:53"
    2. closer changed to: "nijtmans"
    3. icomment:
      
      
      allow_comments - 1
      
      Since Tcl 8.6, [load -global] can be used to remedy this.
      
      
    4. login: "nijtmans"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "nijtmans"