Segmentation Fault

Simon Forman rogue_pedro at yahoo.com
Mon Aug 28 00:59:08 EDT 2006


pycraze wrote:
> I would like to ask a question. How do one handle the exception due to
> Segmentation fault due to Python ?  Our bit operations and arithmetic
> manipulations are written in C and to some of our testcases we
> experiance Segmentation fault from the python libraries.
>
> If i know how to handle the exception for Segmentation fault , it will
> help me complete the run on any testcase , even if i experiance Seg
> Fault due to any one or many functions in my testcase.

AFAIK, seg fault kills your program dead.  There's no exception to
handle.  If you're getting seg faults from the python standard library,
that's a pretty serious thing, way more serious than just not-passed
testcases.

An uncaught exception in python should generate a traceback.  If it
does, please post that.

Whether it does or not, could you post a minimal example of the code
that causes the seg fault?  Python standard lib is fairly robust but of
course not bullet-proof.  If there's a way to make it seg fault (and
it's in the standard lib and not your C code) people will want to know.

HTH,
~Simon




More information about the Python-list mailing list