dl + getenv (without arguments) = segfault (python2.p2, python2.3)

Carl Banks imbosol at aerojockey.com
Wed Aug 6 23:20:26 EDT 2003


Skip Montanaro wrote:
> 
>    Xavier> Do note that my previous e-mail was not implying my possible
>    Xavier> ignorance to the 'dl' module's functionality, but instead
>    Xavier> inquiring wether there is or may be a solution in the future for
>    Xavier> Python to handle such an erronous outcome.  And plus, segfaults
>    Xavier> are ugly and make me cry.
> 
> I understand.  Given the nature of the problem here, I suspect the segfault
> occurred in getenv() (I can't check to be sure, as I don't have the dl
> module).  It's kind of hard for Python to gracefully recover when it doesn't
> control the program counter.

Theoretically, it could trap SIGSEGV and have the handler return
control to Python.  (You'd probably have to wrap the dl call with
setjmp, and use longjmp in the handler.)  I wouldn't count on the
Python process being in great shape afterwards, though.


-- 
CARL BANKS
"You don't run Microsoft Windows.  Microsoft Windows runs you."




More information about the Python-list mailing list