-
-
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
@cfunction
s precompiled into a system image are not executable from a foreign thread due to TLS accesses
#43748
Comments
I think in this case cfunction is generating the wrong (very inefficient) code. But in general calling julia code from a foreign thread will not work. Luckily in this case one can call uv_async_send directly. |
Right. One has to craft very careful code. I have some more complicated examples if you want xD. The goal of #43747 was to be able to have some guarantees over such code. What cropped up in #41616 was that in in Base in the presence of |
This comment was marked as off-topic.
This comment was marked as off-topic.
now works |
@ericphanson is observing segmentation faults when using a system image with CUDA.jl (x-ref: JuliaGPU/CUDA.jl#1314). The TL;DR is that CUDA.jl uses
:uv_async_send
to triggerAsyncConditions
from a foreign thread.async_send(handle::Ptr{Cvoid}) = ccall(:uv_async_send, Cvoid, (Ptr{Cvoid},), handle)
.If we disassemble the code we normally run, when executing without a custom systemimage:
On the other hand having a custom sysimage:
The pointer to disassemble was obtained by using
Reproducer.launch()
With:
and a
precompile.jl
like:This is funnily related to #43747, since I wanted to have errors instead of mysterious segmentation faults.
cc: @KristofferC (although I don't think there is something we can do in PackageCompiler.jl), @maleadt
The text was updated successfully, but these errors were encountered: