-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Reliable segfault with >4d array #993
Comments
This is curious: the fault turns out to be in rand!: julia> A = randn(4,4,4,4,4); julia> A = zeros(4,4,4,4,4); julia> A = rand(4,4,4,16); julia> A = rand(4,4,4,4,4); What's really weird about it is that the last two lines have the same number of elements. To make matters even stranger: julia> A = reshape(A,4,4,4,16); julia> size(A) julia> rand!(A); But this is not just dumb luck that it segfaulted this time, because I can call rand! repeatedly safely in 4 dimensions: julia> for i = 1:1000 julia> Very, very strange. I'm guessing there's a bug in the C-representation of the array? |
I could not reproduce this on either 32- or 64-bit linux. |
OK. I'm building from a fresh repository now, I'll let you know what happens. |
Still happens on a fresh clone, running it from the usr/bin/. $ gcc --version $ uname -a Not sure what else would be helpful. Anyone else see this? Easy to check: just do rand(4,4,4,4,4) |
Stack trace or valgrind? |
Yup, segfaults for me too. |
Looks like the segfault happens in the call to DSFMT. |
Could the bug have to do with this?
|
Yup - this proves it:
|
OK, we should probably 16-byte align all arrays with element size >= 4. I don't know why I don't see the problem, but this explanation makes sense. |
Works for me now. |
Ditto. Nice work, gentlemen, on a subtle issue! |
At commit 850109e, changing to the "test" directory and running load("arrayperf.jl") causes a reliable segfault.
The text was updated successfully, but these errors were encountered: