[Numpy-discussion] Numpy.dot segmentation fault

Mark Lescroart lescroar@usc....
Sun Jan 17 22:33:21 CST 2010


Hello,

I've encountered a segfault in numpy when trying to compute a dot  
product for two arrays - see code below. The problem only seems to  
occur when the arrays reach a certain size. I'm using Numpy version  
1.3.0, installed via macports, on a 2.33 GHz Intel Core2 Duo Macbook  
Pro running Leopard (OSX 10.5.8). I've posted this as a bug on the  
numpy page, where I was told it might have to do with my ATLAS  
installation (version 3.8.3_1, also installed via macports). Has  
anyone run into anything like this before?

Cheers,

Mark





Example code:

import numpy as N

print 'Demonstration of Numpy Bug:'

print 'loading X (random numbers)'

SzList = [10,20,30,40,50,60,70,80,90,100]

for Sz in SzList:

	print 'X size = %d,%d'%(300,Sz)

	X = N.random.rand(300,Sz) Y = N.random.rand(300,3)

	print 'Attempting dot product of X and Y'

	N.dot(X.T,Y) print 'Finished without bug.'



Result (run through gdb):

  (There were a number of warnings like this - so many that they went  
off the top of the screen and I couldn't copy them all. This was  
typical of the warnings.)

Reading symbols for shared libraries warning: Could not find object  
file "/opt/local/var/macports/ 
build_opt_local_var_macports_sources_rsync 
.macports.org_release_ports_lang_python26/work/Python-2.6.4/build/ 
temp.macosx-10.5-i386-2.6/opt/local/var/macports/ 
build_opt_local_var_macports_sources_rsync.macports.org_release  
_ports_lang_python26/work/Python-2.6.4/Modules/_collectionsmodule.o" -  
no debug information available for "/opt/local/var/macports/build/ 
_opt_local_var_macports_sources_rsync 
.macports.org_release_ports_lang_python26/work/Python-2.6.4/Modules/ 
_collectionsmodule.c".

. done

Demonstration of Numpy Bug:

loading X (random numbers)

X size = 300,10

Attempting dot product of X and Y

Finished without bug.

X size = 300,20

Attempting dot product of X and Y

Finished without bug.

X size = 300,30

Attempting dot product of X and Y

Finished without bug.

X size = 300,40

Attempting dot product of X and Y

Finished without bug.

X size = 300,50

Attempting dot product of X and Y

Finished without bug.

X size = 300,60

Attempting dot product of X and Y



Program received signal EXC_BAD_ACCESS, Could not access memory.

Reason: 13 at address: 0x00000000

[Switching to process 56005 thread 0x117]

0x01038884 in ATL_dupMBmm0_2_0_b0 ()


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20100117/06652f6d/attachment-0001.html 


More information about the NumPy-Discussion mailing list