Ask Your Question
0

What is unhandled Sigsegv

asked 2012-06-21 17:20:56 +0200

god.one gravatar image

updated 2015-01-18 18:02:49 +0200

FrédéricC gravatar image

Hi,

I'm working with sage 4.7.2 on a virtual machine on windows 7. I have some more lines of code where I read some data tables and try to fit them with find_fit and than calculate confidence intervals. Suddenly I get and error of the following kind:

[...]
/home/sage/sage/local/lib/libpython2.6.so.1.0(PyRun_InteractiveLoopFlags\
+0x5b)[0xd1d8bb]
/home/sage/sage/local/lib/libpython2.6.so.1.0(PyRun_AnyFileExFlags+0x4e)\
[0xd1df3e]
/home/sage/sage/local/lib/libpython2.6.so.1.0(Py_Main+0xca0)[0xd2ce60]
/home/sage/sage/local/bin/python(main+0x27)[0x80485c7]
/lib/libc.so.6(__libc_start_main+0xe6)[0x126e36]
/home/sage/sage/local/bin/python[0x8048501]

------------------------------------------------------------------------
Unhandled SIGSEGV: A segmentation fault occurred in Sage.
This probably occurred because a *compiled* component of Sage has a bug
in it and is not properly wrapped with sig_on(), sig_off(). You might
want to run Sage under gdb with 'sage -gdb' to debug this.
Sage will now terminate.
------------------------------------------------------------------------

I found some a trac ticket concerning this but it does not help me. Also I do not know how to use the debugging command with the VM to give you further information or where to but the notebook and the data file so everyone could have a further look if wanted. Do not hesitate to ask for additional information. Again thanks in advance

edit retag flag offensive close merge delete

Comments

Basically, the error message at the bottom means what it says - there was an error in something that was not just a Python file. If you the code you used and a link to the data files, or a (public) link to an offending .sws file, someone who understands compiled stuff can certainly help you. Keep in mind that since you're using a somewhat older version of Sage, this bug may have already been fixed (say, in 5.0.1).

kcrisman gravatar imagekcrisman ( 2012-06-21 17:42:18 +0200 )edit

Try to isolate a minimal testcase, ideally a single command that generates the segfault.

Volker Braun gravatar imageVolker Braun ( 2012-06-22 08:01:14 +0200 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2012-06-22 09:17:59 +0200

god.one gravatar image

I could boil it down to

def nonneg(a):
    if a<0.01:
        return 0.01
for i in range(len(data2)):
    if bool(min(testfct(data2[i][0],best_fit_par[tau]+dx),testfct(data2[i][0],nonneg(best_fit_par[tau]-dx)))<data2[i][1]) and bool(data2[i][1]<max(testfct(data2[i][0],best_fit_par[tau]+dx),testfct(data2[i][0],nonneg(best_fit_par[tau]-dx)))) != 1:
        print 1

where testfct is a function of two variables and data2 is a list of 2-tuples and the rest are predefined parameters. The problem lies within the nonneg fct. If I do not use in within the testfct, everything works fine.

edit flag offensive delete link more

Comments

1

Well, I wouldn't say this proves nonneg is the problem ; just that not using it makes the problem disappear : as the comments to the question said, the error message is about a crash out of python, and nonneg is python (and very simple). I propose you to modify your for i loop to add an inner try: except: print i to try to find which data point is the problem, then compute the various things appearing in your loop by hand one by one, so you find what the real problem is.

Snark gravatar imageSnark ( 2012-06-22 09:26:03 +0200 )edit

By testcase, I meant something that a developer can run into his Sage install and reproduce your segfault. Without knowing what data2, tau, dx, best_fit_par, testfct, ... is we can't even attempt to reproduce your error.

Volker Braun gravatar imageVolker Braun ( 2012-06-23 08:05:56 +0200 )edit

Yes, that is why I pointed him to finding the precise piece of problematic of data. The testfct function seems especially suspicious.

Snark gravatar imageSnark ( 2012-06-23 11:29:01 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-06-21 17:20:56 +0200

Seen: 1,212 times

Last updated: Jun 22 '12