8000 Bus error for F order ndarray creation on SPARC (Trac #2076) · Issue #2668 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

Bus error for F order ndarray creation on SPARC (Trac #2076) #2668

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
numpy-gitbot opened this issue Oct 19, 2012 · 7 comments
Closed

Bus error for F order ndarray creation on SPARC (Trac #2076) #2668

numpy-gitbot opened this issue Oct 19, 2012 · 7 comments
Labels
00 - Bug component: Other Priority: high High priority, also add milestones for urgent issues
Milestone

Comments

@numpy-gitbot
Copy link

Original ticket http://projects.scipy.org/numpy/ticket/2076 on 2012-03-08 by @matthew-brett, assigned to unknown.

This test, using numpy '1.7.0.dev-7c07089':

import numpy as np

from StringIO import StringIO as BytesIO

from numpy.testing import assert_array_equal


def test_2d_buf():
   dtt = np.complex64
   arr = np.arange(10, dtype=dtt)
   # 2D array
   arr2 = np.reshape(arr, (2, 5))
   # Fortran write followed by (C or F) read caused bus error
   data_str = arr2.tostring('F')
   data_back = np.ndarray(arr2.shape,
                          arr2.dtype,
                          buffer=data_str,
                          order='F')
   assert_array_equal(arr2, data_back)

causes a bus error on Debian squeezy on SPARC64. This is only so for complex types as dtt, and if the array is > 1D. Debug log attached.

@numpy-gitbot
Copy link
Author

Attachment added by @matthew-brett on 2012-03-08: buf_2d.log.gz

@numpy-gitbot
Copy link
Author

@mwiebe wrote on 2012-03-12

This is likely related to how the 'aligned' flag in the ndarray interacts with the code that does low-level copying. The way this flag works now doesn't quite communicate the right information to that low-level code, and maybe this issue is a good reason to implement the better replacement.

@numpy-gitbot
Copy link
Author

Milestone changed to NumPy 1.7 by @mwiebe on 2012-03-12

@certik
Copy link
Contributor
certik commented Dec 3, 2012

Ok, just a quick update, that I was able to reproduce the error on sparc64 with Debian:

ondrej@gcc54:~/repos$ Python-2.7.3/xx/bin/python a.py 
1
Bus error

Full log is here: https://gist.github.com/4197994
and (compiled with -O0): https://gist.github.com/4199500

So let's see if I can nail it down.

@matthew-brett
Copy link
Contributor

Test above now runs without segmentation fault. It would be good to add a test for this - is the test above a reasonable one? Do you want me to add it, or will you?

Thanks for the fix.

@mwiebe
Copy link
Member
mwiebe commented Dec 9, 2012

I've added a test which I think more directly tests the issue, by taking a complex view at two offsets in a float array. I don't have sparc though to confirm it catches the failure prior to the bugfix. Does that look good?

mwiebe added a commit to mwiebe/numpy that referenced this issue Dec 11, 2012
This is the test attached to the bug from Matthew Brett.
I tried to make a simpler test, but it didn't repro
the problem.
certik added a commit that referenced this issue Dec 14, 2012
certik pushed a commit to certik/numpy that referenced this issue Dec 14, 2012
certik pushed a commit to certik/numpy that referenced this issue Dec 14, 2012
This is the test attached to the bug from Matthew Brett.
I tried to make a simpler test, but it didn't repro
the problem.
@certik
Copy link
Contributor
certik commented Dec 14, 2012

Fixed by #2794 and backported in #2817.

@certik certik closed this as completed Dec 14, 2012
matthew-brett added a commit to nipy/nibabel that referenced this issue Feb 4, 2014
2D and larger dimension arrays of complex numbers causing bus error on
numpy 1.4.1 - probabably from bug
numpy/numpy#2668

Go to 1D to work round this error.
grlee77 pushed a commit to grlee77/nibabel that referenced this issue Mar 15, 2016
2D and larger dimension arrays of complex numbers causing bus error on
numpy 1.4.1 - probabably from bug
numpy/numpy#2668

Go to 1D to work round this error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
00 - Bug component: Other Priority: high High priority, also add milestones for urgent issues
Projects
None yet
Development

No branches or pull requests

4 participants
0