473,410 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,410 software developers and data experts.

Python segmentation fault?

Is there a way to debug scripts that cause segmentation faults? I can
do a backtrace in gdb on Python, but that doesn't really help me all
that much since, well, it has nothing to do with my script... :-P

Any ideas?

Thanks,
Mike
Oct 24 '06 #1
4 20900
"Michael B. Trausch" <"mike$#at^&nospam!%trauschus"writes:
Is there a way to debug scripts that cause segmentation faults? I can
do a backtrace in gdb on Python, but that doesn't really help me all
that much since, well, it has nothing to do with my script... :-P
Scripts should never cause segmentation faults. Extension modules can
cause them. One frequent cause is a refcount management error. There
are various tools around for checking refcount correctness. Here is one:

http://aspn.activestate.com/ASPN/Coo.../Recipe/496791
Oct 24 '06 #2

Michael B. Trausch wrote:
Is there a way to debug scripts that cause segmentation faults? I can
do a backtrace in gdb on Python, but that doesn't really help me all
that much since, well, it has nothing to do with my script... :-P
Yes. If you think it is a python interpreter bug, create a
self-contained script which reproduces the issue, and file a python bug
report.

I'd be interested to see the stack trace--I recently uncovered a
segfault bug in python2.5 and I might be able to tell you if it is the
same one.

-Mike

Oct 24 '06 #3
On 2006-10-24 02:58:56 +0200, "Michael B. Trausch"
<"mike$#at^&nospam!%trauschus"said:
Is there a way to debug scripts that cause segmentation faults? I can
do a backtrace in gdb on Python, but that doesn't really help me all
that much since, well, it has nothing to do with my script... :-P

Any ideas?

Thanks,
Mike
I had segmentation faults on Mac, they were coming from a unpatched
readline 5.1
Once compiled with readline 5.2 it was working flawlessly

Regards,
Markus

Oct 26 '06 #4
Klaas wrote:
Michael B. Trausch wrote:
>Is there a way to debug scripts that cause segmentation faults? I can
do a backtrace in gdb on Python, but that doesn't really help me all
that much since, well, it has nothing to do with my script... :-P

Yes. If you think it is a python interpreter bug, create a
self-contained script which reproduces the issue, and file a python bug
report.

I'd be interested to see the stack trace--I recently uncovered a
segfault bug in python2.5 and I might be able to tell you if it is the
same one.
I finally found out what the problem was -- I was using something that
was in the wx.* set of classes and functions, and it was the item
segfaulting. I was apparently making an assumption or doing something
wrong, though I didn't have this project in Subversion at the time so I
can't say exactly which changes fixed it. I have it in Subversion now,
though, so that in the future I can be sure to better find out what is
going on by having all of the information handy.

Thanks for the help!

-- Mike
Oct 26 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: satish | last post by:
Hello all, I have a shared object executable viz. *cable* which I execute as follows : $ ansyscust71 -custom cable -p ANSYSRF **ansyscust71 is a shell script and is a part of a software...
5
by: Fra-it | last post by:
Hi everybody, I'm trying to make the following code running properly, but I can't get rid of the "SEGMENTATION FAULT" error message when executing. Reading some messages posted earlier, I...
99
by: Shi Mu | last post by:
Got confused by the following code: >>> a >>> b >>> c {1: , ], 2: ]} >>> c.append(b.sort()) >>> c {1: , ], 2: , None]}
18
by: Digital Puer | last post by:
Hi, I'm coming over from Java to C++, so please bear with me. In C++, is there a way for me to use exceptions to catch segmentation faults (e.g. when I access a location off the end of an array)?...
27
by: Paminu | last post by:
I have a wierd problem. In my main function I print "test" as the first thing. But if I run the call to node_alloc AFTER the printf call I get a segmentation fault and test is not printed! ...
2
by: robert | last post by:
When employing complex UI libs (wx, win32ui, ..) and other extension libs, nice "only Python stack traces" remain a myth. Currently I'm hunting again a rare C-level crash bug of a Python based...
3
by: madunix | last post by:
My Server is suffering bad lag (High Utlization) I am running on that server Oracle10g with apache_1.3.35/ php-4.4.2 Web visitors retrieve data from the web by php calls through oci cobnnection...
3
by: ShambhuHubli | last post by:
Hi all!! .. I am New member to this group. And also new to C/PYTHON API coding. I am trying to have two way communication i,e i am calling from python to C and then from C to python. I have no...
1
by: nimitsis | last post by:
Hello everyone I try to extend Python using a simple C wrapped module . This module includes embedded python code and it is product of Swig . The corresponding files follows : //main.c #include...
9
by: Randy.Galbraith | last post by:
I'm investigating the possible use of Mecurial SCM as a replacement for CVS. Mecurial is written in Python. I have a background in GNU/ Linux, Solaris, sparc and Perl. However AIX, powerpc and...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.