[Python-bugs-list] [ python-Bugs-472642 ] interpreter crash when import .so fails

noreply@sourceforge.net noreply@sourceforge.net
Thu, 18 Oct 2001 23:33:17 -0700


Bugs item #472642, was opened at 2001-10-18 20:42
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=472642&group_id=5470

Category: Python Interpreter Core
Group: Python 2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Neal Norwitz (nnorwitz)
Assigned to: Nobody/Anonymous (nobody)
Summary: interpreter crash when import .so fails

Initial Comment:
The python interpreter crashes when import _socket
fails (.so).
This only happens when running purify (on solaris 2.8).
The problem is that dlerror() returns NULL, which is
then
passed to strlen().

Attached is a file with the stack trace which caused
the problem,
and a patch to fix the problem.

Neal


----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2001-10-18 23:33

Message:
Logged In: YES 
user_id=21627

I find it surprising that dlerror returns NULL. According 
to dlerror(3DL), it will only return NULL if there was no 
error since the last call to dlerror. Since handle is 
NULL, there certainly was an error very recently (in the 
dlopen), and I cannot see any dlerror call in-between.

In any case, your patch seems to be wrong: the bug is that 
dlerror returns NULL when it shouldn't. If we really need 
to work around this bug (which I'm not convinced that we 
should), then the work-around is to pass a non-null 
constant string to PyErr_SetString if dlerror returned 
null.


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=472642&group_id=5470