-
-
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
Segmentation fault with threads #47826
Comments
I get an assertion failure with a debug build julia> @time Threads.@threads for ik in 1:nk
for j in 1:nk
A[:, :, ik] += B[:, :, j]
end
end
Assertion failed: (ly->fielddesc_type == 2), function jl_field_offset, file julia.h, line 1163. |
Poking at memory in rr, I saw this was allocated in thread 4 by this thread: julia> descend(getindex, (Array{Base.Complex{Float64}, 3}, Function, Function, Int64), debuginfo=:none) Then immediately freed (set to NULL) by thread 1 before we get a chance to use it: Emission is pretty straightforward: define nonnull {}* @julia_getindex_1682({}* noundef nonnull align 16 dereferenceable(40) %0, {}* noundef nonnull readonly %1, {}* noundef nonnull readonly %2, i64 signext %3) #0 {
top:
%I = alloca {}*, align 8
...
%20 = call nonnull {}* ({}* ({}*, {}**, i32)*, {}*, ...) @julia.call({}* ({}*, {}**, i32)* @jl_f_tuple, {}* null, {}* %1, {}* %2, {}* %19)
...
fence syncscope("singlethread") seq_cst
%22 = bitcast {}** %ptls to i64**
%23 = getelementptr inbounds i64*, i64** %22, i64 2
%safepoint = load i64*, i64** %23, align 8
%24 = load volatile i64, i64* %safepoint, align 8
fence syncscope("singlethread") seq_cst
...
%70 = load {}*, {}** %I, align 8
%71 = call {}* @ijl_get_nth_field_checked({}* %70, i64 0)
... But we don't end up putting the GC store until the first real call in this function. |
Why would that fix this? I though that PR just changed the safepoint block to an intrinsic that we lowered later, or would it also impede the safepoint from moving? |
For a simple multithreading code, it seems with version 1.9.0-alpha1, when running with more than 1 threads, julia crash randomly (more than 50%, but there are few chances the code finished fine). However, it is working fine with 1.8.3.
The output of
versioninfo()
How you installed Julia
A minimal working example (MWE), also known as a minimum reproducible example
The crash output is somewhat not unique, following are the output I collected:
The text was updated successfully, but these errors were encountered: