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: test_ctypes fails on OSX 10.3
Type: Stage:
Components: Library (Lib) Versions: Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: theller Nosy List: anthonybaxter, nnorwitz, ronaldoussoren, theller
Priority: normal Keywords:

Created on 2006-04-10 01:21 by anthonybaxter, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
ctypes.diff theller, 2006-07-10 08:13 USE RTLD_GLOBAL on OS X 10.3.
Messages (9)
msg28172 - (view) Author: Anthony Baxter (anthonybaxter) (Python triager) Date: 2006-04-10 01:21
test test_ctypes failed -- Traceback (most recent call
last):
  File
"/Users/anthonybaxter/python/Lib/ctypes/test/test_loading.py",
line 30, in test_load
    cdll.load(libc_name)
  File
"/Users/anthonybaxter/python/Lib/ctypes/_loader.py",
line 112, in load
    return self._load(libname, mode)
  File
"/Users/anthonybaxter/python/Lib/ctypes/_loader.py",
line 153, in _load
    return self.load_library(pathname, mode)
  File
"/Users/anthonybaxter/python/Lib/ctypes/_loader.py",
line 124, in load_library
    return self._dlltype(libname, mode)
  File
"/Users/anthonybaxter/python/Lib/ctypes/__init__.py",
line 288, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: dlcompat: unable to open this file with RTLD_LOCAL

This happens both with and without the patch in r43748.

Darwin sam.local 7.9.0 Darwin Kernel Version 7.9.0: Wed
Mar 30 20:11:17 PST 2005;
root:xnu/xnu-517.12.7.obj~1/RELEASE_PPC  Power
Macintosh powerpc

GCC version:
Reading specs from /usr/libexec/gcc/darwin/ppc/3.3/specs
Thread model: posix
gcc version 3.3 20030304 (Apple Computer, Inc. build 1640)
msg28173 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2006-04-13 06:59
Logged In: YES 
user_id=11105

I'm trying to get a copy of OS X 10.3, then will try to
install it and look after this problem.
OTOH, the ctypes loading code is currently rewritten in the
upstream version - this will probably prevent this failure.

In the meantime, can you try to find out the cause of this
failure?  Would RTLD_GLOBAL instead of RTLD_LOCAL work? Is
the library file missing?
msg28174 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2006-05-09 18:38
Logged In: YES 
user_id=11105

Does this failure still occur with Python 2.5a2, or the
current SVN trunk?
msg28175 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2006-07-10 04:14
Logged In: YES 
user_id=33168

Anthony is this still a problem?
msg28176 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2006-07-10 08:13
Logged In: YES 
user_id=11105

Here is a patch that I hope will fix this problem.  Ronald
Oussuren suggested in private email to use RTLD_GLOBAL as
default library loading mode on OS X 10.3.  He suggested to
use the platform module to find out the osx version, however
I don't like.  Instead I found by examining platform that
gestalt.gestalt("sysv") returns the information I need.

I still don't have access to 10.3 (and Python does not
compile on the 10.2.8 sourceforge osx compile farm machine -
should I add a bug for that one?), so I cannot really test
the patch myself.
msg28177 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2006-07-10 09:07
Logged In: YES 
user_id=11105

Even better would imo be to call the Gestalt function in the
_ctypes extensions module itself.
msg28178 - (view) Author: Anthony Baxter (anthonybaxter) (Python triager) Date: 2006-07-10 09:43
Logged In: YES 
user_id=29957

I'm not going to get the opportunity to look at this before
the b2 freeze tomorrow morning, but will look at it soon after.

msg28179 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2006-07-11 17:45
Logged In: YES 
user_id=580910

With this patch test_ctypes passed on 10.3. 

I'm in favor of applying this patch. 
msg28180 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2006-07-12 08:44
Logged In: YES 
user_id=11105

Committed as r50601.
History
Date User Action Args
2022-04-11 14:56:16adminsetgithub: 43182
2006-04-10 01:21:51anthonybaxtercreate