classification
Title: _findLib_crle and _get_soname broken on latest SunOS 5.11
Type: behavior Stage: patch review
Components: ctypes Versions: Python 3.7, Python 3.6, Python 3.5, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: amaury.forgeotdarc, belopolsky, jquast, martin.panter, meador.inge, rygorde4
Priority: normal Keywords: patch

Created on 2014-02-17 20:25 by rygorde4, last changed 2017-01-28 23:00 by martin.panter.

Files
File name Uploaded Description Edit
opensolaris-ctypes-python-2.7.patch jquast, 2014-05-26 03:51 patch against 2.7 review
opensolaris-ctypes-python-3.x.patch jquast, 2014-05-26 03:52 python 3.x review
Messages (3)
msg211438 - (view) Author: Ryan Gordon (rygorde4) Date: 2014-02-17 20:25
On SunOS 5.11, both the _findLib_crle and _get_soname are broken.

With _findLib_crle, the function returns the following:

# env LC_ALL=C /usr/bin/crle -64

Default configuration file (/var/ld/64/ld.config) not found
  Platform:     64-bit LSB AMD64
  Default Library Path (ELF):   /lib/64:/usr/lib/64  (system default)
  Trusted Directories (ELF):    /lib/secure/64:/usr/lib/secure/64  (system default)

# env LC_ALL=C /usr/bin/crle

Configuration file [version 4]: /var/ld/ld.config  
  Platform:     32-bit LSB 80386
  Default Library Path (ELF):   /lib:/usr/lib
  Trusted Directories (ELF):    /lib/secure:/usr/lib/secure  (system default)

Command line:
  crle -c /var/ld/ld.config -l /lib:/usr/lib

The "Default Library Path (ELF):   /lib:/usr/lib" is extracted to "/lib:/usr/lib" and only those two paths are checked for the library in question. Unfortunately this means that there is absolutely no way to configure any environment variable to check on other paths and both /lib and /usr/lib are read-only directories mounted from the global zone:

[ /usr/lib] # touch test.txt
touch: cannot touch `test': Read-only file system
[ /lib] # touch test.txt
touch: cannot touch `test': Read-only file system

An environment variable should be read in that can be configured to override this functionality.

The second issue with _get_soname is that is calls /usr/ccs/bin/dump which doesn't exist at all: (/usr/ccs/bin/ is an old deprecated directory which has since been removed)

# ll /usr/ccs/bin/dump
ls: cannot access /usr/ccs/bin/dump: No such file or directory
msg219123 - (view) Author: Jeff Quast (jquast) * Date: 2014-05-26 03:51
Submitting fix to fallback to alternate '/usr/bin/dump' path, confirmed using SmartOS.

As for the issues writing to /lib and /usr/lib from a zone, and the request for "An environment variable .. to override this functionality." I have to disagree: crle(1) already provides facilities to add additional paths.

For example, to add `/usr/local/lib' to your dynamic library path, You would simply run, `crle -l /usr/local/lib -u'.

I don't *that* belongs in python.
msg286421 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2017-01-28 23:00
There is an Open Indiana buildbot <http://buildbot.python.org/all/buildslaves/cea-indiana-x86>, that was passing test_ctypes (until the buildbot went offline a few weeks ago). Would it be possible to include a regression test case?

Also, in <https://bugs.python.org/issue23287#msg247067>, John said that /usr/ccs/bin is a symbolic link to /usr/bin/, so I wonder if this really is a problem. Perhaps the symlink does not exist on some OS versions?

Regarding an environment variable for library searching, perhaps that is related to Issue 9998 (searched LD_LIBRARY_PATH env. var. on Linux). See also Issue 19317, discussing RPATH fom sys.executable.
History
Date User Action Args
2017-01-28 23:00:08martin.pantersetversions: + Python 3.6, Python 3.7, - Python 3.1, Python 3.2, Python 3.3, Python 3.4
nosy: + martin.panter

messages: + msg286421

stage: patch review
2014-05-26 08:30:03pitrousetnosy: + amaury.forgeotdarc, belopolsky, meador.inge
2014-05-26 03:52:08jquastsetfiles: + opensolaris-ctypes-python-3.x.patch
2014-05-26 03:51:43jquastsetfiles: + opensolaris-ctypes-python-2.7.patch

nosy: + jquast
messages: + msg219123

keywords: + patch
2014-02-17 20:25:40rygorde4create