Skip to content
Tcl Source Code History Of Ticket 1204237fffffffffffffffffffffffffffffffff
Login

History Of Ticket 1204237fffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 1204237fffffffffffffffffffffffffffffffff

  1. Ticket change [5422b82fb2] (rid 93886) by dwcollins on 2005-05-18 12:38:49:

    1. assignee initialized to: "kennykb"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      I think this is a follow on of several earlier bug reports in 
      this area (notably 611108, but also 217820, 219140).
      
      If I run "load /home/dcollins/libtest.sl" within a stock 
      tclsh, it actually ignores the path I've given it and 
      searches SHLIB_PATH finding another copy of the 
      same library.  This is causing lots of head scratching 
      during unit tests of our extensions, when any rebuilds 
      don't seem to have any effect!
      
      I would expect it to use SHLIB_PATH, if I just run "load 
      libtest.sl", or if it couldn't find it in the full path area, but 
      not always!
      
      This was observed on HP-UX 11i, Solaris and linux 
      seem to be behave as expected.
      
      From looking at 611108, I assume the behaviour is 
      supposed to be as follows (but correct me if I'm wrong):
      
      1. Convert the filename the user entered to a full native 
      pathname and use that to load the library.
      2. If that fails, pass the original string the user entered 
      (raw filename, relative path or whatever) to the OS-
      specific "dlopen" command and let it us 
      LD_LIBRARY_PATH/SHLIB_PATH to find a version of 
      that library.
      
      I think that the implementation is correct for the 
      tclLoadDl.c and tclLoadDld.c (i.e. Solaris, Linux, etc) 
      but the HP implementation has a DYNAMIC_PATH flag 
      that tells it to always use SHLIB_PATH, even in step 1 
      above.
      
      I've attached a patch that removes that flag for the first 
      call to shl_load (the one with the full native path), the 
      second call is left alone (since we want that to use the 
      dynamic path variable).
      
      Can any other HP Tcl users' confirm/contradict that?  I 
      don't claim to be an expert on this, its mostly been trial 
      and error, and I believe the whole shl_load mechanism 
      is being replaced by the more usual dlopen for 64-bit, 
      unfortunately we're stuck with 32-bit HP!
      
      
    4. foundin initialized to: "obsolete: 8.4.9"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "dwcollins"
    9. subsystem initialized to: "40. Dynamic Loading"
    10. title initialized to:
      load command in HP (shl_load) picks wrong version of library
      
    11. type initialized to: "Bug"
  2. Add attachment "shl.diff" [5df31b1414] (rid 115553) by dwcollins on 2005-05-18 19:38:49.

  3. Ticket change [4cbcbc87a1] (rid 126941) by dwcollins on 2005-05-18 19:38:50:

    1. icomment:
      
      
      File Added - 134978: shl.diff
      
      
      
    2. login: "dwcollins"
    3. mimetype: "text/plain"
    4. username: "dwcollins"
  4. Ticket change [111d58a40b] (rid 95087) by kennykb on 2005-05-21 02:28:29:

    1. assignee changed to: "hobbs"
  5. Ticket change [7b1cb1c7a1] (rid 90464) by kennykb on 2005-05-21 02:28:30:

    1. icomment:
      Logged In: YES 
      user_id=99768
      
      The DYNAMIC_PATH arg is needed so that if you do
          load /path/to/foo.shl
      and foo.shl has a ref to some libbar.shl, that the
      dynamic linker will search the SHLIB_PATH for it.
      
      Or that's my understanding of why DYNAMIC_PATH
      got put there in the first place (Bug 219140).
      
      I don't have an HP-UX machine, forwarding to someone
      that does.
      
      
      
    2. login: "kennykb"
    3. mimetype: "text/plain"
    4. username: "kennykb"
  6. Ticket change [db76392291] (rid 107967) by dwcollins on 2005-05-23 15:11:26:

    1. icomment:
      Logged In: YES 
      user_id=1093010
      
      Ah, I hadn't realised that. If that's the case, then I can see 
      why its necessary.
      
      I'll play around with my test program a bit more then.
      
      
      
    2. login: "dwcollins"
    3. mimetype: "text/plain"
    4. username: "dwcollins"
  7. Ticket change [23a1bdc107] (rid 130974) by hobbs on 2005-05-31 09:19:45:

    1. closedate changed to: "2005-05-31T02:19:45"
    2. closer changed to: "hobbs"
    3. icomment:
      Logged In: YES 
      user_id=72656
      
      Is this resolved then?
      
      
    4. login: "hobbs"
    5. mimetype: "text/plain"
    6. status changed to: "Pending"
    7. username: "hobbs"
  8. Ticket change [9358f4c991] (rid 105796) by dwcollins on 2005-05-31 18:02:45:

    1. icomment:
      Logged In: YES 
      user_id=1093010
      
      I thought that was what the +s option on the linker was for 
      though? Each binary and shared library has a flag that 
      defines whether it uses SHLIB_PATH or has embedded 
      paths to find associated libraries
      
      manpage for shl_load states:
      DYNAMIC_PATH:  Allow the loader to dynamically search for 
      the library specified by the path argument.
      The directories to be searched are determined by the +s and 
      +b options of the ld command used when the program was 
      linked.
      
      That suggests to me that if we are giving it a complete path, 
      we don't need the flag, it only becomes useful if we give it a 
      partial path.
      
      I don't claim to be an expert on HP's loading policies, it just 
      seems odd that the end-user behaviour is different on HP 
      than on Solaris for example.
      
      Feel free to downgrade the priority, its quite a low priority 
      thing, I'd just feel happier if the behaviour was consistent 
      across the platforms.
      
      
      
    2. login: "dwcollins"
    3. mimetype: "text/plain"
    4. status changed to: "Open"
    5. username: "dwcollins"
  9. Ticket change [4c46257b0d] (rid 126855) by dwcollins on 2005-05-31 18:05:45:

    1. icomment:
      Logged In: YES 
      user_id=1093010
      
      Forgot to mention, the fix for Bug 219140, when 
      DYNAMIC_PATH was added in the first place, was back 
      when only a single load attempt was made for any given 
      shared library.
      Now, we do the "try a complete path, THEN try the path that 
      the user entered" approach, I think we don't need 
      DYNAMIC_PATH in the first attempt. If we leave it in the 2nd 
      attempt, that should keep the original behaviour as it was 
      before the 2-phase approach was added.
      
      
      
    2. login: "dwcollins"
    3. mimetype: "text/plain"
    4. username: "dwcollins"
  10. Ticket change [84297ffcf1] (rid 117494) by hobbs on 2005-10-05 11:24:05:

    1. closedate changed to: "2005-10-05T04:24:05"
    2. closer changed to: "hobbs"
    3. icomment:
      Logged In: YES 
      user_id=72656
      
      Removal of the DYNAMIC_PATH for the first shl_load appears
      correct.  I have commited that for 8.4.12 and 8.5a4.
      
      
    4. login: "hobbs"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "hobbs"