- Sponsor
-
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
Revert "Make StridedReinterpretArray
's get/setindex
pointer based."
#52101
Closed
+109
−191
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Looks quite unrelated? |
Yeah, that confuses me too, but I don't think we had seen this before. Perhaps it was something else recent though that led to different compilation? |
Confirmed that this segfaulting is reproducable without #44186. using Test, InteractiveUtils
struct TSlow{T,N} <: AbstractArray{T,N}
data::Dict{NTuple{N,Int}, T}
dims::NTuple{N,Int}
end
TSlow(::Type{T}, dims::NTuple{N,Int}) where {T,N} = TSlow{T,N}(Dict{NTuple{N,Int}, T}(), dims)
TSlow(X::AbstractArray{T,N}) where {T,N} = TSlow{T,N}(X)
TSlow{T,N}(X::AbstractArray ) where {T,N } = begin
A = TSlow(T, size(X))
for I in CartesianIndices(X)
A[Tuple(I)...] = X[Tuple(I)...]
end
A
end
Base.size(A::TSlow) = A.dims
Base.getindex(A::TSlow{T,N}, i::Vararg{Int,N}) where {T,N} = get(A.data, i, zero(T))
Base.setindex!(A::TSlow{T,N}, v, i::Vararg{Int,N}) where {T,N} = (A.data[i] = v)
B = Complex{Int64}[5+6im, 7+8im, 9+10im]
function f(Bc)
reinterpret(NTuple{3, Int64}, Bc)[2] = (4,5,6)
@test Bc == Complex{Int64}[5+6im, 7+4im, 5+6im]
B2 = reinterpret(NTuple{3, Int64}, Bc)
@test setindex!(B2, (1,2,3), 1) === B2
end
versioninfo()
f(TSlow(B)) Result: $ usr/bin/julia.exe -e "include(\"C:\\\\Users\\\\MYJ\\\\.envpack\\\\temp.jl\")"
Julia Version 1.11.0-DEV.862
Commit 8f8b9cacdf (2023-11-08 15:20 UTC)
Platform Info:
OS: Windows (i686-w64-mingw32)
CPU: 16 × 12th Gen Intel(R) Core(TM) i7-12650H
WORD_SIZE: 32
LLVM: libLLVM-15.0.7 (ORCJIT, alderlake)
Threads: 8 on 12 virtual cores
Environment:
JULIA_CPU_THREADS = 12
JULIA_NUM_THREADS = 6
Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x27a9c4f3 -- memcpy at .\cmem.jl:14 [inlined]
_setindex_ra! at .\reinterpretarray.jl:584 [inlined]
setindex! at .\reinterpretarray.jl:505 [inlined]
macro expansion at D:\Documents\GitHub\julia\julia-mingw-w32\usr\share\julia\stdlib\v1.11\Test\src\Test.jl:676 [inlined]
f at C:\Users\MYJ\.envpack\temp.jl:27
in expression starting at C:\Users\MYJ\.envpack\temp.jl:30
memcpy at .\cmem.jl:14 [inlined]
_setindex_ra! at .\reinterpretarray.jl:584 [inlined]
setindex! at .\reinterpretarray.jl:505 [inlined]
macro expansion at D:\Documents\GitHub\julia\julia-mingw-w32\usr\share\julia\stdlib\v1.11\Test\src\Test.jl:676 [inlined]
f at C:\Users\MYJ\.envpack\temp.jl:27
unknown function (ip: 27a9cb31)
_jl_invoke at /cygdrive/d/Documents/GitHub/julia/src\gf.c:2913 [inlined]
ijl_apply_generic at /cygdrive/d/Documents/GitHub/julia/src\gf.c:3095
jl_apply at /cygdrive/d/Documents/GitHub/julia/src\julia.h:2130 [inlined]
do_call at /cygdrive/d/Documents/GitHub/julia/src\interpreter.c:126
eval_value at /cygdrive/d/Documents/GitHub/julia/src\interpreter.c:223
eval_stmt_value at /cygdrive/d/Documents/GitHub/julia/src\interpreter.c:174 [inlined]
eval_body at /cygdrive/d/Documents/GitHub/julia/src\interpreter.c:641
jl_interpret_toplevel_thunk at /cygdrive/d/Documents/GitHub/julia/src\interpreter.c:795
jl_toplevel_eval_flex at /cygdrive/d/Documents/GitHub/julia/src\toplevel.c:938
jl_toplevel_eval_flex at /cygdrive/d/Documents/GitHub/julia/src\toplevel.c:881
ijl_toplevel_eval at /cygdrive/d/Documents/GitHub/julia/src\toplevel.c:947 [inlined]
ijl_toplevel_eval_in at /cygdrive/d/Documents/GitHub/julia/src\toplevel.c:989
eval at .\boot.jl:418 [inlined]
include_string at .\loading.jl:2133
jl_fptr_args at /cygdrive/d/Documents/GitHub/julia/src\gf.c:2555
_jl_invoke at /cygdrive/d/Documents/GitHub/julia/src\gf.c:2894 [inlined]
ijl_apply_generic at /cygdrive/d/Documents/GitHub/julia/src\gf.c:3095
_include at .\loading.jl:2193
include at .\sysimg.jl:38
unknown function (ip: 27a90071)
_jl_invoke at /cygdrive/d/Documents/GitHub/julia/src\gf.c:2913 [inlined]
ijl_apply_generic at /cygdrive/d/Documents/GitHub/julia/src\gf.c:3095
jl_apply at /cygdrive/d/Documents/GitHub/julia/src\julia.h:2130 [inlined]
do_call at /cygdrive/d/Documents/GitHub/julia/src\interpreter.c:126
eval_value at /cygdrive/d/Documents/GitHub/julia/src\interpreter.c:223
eval_stmt_value at /cygdrive/d/Documents/GitHub/julia/src\interpreter.c:174 [inlined]
eval_body at /cygdrive/d/Documents/GitHub/julia/src\interpreter.c:641
jl_interpret_toplevel_thunk at /cygdrive/d/Documents/GitHub/julia/src\interpreter.c:795
jl_toplevel_eval_flex at /cygdrive/d/Documents/GitHub/julia/src\toplevel.c:938
jl_toplevel_eval_flex at /cygdrive/d/Documents/GitHub/julia/src\toplevel.c:881
ijl_toplevel_eval at /cygdrive/d/Documents/GitHub/julia/src\toplevel.c:947 [inlined]
ijl_toplevel_eval_in at /cygdrive/d/Documents/GitHub/julia/src\toplevel.c:989
eval at .\boot.jl:418 [inlined]
exec_options at .\client.jl:291
_start at .\client.jl:525
jfptr__start_69683 at D:\Documents\GitHub\julia\julia-mingw-w32\usr\lib\julia\sys.dll (unknown line)
_jl_invoke at /cygdrive/d/Documents/GitHub/julia/src\gf.c:2894 [inlined]
ijl_apply_generic at /cygdrive/d/Documents/GitHub/julia/src\gf.c:3095
jl_apply at /cygdrive/d/Documents/GitHub/julia/src\julia.h:2130 [inlined]
true_main at /cygdrive/d/Documents/GitHub/julia/src\jlapi.c:586
jl_repl_entrypoint at /cygdrive/d/Documents/GitHub/julia/src\jlapi.c:738
jl_load_repl at /cygdrive/d/Documents/GitHub/julia/cli\loader_lib.c:569
mainCRTStartup at /cygdrive/d/Documents/GitHub/julia/cli\loader_exe.c:58
BaseThreadInitThunk at C:\Windows\System32\KERNEL32.DLL (unknown line)
RtlInitializeExceptionChain at C:\Windows\SYSTEM32\ntdll.dll (unknown line)
RtlClearBits at C:\Windows\SYSTEM32\ntdll.dll (unknown line)
Allocations: 1454771 (Pool: 1454720; Big: 51); GC: 4
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reverts #44186 because it seems to be segfaulting on CI, even though not clear why they would be related