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: import with undefineds can crash python
Type: Stage:
Components: macOS Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: jackjansen Nosy List: jackjansen
Priority: low Keywords:

Created on 2001-12-02 22:19 by jackjansen, last changed 2022-04-10 16:04 by admin. This issue is now closed.

Messages (5)
msg7942 - (view) Author: Jack Jansen (jackjansen) * (Python committer) Date: 2001-12-02 22:19
Importing a module which references undefined externals, or which references libraries that
fail initialization, can crash the interpreter.
msg7943 - (view) Author: Jack Jansen (jackjansen) * (Python committer) Date: 2001-12-06 22:56
Logged In: YES 
user_id=45365

Unfortunately the fix I had in mind, adding the "return on error" flag to NSLinkModule(), is not good enough. Python crashes while the initialization routine for the dynamic library is running, and NSLinkModule also never gets control back, it seems. I now think this is definitely an Apple bug. Lowering the priority because of that, not because it's not important.

I did find an easy way to reproduce the bug, though: "su" to someone else (not root, someone who can't access your window server) and import _Win or something similar.
msg7944 - (view) Author: Jack Jansen (jackjansen) * (Python committer) Date: 2001-12-11 10:01
Logged In: YES 
user_id=45365

Apple was already aware of this bug, their bug number for it
is #2806458. There is no workaround known, so we'll have to
wait until it is fixed.
msg7945 - (view) Author: Jack Jansen (jackjansen) * (Python committer) Date: 2002-10-19 20:12
Logged In: YES 
user_id=45365

This seems to have been fixed on OSX 10.2. The import of, say, Carbon.Win will now work fine. But: python will still exit (not crash, a clean exit) when you actually try to access the window manager if you don't have the right so I am keeping this bug open. I will try and find out if there's a way to detect this situation. 
msg7946 - (view) Author: Jack Jansen (jackjansen) * (Python committer) Date: 2003-02-24 15:41
Logged In: YES 
user_id=45365

This has been fixed with the introduction of MacOS.WMAvailable().
History
Date User Action Args
2022-04-10 16:04:43adminsetgithub: 35649
2001-12-02 22:19:29jackjansencreate