You are not logged in.

#1 2009-01-15 10:08:44

rgwzlfw
Member
Registered: 2008-05-20
Posts: 7

Segfault in python, perhaps due to lapack update?

Not sure if this is the right forum, but here goes...

I write physics simulations (for university) using numpy/scipy/matplotlib under archlinux. Some code which was recently working fine started segfaulting (all the python script would spit out was "Segmentation Fault"). It wasn't anything particularly unusual, just plotting some lines inside a loop. I initially tried recompiling numpy and matplotlib, to no avail. Then, I tried rolling back several recent updates to find the source of the problem, and when I rolled lapack-3.2-1 back to lapack-3.1.1-4, the segfaults disappeared, and everything is working as usual.

I don't feel like I understand the source of the problem well enough to attempt to file a bug report at this time, but I post this topic in the hope that perhaps someone else with a similar problem will find it useful, or someone smarter than me might be able to figure out what's going on.

edit: I neglected to mention that this is on x64 architecture.

Last edited by rgwzlfw (2009-01-15 10:10:17)

Offline

#2 2009-01-15 10:50:59

dav7
Member
From: Australia
Registered: 2008-02-08
Posts: 674

Re: Segfault in python, perhaps due to lapack update?

Well, I can't really help much, except give a couple standard-ish debugging tips (assuming you have, first of all, re-upgraded lapack):

- Make the first thing your script does is quit(), before anything else. If the script segfaults under these conditions (ie, doing "nothing"), something is really up with the compiler since it's crashing before it even starts executing code, and you should definitely submit a high-priority bugreport. If, however, python likes you (:P) and it doesn't crash, start moving the quit() down the file until python does crash, and note what's going on at that point - perhaps try rearranging the code to see if you can make everything like each other by reformulating your algorithms.

- If you can, submit the script to the Python mailing list with information gleaned from the previous point. This will be the biggest help to the python devs as they'll be able to watch Python as it executes the file and (hopefully) see what's going on.

-dav7


Windows was made for looking at success from a distance through a wall of oversimplicity. Linux removes the wall, so you can just walk up to success and make it your own.
--
Reinventing the wheel is fun. You get to redefine pi.

Offline

#3 2009-01-17 10:34:14

rgwzlfw
Member
Registered: 2008-05-20
Posts: 7

Re: Segfault in python, perhaps due to lapack update?

Thank you dav7, for your helpful reply. I tried to locate the point in the script at which the segfault occurs by using print statements, and by commenting various things out. Initially removing some plot() commands (provided by matplotlib) seemed to stop it happening. However, adding seemingly innocuous things like the "pass" statement caused the segfault to start happening again, so I'm really at a bit of a loss.

I will continue investigating to the best of my --- albeit limited --- ability, but for now at least I can stick with the earlier version of lapack.

Last edited by rgwzlfw (2009-01-17 11:06:20)

Offline

#4 2009-01-18 13:56:23

dav7
Member
From: Australia
Registered: 2008-02-08
Posts: 674

Re: Segfault in python, perhaps due to lapack update?

I see.

It's probably due to some kind of memory manipulation bug in how Python interacts with lapack.


Windows was made for looking at success from a distance through a wall of oversimplicity. Linux removes the wall, so you can just walk up to success and make it your own.
--
Reinventing the wheel is fun. You get to redefine pi.

Offline

Board footer

Powered by FluxBB