473,654 Members | 3,071 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 20913
"Michael B. Trausch" <"mike$#at^&nos pam!%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^&nos pam!%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
2892
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 called ANSYS** Now, I have generated a python module using a *fortran-python interface
5
2990
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 understood that a segmentation fault can occur whenever I declare a pointer and I leave it un-initialized. So I thought the problem here is with the (const char *)s in the stuct flightData (please note that I get the same fault declaring as char * the...
99
4632
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
26094
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)? Thanks.
27
3348
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! #include <stdlib.h> #include <stdio.h> typedef struct _node_t {
2
2285
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 Windows app with rare user reports - and still in the dark (I get snippets of machine stack traces / screenshots with random "mem. access error" / "python caused the runtime to terminate in an unusual way" / ..) I'd like to hook a kind of quality...
3
5170
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 from 10g release2 PHP is configured with the following parameters './configure' '--prefix=/opt/oracle/php' '--with-apxs=/opt/oracle/apache/bin/apxs' '--with-config-file-path=/opt/oracle/apache/conf' '--enable-safe-mode' '--enable-session'...
3
6383
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 problem calling c func from python.... But problem is for calling C to Python I am trying to call a python function multiple times by passing one parameter 'fun(param)' from C code . I am getting segmentation fault error while executing . The...
1
3193
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 "Python.h" #include <stdio.h> int main() { Py_Initialize();
9
3832
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 Python are new to me. --uname output-- $ uname -rvp 2 5 powerpc --end uname output--
0
8380
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8816
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8710
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8497
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8598
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7310
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4150
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4299
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1598
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.