Bug in numpy matrix inversion

34 views
Skip to first unread message

Pablo W.

unread,
Jul 8, 2010, 6:35:04 PM7/8/10
to sage-devel
Hi folks,

The following line seems to reset the sage interpreter (with n bigger
than 98), which is very annoying as it is a trivial matrix inversion
using numpy.

import numpy as np
n = 98
lhs = np.eye( n )
rhs = np.ones( n )
np.linalg.solve(lhs,rhs)

(then np is not defined anymore, nor n, lhs or rhs )

It looks like a problem in numpy compiled code. I am using latest
release sage-4.4.4-linux-64bit-ubuntu_10.04_lts-x86_64-Linux on lucid
lynx . It did work properly with version 4.4.2 of sage ( and on my
system-wide numpy ).

In the console, I get :

2010-07-09 00:26:31+0200 [HTTPChannel,4,127.0.0.1] Unhandled SIGSEGV:
A segmentation fault occurred in Sage.
2010-07-09 00:26:31+0200 [HTTPChannel,4,127.0.0.1] This probably
occurred because a *compiled* component
2010-07-09 00:26:31+0200 [HTTPChannel,4,127.0.0.1] of Sage has a bug
in it (typically accessing invalid memory)
2010-07-09 00:26:31+0200 [HTTPChannel,4,127.0.0.1] or is not properly
wrapped with _sig_on, _sig_off.
2010-07-09 00:26:31+0200 [HTTPChannel,4,127.0.0.1] You might want to
run Sage under gdb with 'sage -gdb' to debug this.
2010-07-09 00:26:31+0200 [HTTPChannel,4,127.0.0.1] Sage will now
terminate (sorry).


Best,

Pablo

Pablo W.

unread,
Jul 9, 2010, 4:42:54 AM7/9/10
to sage-devel
Just to mention that the bug disappear if I build sage manually using
'make -j2'. Could there be something wrong with the official build ?

Mike Hansen

unread,
Jul 9, 2010, 1:09:49 PM7/9/10
to sage-...@googlegroups.com
On Fri, Jul 9, 2010 at 1:42 AM, Pablo W. <pablo....@gmail.com> wrote:
> Just to mention that the bug disappear if I build sage manually using
> 'make -j2'. Could there be something wrong with the official build ?

What type of processor are you using? My guess is that the binary was
built on a newer processor than the one on your machine.

--Mike

Pablo Winant

unread,
Jul 9, 2010, 1:56:04 PM7/9/10
to sage-...@googlegroups.com
According to cpuinfo I have an Intel(R) Core(TM)2 Duo CPU L9400
@ 1.86GHz

Here is the rest of the output :


stepping : 6
cpu MHz : 800.000
cache size : 6144 KB
physical id : 0
siblings : 2
core id : 1
cpu cores : 2
apicid : 1
initial apicid : 1
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall
nx lm constant_tsc arch_perfmon pebs bts rep_good aperfmperf pni dtes64
monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 lahf_lm ida
tpr_shadow vnmi flexpriority
bogomips : 3724.05
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:

Le 09/07/2010 19:09, Mike Hansen a �crit :

Mike Hansen

unread,
Jul 9, 2010, 1:59:02 PM7/9/10
to sage-...@googlegroups.com
On Fri, Jul 9, 2010 at 10:56 AM, Pablo Winant <pablo....@gmail.com> wrote:
> According to cpuinfo I have an     Intel(R) Core(TM)2 Duo CPU     L9400  @
> 1.86GHz

Hmm... that should be fine. If you have the old version around, could
you do the following:

1) Start Sage with "sage -gdb"

2) Run the commands that caused Sage to crash.

3) When it segfaults, type in "bt" to get a backtrace and post it to
http://sage.pastebin.com

That should hopefully show us where the segfault is coming from.

--Mike

Pablo Winant

unread,
Jul 10, 2010, 7:28:36 AM7/10/10
to sage-...@googlegroups.com
Here it is :

http://sage.pastebin.com/X5UCjQub

I have no clue what it means but I would be pleased to see how you interpret it ;-)
Reply all
Reply to author
Forward
0 new messages