This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Solaris 11.4 crle output not handled correctly
Type: Stage: patch review
Components: ctypes Versions: Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: dmurphy18, hergen
Priority: normal Keywords: patch

Created on 2021-01-11 18:55 by dmurphy18, last changed 2022-04-11 14:59 by admin.

Files
File name Uploaded Description Edit
solaris11_crle.patch dmurphy18, 2021-01-11 18:55 patch file to be applied to Lib/ctypes/util.py
py387_ctypes_util.patch hergen, 2021-01-30 16:50 patch for ctypes util.py
Pull Requests
URL Status Linked Edit
PR 24226 open dmurphy18, 2021-01-19 17:52
Messages (4)
msg384856 - (view) Author: David Murphy (dmurphy18) * Date: 2021-01-11 18:55
From porting Python 3.7.8 to Solaris 11.4 (base open version) found that the handling of crle output has changed between Solaris 11.3 and 11.4 and accommodation has not been made for the change.

For example:
Solaris 11.3
root@sol11:~/sol_build/proto_salt# uname -a
SunOS sol11 5.11 11.3 i86pc i386 i86pc
root@sol11:~/sol_build/proto_salt# crle

Default configuration file (/var/ld/ld.config) not found
  Platform:	32-bit LSB 80386
  Default Library Path (ELF):	/lib:/usr/lib  (system default)
  Trusted Directories (ELF):	/lib/secure:/usr/lib/secure  (system default)
root@sol11:~/sol_build/proto_salt# 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)
root@sol11:~/sol_build/proto_salt#


Solaris 11.4
root@sol114:/export/home/david/dev/dist/run# uname -a
SunOS sol114 5.11 11.4.0.15.0 i86pc i386 i86pc Solaris
root@sol114:/export/home/david/dev/dist/run# crle

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

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

root@sol114:/export/home/david/dev/dist/run# crle -64

Configuration file [version 5]: /var/ld/64/ld.config
    Platform:	64-bit LSB AMD64
    Default Library Path:	/usr/local/openssl/lib:/usr/local/lib:/lib/64:/usr/lib/64
    Trusted Directories:	/lib/secure/64:/usr/lib/secure/64  (system default)

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

root@sol114:/export/home/david/dev/dist/run#

Note: the missing '(ELF)' from the 'Default Library Path'


Simple fix is the following patch:
david@sol114:~/dev$ cat solaris11_crle.patch
--- util.py         2021-01-08 17:01:58.417014094 +0000
+++ util.py.new 2021-01-08 17:03:21.843483945 +0000
@@ -238,6 +238,10 @@
                     line = line.strip()
                     if line.startswith(b'Default Library Path (ELF):'):
                         paths = os.fsdecode(line).split()[4]
+                    elif line.startswith(b'Default Library Path:'):
+                        ## allow for Solaris 11.4 output
+                        paths = os.fsdecode(line).split()[3]
+            
 
             if not paths:
                 return None
david@sol114:~/dev$
msg384857 - (view) Author: David Murphy (dmurphy18) * Date: 2021-01-11 18:56
Forgive any process/workflow errors first time, submitting to Python
msg385981 - (view) Author: Hergen Lange (hergen) Date: 2021-01-30 11:48
For python 3.8.7 should be:

--- util.py.broken      2021-01-30 12:15:35.047669249 +0100
+++ util.py     2021-01-30 12:28:04.425931587 +0100
@@ -251,6 +251,9 @@
                     line = line.strip()
                     if line.startswith(b'Default Library Path (ELF):'):
                         paths = os.fsdecode(line).split()[4]
+                    elif line.startswith(b'Default Library Path:'):
+                        ## allow for Solaris 11.4 output
+                        paths = os.fsdecode(line).split()[3]
 
             if not paths:
                 return None
msg385989 - (view) Author: Hergen Lange (hergen) Date: 2021-01-30 16:50
Fix for python 3.8.7
Also added support for LD_CONFIG and LD_LIBRARY_PATH environment variables.

Patch File: py387_ctypes_util.patch

TEST successfull:
 
/opt/python/lib/python3.8/ctypes$ python3 util.py
libm.so.2
libc.so.1
libbz2.so.1
libx264.so.157
<CDLL 'libm.so', handle 7fffbf6f3d28 at 0x7fffbf513310>
<CDLL 'libcrypt.so', handle 7fffbf696750 at 0x7fffbf513310>
libcrypt.so.1
History
Date User Action Args
2022-04-11 14:59:40adminsetgithub: 87062
2021-01-30 16:50:47hergensetfiles: + py387_ctypes_util.patch

messages: + msg385989
versions: - Python 3.7, Python 3.9, Python 3.10
2021-01-30 11:48:30hergensetnosy: + hergen
messages: + msg385981
2021-01-19 17:52:49dmurphy18setstage: patch review
pull_requests: + pull_request23080
2021-01-11 18:56:01dmurphy18setmessages: + msg384857
2021-01-11 18:55:17dmurphy18create