-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
map!
resulting in undefined values
#36235
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
Comments
Could we do something like this instead of the existing map_n!?
|
That seams reasonable. There's bound checking that happens in |
I just tried the example on Julia 1.6-rc1, and I was not able to generate undefined values. |
|
This also happened on 1.9, so shouldn't be on the 1.10 milestone? |
@maleadt then add it to the 1.9 milestone? I don't think the right answer for a bug like this is to just forget about it for another 3 years |
Milestones are generally used to keep track of regressions, or of bugs that should hold up a release. This bugs doesn't fit that description, so I don't think it should be on the 1.10 milestone. As long as there's an open issue, it's not considered forgotten about though. |
I think this bug (exposing undefined behavior to the user, with tools as simple as |
I don't think it needs to be release blocking, as the bug has been open for years without too many people noticing. I agree it's not a good look though; I'll see if this is easy to fix. |
julia> map!(+, [], [1,2,3,4], rand(1000))
Any[]
julia> map!(+, [], [1,2,3,4], rand(1000), [])
[127897] signal 11 (1): Segmentation fault
[...] |
This also happened on
v1.4.1
Pretty sure this commit removed the necessary bounds check: f9645ff
Probably, if
@boundscheck LinearIndices(dest) == idxs1 && all(x -> LinearIndices(x) == idxs1, As)
evaluates to false, thenBoundsError
should be thrown.If I understand the intent correct,
map!(+, [0,0,0], [1,2], [10,20,30], [100])
is supposed to error because the trailing arguments don't match theaxes
of the second argument. Or at the very least because the last argument is smaller than the second argument.The text was updated successfully, but these errors were encountered: