473,545 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
5 6069
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...@behn el.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*******@behn el.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4319
by: Mike Orb | last post by:
Hi. I've successfully installed PHP in the past but am having problems compiling it all of a sudden. To try to fix the problem I downloaded a fresh copy of Apache 1.3.29 and PHP 4.3.5 and kept the config simple. My Apache config: ../configure \ "--prefix=/usr/local/src/internet/services/apache/php/core-fix-test/http d" \...
2
3635
by: Ng Pheng Siong | last post by:
Hi, I just noticed that demo/evp_ciph_test.py of my M2Crypto package causes a core dump. It used to not do that. ;-) The core dump happens when the program is exiting; in the output below, rc2_40_cbc is the last test run by the program: $ python evp_ciph_test.py ...
3
6183
by: Nick Craig-Wood | last post by:
I've just discovered that my python (Python 2.3.4 from debian package 2.3.4-1 running on debian testing x86 + linux 2.4.26) core dumps when I set recursionlimit very high and do lots of recursion. Eg $ python -c 'import sys; sys.setrecursionlimit(100000) def f(): return f() f()' Segmentation fault (core dumped)
8
4728
by: Jing Cheng | last post by:
Hi, I'm using ifstream reading data from a file, as following: ifstream finput("track.dat"); if(finput.fail()){ cerr << "Open input DATA file error!\n"; exit(-1);
10
3993
by: ken | last post by:
hello, i'm writing a c program on a linux system. i'm debugging a segmentation fault but i don't want it to dump a core file because the memory footprint of the program is over 300Mb and i don't need it to generate a 300Mb file every time I add a new printf statement to debug the code. can i do something to prevent it from dumping the core...
10
7417
by: wong_powah | last post by:
I want to find out where (which line) my C program core dump. How to do that? Is there a web site describing the procedure? One approach is to use stack trace of the mdb debugger, but I does not understand its output completely. e.g. How to interpret the stack trace to find out which line inside the coredump_func function of a test...
14
3331
by: Sheldon | last post by:
Hi, I have a python script that uses a C extention. I keep getting a recurring problem that causes a core dump a few lines after the C extention return data back tp python. I tried using pbd and gdb but I have not succeeded in understanding what went wrong and where. I post the python script here is the error message and gdb output after...
1
10073
by: avinash jain | last post by:
I got a segmentation fault.. I came to know that the problem could be easliy solved be the core dump files. could any tell how to create a core dump file and how to read a core dump file. I am using g++ compliier..
2
3684
by: Zach | last post by:
I compiled a game client and it crashed (segmentation fault) resulting in a core file being generated. I'm trying to find out exactly what caused it to crash. Any ideas how I can do this with gdb? In the Makefile can I just add a "-g" flag to have the binary produced with debugging symbols? The source is written in ANSI C. This is what I...
4
3911
by: Willy Wijaya | last post by:
I have wrote this code.. But when i try to compile it using gcc in PCLinuxOS 2007, i got this message "Help me about segmentation fault (core dump)" when I run the client script.. //CLIENT #include <stdio.h> #include <sys/types.h> #include <sys/sem.h> #include <sys/ipc.h> #include <string.h>
0
7468
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7656
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7808
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7757
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5329
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3450
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3443
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1014
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
704
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.