Closed
Description
openedon Aug 7, 2021
The arm64 native 1.7-beta3 sometimes hangs on nested threaded loops.
MWE:
using Base.Threads: @threads
function foo()
@threads for i in 1:10
bar()
end
end
function bar()
@threads for i in 1:10
rand(100)
end
end
for i in 1:1000
println(i)
for j in 1:10000
foo()
end
end
Hangs for me after ~20-500 printed numbers. The non-minimal code was ^C-interruptable with the following stacktrace:
ERROR: InterruptException:
Stacktrace:
[1] poptask(W::Base.InvasiveLinkedListSynchronized{Task})
@ Base ./task.jl:814
[2] wait
@ ./task.jl:822 [inlined]
[3] wait(c::Base.GenericCondition{Base.Threads.SpinLock})
@ Base ./condition.jl:112
[4] _wait(t::Task)
@ Base ./task.jl:293
[5] wait
@ ./task.jl:320 [inlined]
[6] threading_run(func::Function)
@ Base.Threads ./threadingconstructs.jl:38
[7] macro expansion
@ ./threadingconstructs.jl:97 [inlined]
julia> versioninfo()
Julia Version 1.7.0-beta3
Commit e76c9dad42* (2021-07-07 08:12 UTC)
Platform Info:
OS: macOS (arm64-apple-darwin20.5.0)
CPU: Apple M1
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-12.0.0 (ORCJIT, cyclone)
ref #36617 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment