Skip to content
Tcl Source Code History Of Ticket 3216070
Login

History Of Ticket 3216070

Artifacts Associated With Ticket 3216070

  1. Ticket change [18af8c1fca] (rid 122701) by mxmanghi on 2011-03-16 11:37:48:

    1. assignee initialized to: "kennykb"
    2. cmimetype initialized to: "text/plain"
    3. 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.
      
    4. foundin initialized to: "obsolete: 8.5.9"
    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: "mxmanghi"
    10. subsystem initialized to: "40. Dynamic Loading"
    11. title initialized to:
      Loading extension libraries from embedded Tcl applications
      
    12. type initialized to: "Bug"
  2. Add attachment "3216070.patch" [b0cede26e9] (rid 98042) by nijtmans on 2011-03-16 19:26:42.

  3. Ticket change [22bae7cca9] (rid 130806) by nijtmans on 2011-03-16 19:26:42:

    1. icomment:
      
      
      File Added - 404492: 3216070.patch
      
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"
  4. Ticket change [07aafd748e] (rid 89445) by nijtmans on 2011-03-22 22:12:04:

    1. assignee changed to: "nijtmans"
    2. closedate changed to: "2011-03-22T15:12:04"
    3. closer changed to: "nijtmans"
    4. 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.
      
      
    5. login: "nijtmans"
    6. mimetype: "text/plain"
    7. resolution changed to: "Fixed"
    8. status changed to: "Closed"
    9. username: "nijtmans"
  5. Ticket change [267692ac6d] (rid 88351) by andreas_kupries on 2011-03-25 01:38:32:

    1. 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.
      
      
      
    2. login: "andreas_kupries"
    3. mimetype: "text/plain"
    4. username: "andreas_kupries"