467,117 Members | 1,048 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,117 developers. It's quick & easy.

Core Dump - Segmentation Fault -Newbie

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?
Jul 18 '08 #1
  • viewed: 5624
Share:
5 Replies
jo***************@yahoo.com wrote:
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
Jul 18 '08 #2
On Jul 18, 9:56*am, Stefan Behnel <stefan...@behnel.dewrote:
johnericaturnb...@yahoo.com wrote:
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 lackof
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)
Jul 18 '08 #3
On Fri, 18 Jul 2008 15:56:10 +0200, Stefan Behnel <st*******@behnel.dewrote:
jo***************@yahoo.com wrote:
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
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

Jul 18 '08 #4
Doug Morse wrote:
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
Jul 18 '08 #5


jo***************@yahoo.com wrote:
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

Jul 18 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Mike Orb | last post: by
2 posts views Thread by Ng Pheng Siong | last post: by
3 posts views Thread by Nick Craig-Wood | last post: by
8 posts views Thread by Jing Cheng | last post: by
10 posts views Thread by ken | last post: by
10 posts views Thread by wong_powah@yahoo.ca | last post: by
14 posts views Thread by Sheldon | last post: by
2 posts views Thread by Zach | last post: by
4 posts views Thread by Willy Wijaya | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.