Python segmentation fault?

M

Michael B. Trausch

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
 
P

Paul Rubin

Michael B. Trausch 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

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/Cookbook/Python/Recipe/496791
 
K

Klaas

Michael 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

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
 
M

Markus Rosenstihl

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
 
M

Michael B. Trausch

Klaas said:
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
 

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

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top