-
-
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
Occasional segfaults when running with @threads 3 #45196
Comments
For the record, with this code I cannot reproduce the crash nor the valgrind errors NUM_THREADS = 30
c=Channel()
function worker()
while true
take!(c)
a = Float32[]
for i in 1:rand(1:2000)
push!(a, 0.3f0)
end
end
end
tasks = [schedule(Task(worker)) for i in 1:NUM_THREADS]
for i in 1:100_000_0
i % 1000 == 0 && @info "i" i
for t in 1:NUM_THREADS
put!(c, nothing)
end
end
EDIT: The code above does not reproduce the crash because all workers run on the same thread. With the code below I can also reproduce the issues. So, the problem is not when recreating the threads, but when allocating memory on a spawned thread.
|
Have you tried it under rr? If you can catch the crash there and it still appears to be a bug in the julia runtime, you may have to send me the trace privately. |
@JeffBezanson The problem is that:
thanks |
Hi, from julia import Main
import pygame
Main.eval("""
function worker()
while true
a = Float64[]
push!(a, 0.42)
end
end
t= Threads.@spawn worker()
wait(t)
""") |
Wow, interesting. Thanks for digging in to that. |
Doss pygame do anything with signals? |
It is likely a PythonCall issue, since I think that package currently disables Julia's signal handling (signal handling is mandatory to use threads) |
This is a followup from #44460 (comment)
My real application often crashes when executed normally. Once I got this error (without valgrind):
The MWE below (which just created arrays from threads) never crashes when run normally or with rr.
However, it always quickly crashes with valgrind. I could not run it with julia 1.9 due to this, so I used julia 1.8.3. I use a sysimg with cpu_target=generic.
I get different error reports depending on the execution, but it usually ends with
Once I got these more informative errors about mutexes & GC.
The text was updated successfully, but these errors were encountered: