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

Racy bitcode compilation #570

Open
maleadt opened this issue Apr 17, 2024 · 1 comment · May be fixed by #585
Open

Racy bitcode compilation #570

maleadt opened this issue Apr 17, 2024 · 1 comment · May be fixed by #585

Comments

@maleadt
Copy link
Member

maleadt commented Apr 17, 2024

I thought we already worked around this, using an atomic move-in-place:

GPUCompiler.jl/src/rtlib.jl

Lines 145 to 149 in c15433c

# atomic write to disk
temp_path, io = mktemp(dirname(path); cleanup=false)
write(io, lib)
close(io)
Base.rename(temp_path, path; force=true)

However, it looks like this still happens on CI, e.g. https://buildkite.com/julialang/metal-dot-jl/builds/947#018ee3aa-18e2-472c-b93f-f77451e3f87a

@maleadt maleadt linked a pull request May 27, 2024 that will close this issue
@maleadt
Copy link
Member Author

maleadt commented May 27, 2024

Here's another instance: https://buildkite.com/julialang/cuda-dot-jl/builds/5180#018fb96f-180e-42ad-b06a-559061791f12

I'm actually not sure where this (fatal) error comes from, as LLVM.jl already seems to handle it gracefully:

julia> LLVM.Context() do ctx parse(LLVM.Module, read("wip.jl")) end
ERROR: LLVM error: Invalid bitcode signature
Stacktrace:
 [1] handle_diagnostic(diag_ref::Ptr{LLVM.API.LLVMOpaqueDiagnosticInfo}, args::Ptr{Nothing})
   @ LLVM ~/Julia/pkg/LLVM/src/core/context.jl:134
 [2] LLVMParseBitcodeInContext2(ContextRef::Context, MemBuf::MemoryBuffer, OutModule::Base.RefValue{Ptr{…}})
   @ LLVM.API ~/Julia/pkg/LLVM/lib/15/libLLVM.jl:185

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant