Skip to content
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

Replace unconditional store with cmpswap to avoid deadlocking in jl_fptr_wait_for_compiled_addr #56444

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10166,7 +10166,8 @@ jl_llvm_functions_t jl_emit_codeinst(
!(params.imaging_mode || jl_options.incremental)) { // don't delete code when generating a precompile file
// Never end up in a situation where the codeinst has no invoke, but also no source, so we never fall
// through the cracks of SOURCE_MODE_ABI.
jl_atomic_store_release(&codeinst->invoke, jl_fptr_wait_for_compiled_addr);
jl_callptr_t expected = NULL;
jl_atomic_cmpswap_relaxed(&codeinst->invoke, &expected, jl_fptr_wait_for_compiled_addr);
jl_atomic_store_release(&codeinst->inferred, jl_nothing);
}
}
Expand Down