thouis / numpy-trac-migration

numpy Trac to github issues migration
2 stars 3 forks source link

Solaris segfault (migrated from Trac #1713) #3264

Open thouis opened 12 years ago

thouis commented 12 years ago

Original ticket http://projects.scipy.org/numpy/ticket/1713 Reported 2011-01-15 by atmention:rgommers, assigned to unknown.

Reported on the mailing list on 3 Jan 2011 by John Hunter.

johnhatmention:udesktop253:~> gcc --version
gcc (GCC) 3.4.3 (csl-sol210-3_4-branch+sol_rpath)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

johnhatmention:udesktop253:~> uname -a
SunOS udesktop253 5.10 Generic_142910-17 i86pc i386 i86pc

johnhatmention:udesktop253:~> cat test.py
import numpy as np
print np.__version__
fs = 1000
t = np.linspace(0, 0.3, 301)
A = np.array([2, 8]).reshape(-1, 1)
f = np.array([150, 140]).reshape(-1, 1)
xn = (A * np.exp(2j * np.pi * f * t)).sum(axis=0)

johnhatmention:udesktop253:~> python test.py
2.0.0.dev-9451260
Segmentation Fault (core dumped)
johnhatmention:udesktop253:~>
johnhatmention:udesktop253:~> sudo pstack /var/core/core.python.957
core '/var/core/core.python.957' of 9397:       python test.py
 febf1928 cexp     (0, 0, 0, 0, 8060ab0, 84321ac) + 1b0
 fe9657e0 npy_cexp (80458e0, 0, 0, 0, 0, 84e2530) + 30
 fe95064f nc_exp   (8045920, 84e72a0, 8045978, 8045920, 10, 10) + 3f
 fe937d5b PyUFunc_D_D (84e2530, 84e20f4, 84e25b0, fe950610, 1, 0) + 5b
 fe95e818 PyUFunc_GenericFunction (81e96e0, 807deac, 0, 80460b8, 2, 2) + 448
 fe95fb10 ufunc_generic_call (81e96e0, 807deac, 0, fe98a820) + 70
 feeb2d78 PyObject_Call (81e96e0, 807deac, 0, 80a24ec, 8061c08, 0) + 28
 fef11900 PyEval_EvalFrame (80a2394, 81645a0, 8079824, 8079824) + 146c
 fef17708 PyEval_EvalCodeEx (81645a0, 8079824, 8079824, 0, 0, 0) + 620
 fef178af PyEval_EvalCode (81645a0, 8079824, 8079824, 8061488, fef3d9ee, 0) + 2f
 fef3d095 PyRun_FileExFlags (feb91c98, 804687b, 101, 8079824, 8079824, 1) + 75
 fef3d9ee PyRun_SimpleFileExFlags (feb91c98, 804687b, 1, 80465a8, fef454a1, 804687b) + 172
 fef3e4fd PyRun_AnyFileExFlags (feb91c98, 804687b, 1, 80465a8) + 61
 fef454a1 Py_Main  (1, 80466b8, feb1cf35, fea935a1, 29, feb96750) + 9d9
 08050862 main     (2, 80466b8, 80466c4) + 22
 08050758 _start   (2, 8046874, 804687b, 0, 8046883, 80468ad) + 60
thouis commented 12 years ago

Comment in Trac by atmention:rgommers, 2011-01-15

thouis commented 12 years ago

Comment in Trac by atmention:charris, 2011-04-13

Hmm... This isn't SPARC so we can rule out the usual alignment problems. The call to cexp looks pretty routine and works here on x86_64. I can't tell right away if the call is to the numpy or the gcc version of cexp, but with the old compiler it may be the numpy version.

Can you find a simpler example that causes the same problem?

thouis commented 12 years ago

Comment in Trac by atmention:rgommers, 2011-04-13

I'm guessing you're asking John, so CC'ing him.

thouis commented 12 years ago

Comment in Trac by trac user jdh2358, 2011-08-17

I can confirm that the seg fault still occurs on git HEAD numpy 2.0.0.dev-4386275

Here is a much simpler script that exposes it ::

import numpy as np
print np.__version__
xn = np.exp(2j)

And here is the stack trace: johnhatmention:udesktop253:~> sudo pstack /var/core/core.python.957 core '/var/core/core.python.957' of 28628: python test.py febf1928 cexp (0, 0, 0, 40000000, 1, 807dec0) + 1b0 fe8a6820 npy_cexp (8045420, 0, 0, 0, 40000000, 2) + 30 fe894fef nc_exp (8045460, 8212480, f, 8045460, 0, 0) + 3f fe877d7b PyUFunc_D_D (80454c4, 80454bc, 80454b4, fe894fb0, fe8a7aa9, 8045a9c) + 5b fe8892b2 trivial_two_operand_loop (0, 0, 0, 0, 0, 8212480) + 112 fe8a0eb5 PyUFunc_GenericFunction (81a3438, 807deac, 0, 8045a98, 80a31e0, 8045858) + 1465 fe8a13c0 ufunc_generic_call (81a3438, 807deac, 0, fe8cbfa0) + 70 feeb2d78 PyObject_Call (81a3438, 807deac, 0, 81a3018, 8061848, 0) + 28 fef11900 PyEval_EvalFrame (81a2ec4, 816c5e0, 8079824, 8079824) + 146c fef17708 PyEval_EvalCodeEx (816c5e0, 8079824, 8079824, 0, 0, 0) + 620 fef178af PyEval_EvalCode (816c5e0, 8079824, 8079824, 8061458, fef3d9ee, 0) + 2f fef3d095 PyRun_FileExFlags (feb91c98, 804627b, 101, 8079824, 8079824, 1) + 75 fef3d9ee PyRun_SimpleFileExFlags (feb91c98, 804627b, 1, 8045f88, fef454a1, 804627b) + 172 fef3e4fd PyRun_AnyFileExFlags (feb91c98, 804627b, 1, 8045f88) + 61 fef454a1 Py_Main (1, 804609c, feb1cf35, fea935a1, 29, feb96750) + 9d9 08050862 main (2, 804609c, 80460a8) + 22 08050758 _start (2, 8046274, 804627b, 0, 8046283, 80462ad) + 60

thouis commented 12 years ago

Comment in Trac by trac user jdh2358, 2011-08-17

Repost because my formatting was screwed.

I can confirm that the seg fault still occurs on git HEAD numpy 2.0.0.dev-4386275

Here is a much simpler script that exposes it

import numpy as np
print np.__version__

xn = np.exp(2j)

and here is the stack trace

johnhatmention:udesktop253:~> sudo pstack /var/core/core.python.957
core '/var/core/core.python.957' of 28628:      python test.py
 febf1928 cexp     (0, 0, 0, 40000000, 1, 807dec0) + 1b0
 fe8a6820 npy_cexp (8045420, 0, 0, 0, 40000000, 2) + 30
 fe894fef nc_exp   (8045460, 8212480, f, 8045460, 0, 0) + 3f
 fe877d7b PyUFunc_D_D (80454c4, 80454bc, 80454b4, fe894fb0, fe8a7aa9, 8045a9c) + 5b
 fe8892b2 trivial_two_operand_loop (0, 0, 0, 0, 0, 8212480) + 112
 fe8a0eb5 PyUFunc_GenericFunction (81a3438, 807deac, 0, 8045a98, 80a31e0, 8045858) + 1465
 fe8a13c0 ufunc_generic_call (81a3438, 807deac, 0, fe8cbfa0) + 70
 feeb2d78 PyObject_Call (81a3438, 807deac, 0, 81a3018, 8061848, 0) + 28
 fef11900 PyEval_EvalFrame (81a2ec4, 816c5e0, 8079824, 8079824) + 146c
 fef17708 PyEval_EvalCodeEx (816c5e0, 8079824, 8079824, 0, 0, 0) + 620
 fef178af PyEval_EvalCode (816c5e0, 8079824, 8079824, 8061458, fef3d9ee, 0) + 2f
 fef3d095 PyRun_FileExFlags (feb91c98, 804627b, 101, 8079824, 8079824, 1) + 75
 fef3d9ee PyRun_SimpleFileExFlags (feb91c98, 804627b, 1, 8045f88, fef454a1, 804627b) + 172
 fef3e4fd PyRun_AnyFileExFlags (feb91c98, 804627b, 1, 8045f88) + 61
 fef454a1 Py_Main  (1, 804609c, feb1cf35, fea935a1, 29, feb96750) + 9d9
 08050862 main     (2, 804609c, 80460a8) + 22
 08050758 _start   (2, 8046274, 804627b, 0, 8046283, 80462ad) + 60