-
-
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
Boolean indexing crashes win32-prerelease on 32-bit Vista #5647
Comments
Do you get correct result for julia> a.>3
5-element BitArray{1}:
false
false
false
true
true |
Yes. |
Boolean indexing is defined in https://github.com/JuliaLang/julia/blob/master/base/array.jl#L315-332. Do you get any error message? Does i crash on any of these lines, when you paste them in one by one? a = [1:5];
b = a.>3;
checkbounds(a, b);
n = sum(I);
out = similar(a, n); I don't have a 32 bit system, so it is hard for me to test and I just try to ask some questions to try to narrow things down. |
Thanks Ivar. (I have also updated the title of the issue.) |
This is a slow way to debug the issue, but I'll try a few more iterations if nobody else shows up that is actually able to reproduce the problem. I noticed that BitArray uses an array of Uint64 to store the single values as individual bits. dump(b)
bits(b.chunks[1])
count_ones(b[1]) |
Thank you for your debug instructions. Here is the output:
|
Sorry, I made a typo. count_ones(b.chunks[1]) |
|
Yes, that was my intention. This seems very strange, and I am kind of stuck. Can you give me some outputs of the @which a[b]
@which sum(b)
@which nnz(b)
@which count_ones(b.chunks[1]) |
I have just noted that |
This is the implementation of nnz from bitarray.jl:1605 function nnz(B::BitArray)
n = 0
Bc = B.chunks
for i = 1:length(Bc)
n += count_ones(Bc[i])
end
return n
end If |
It works, so the mystery remains ...
|
This is the point where I give up. Can you try to just paste these lines into the REPL? n = 0
Bc = b.chunks
for i = 1:length(Bc)
n += count_ones(Bc[i])
end |
It works, the result is |
Can you try this with the n = 0
Bc = b.chunks
@inbounds for i = 1:length(Bc)
n += count_ones(Bc[i])
end I have no idea why that would make a difference, but that is what I feel we have narrowed it down to. |
Unfortunately, |
OK, last attemt: Define a new function with exactly the same definition and try it on function my_nnz(B::BitArray)
n = 0
Bc = B.chunks
@inbounds for i = 1:length(Bc)
n += count_ones(Bc[i])
end
return n
end
my_nnz(b) |
Done. |
@carlobaldassi is this related to any of the recent bitarray refactoring? |
@ihnorton : I can't think of any way in which |
It seems like somehow |
It would be really unfortunate if this was due to shoddy packaging on my end. I'm currently refactoring a lot of my buildscripts to make them more generalized and reusable. Once I get everything hunky-dory again, I'll try building a set and seeing if I can reproduce this issue on my local machine. |
I too had the problem in #5701, and by removing |
I can confirm that removing |
@vtjnash Would it be correct of me to just put an |
yeah, that would be good for now |
that's the wrong issue number, but sounds good to me |
This might be a stupid question, but why is it there in the first place? Deleting it seems to be a bit hackish. Also, there's a |
Closing as dup of #5459. |
Then calling
a[a.>3]
crashes the REPL on 32-bit Vista.I have also tried this win32-prerelease on 64-bit Win7 and it works fine.
The text was updated successfully, but these errors were encountered: