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

noreply@sourceforge.net noreply@sourceforge.net
Tue, 11 Dec 2001 14:53:14 -0800


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: 3
Submitted By: Neal Norwitz (nnorwitz)
Assigned to: Nobody/Anonymous (nobody)
Summary: interpreter crash when import .so fails w/ Purify

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: Guido van Rossum (gvanrossum)
Date: 2001-10-19 06:49

Message:
Logged In: YES 
user_id=6380

Note that Neal mentions Purify as a condition. I've added
that to the subject. Could Purify somehow be screwing
dlerror()? Not much we can do about that...

On the one hand it seems wrong that PyErr_SetString() should
be patched; on the other hand there's nothing wrong with
making that function a bit more robust. I give the patch a
+0.

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

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