Core Dump - Segmentation Fault -Newbie

J

johnericaturnbull

Hi - I am very new to python. I get this random core dump and am
looking for a good way to catch the error. I know the function my core
dump occurs. Is there any error catching/handling that I could use in
python?
 
S

Stefan Behnel

Hi - I am very new to python. I get this random core dump and am
looking for a good way to catch the error. I know the function my core
dump occurs. Is there any error catching/handling that I could use in
python?

Since you are using Windows, this is somewhat non-trivial due to the lack of
tools shipped by Microsoft. Are you really getting crashes of the interpreter
and not just an exception with a stacktrace?

Stefan
 
J

johnericaturnbull

Since you are using Windows, this is somewhat non-trivial due to the lack of
tools shipped by Microsoft. Are you really getting crashes of the interpreter
and not just an exception with a stacktrace?

Stefan

Hi - thanks for responding. I am actually running on linux. Does this
make a difference? Also the error shown is:

myFunction call failed. Segmentation Fault (core dumped)
 
D

Doug Morse

Since you are using Windows, this is somewhat non-trivial due to the lack of
tools shipped by Microsoft. Are you really getting crashes of the interpreter
and not just an exception with a stacktrace?

Stefan

Hi John,

Well, I must be missing something re: why Stefan states that you are using
Windows. I don't see that stated in your original post, and, AFAIK, the
phrase "core dump" is seen much more in the Unix world than in the Windows
world.

So, just in case you are on some *nix variant, you can of course log all the
system calls up until your core dump by running:

$ strace -o logfile.txt python [...]

where [...] should be replaced with any parameters to the python interpreter,
such as the Python script you're running, e.g.,

$ strace -o logfile.txt python Hello.py

The trace of system calls will be in the file logfile.txt. For more info on
strace, see the strace(1) man page (i.e., run "man strace").

Doug
 
S

Stefan Behnel

Doug said:
Well, I must be missing something re: why Stefan states that you are using
Windows. I don't see that stated in your original post

It's stated in the mail headers of his post, though. That's the problem with
newbies - you never know where that stops being right.

Stefan
 
T

Terry Reedy

Hi - I am very new to python. I get this random core dump and am
looking for a good way to catch the error. I know the function my core
dump occurs. Is there any error catching/handling that I could use in
python?

When posting such questions, please supply Python version, system info,
and usually code.

If you wrote a function in Python that seg faulted, congratulations, its
hard (but not impossible) to do ;-). Post it.

If you (or someone else) wrote a C function that seg faulted while
calling the Python api, well that is much easier. Post it or bug the
author.

If you (or someone else) wrote a C function that seg faulted in normal C
code, well that's easy. Most likely a bad pointer.

tjr
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top