-
Notifications
You must be signed in to change notification settings - Fork 91
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
Errors in CI with threads #281
Comments
I can reproduce it easily on my computer: PS C:\Users\Marc> julia -t 12 --startup-file no
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.10.0-rc1 (2023-11-03)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> vals = [1.0]
@Threads.threads for i in 1:100000
push!(vals, rand())
if sum(vals) |> isnan
error("isnan at i=$i in thread ", Threads.threadid())
end
end
ERROR: TaskFailedException
nested task error: isnan at i=25079 in thread 5
Stacktrace:
[1] error(::String, ::Int64)
@ Base .\error.jl:44
[2] macro expansion
@ .\REPL[2]:5 [inlined]
[3] (::var"#37#threadsfor_fun#8"{var"#37#threadsfor_fun#7#9"{UnitRange{Int64}}})(tid::Int64; onethread::Bool)
@ Main .\threadingconstructs.jl:214
[4] #37#threadsfor_fun
@ Main .\threadingconstructs.jl:181 [inlined]
[5] (::Base.Threads.var"#1#2"{var"#37#threadsfor_fun#8"{var"#37#threadsfor_fun#7#9"{UnitRange{Int64}}}, Int64})()
@ Base.Threads .\threadingconstructs.jl:153
...and 1 more exception.
Stacktrace:
[1] threading_run(fun::var"#37#threadsfor_fun#8"{var"#37#threadsfor_fun#7#9"{UnitRange{Int64}}}, static::Bool)
@ Base.Threads .\threadingconstructs.jl:171
[2] macro expansion
@ .\threadingconstructs.jl:219 [inlined]
[3] top-level scope
@ .\REPL[2]:2
julia> sum(vals)
28644.464412973262 with bigger iterations I can also get some nice errors: julia> vals = [1.0]
@Threads.threads for i in 1:1000000
push!(vals, rand())
if sum(vals) |> isnan
# error("isnan at i=$i in thread ", Threads.threadid())
end
end
Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x2aa1e9e5b33 -- + at .\float.jl:409 [inlined]
add_sum at .\reduce.jl:27 [inlined]
macro expansion at .\reduce.jl:265 [inlined]
macro expansion at .\simdloop.jl:77 [inlined]
mapreduce_impl at .\reduce.jl:263
in expression starting at REPL[6]:2
+ at .\float.jl:409 [inlined]
add_sum at .\reduce.jl:27 [inlined]
macro expansion at .\reduce.jl:265 [inlined]
macro expansion at .\simdloop.jl:77 [inlined]
mapreduce_impl at .\reduce.jl:263
mapreduce_impl at .\reduce.jl:272
mapreduce_impl at .\reduce.jl:271
mapreduce_impl at .\reduce.jl:271
mapreduce_impl at .\reduce.jl:272
mapreduce_impl at .\reduce.jl:272
mapreduce_impl at .\reduce.jl:277 [inlined]
_mapreduce at .\reduce.jl:447 [inlined]
_mapreduce_dim at .\reducedim.jl:365 [inlined]
#mapreduce#821 at .\reducedim.jl:357 [inlined]
mapreduce at .\reducedim.jl:357 [inlined]
#_sum#831 at .\reducedim.jl:1001 [inlined]
_sum at .\reducedim.jl:1001 [inlined]
#_sum#830 at .\reducedim.jl:1000 [inlined]
_sum at .\reducedim.jl:1000 [inlined]
#sum#828 at .\reducedim.jl:996 [inlined]
sum at .\reducedim.jl:996
unknown function (ip: 000002aa1e9e5df0)
macro expansion at .\REPL[6]:4 [inlined]
#82#threadsfor_fun#16 at .\threadingconstructs.jl:214
#82#threadsfor_fun at .\threadingconstructs.jl:181 [inlined]
#1 at .\threadingconstructs.jl:153
unknown function (ip: 000002aa1e9fbe2b)
Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x7ffc19d6974e -- at 0x7ffc19d6974e -- ION with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATIONjulia.h:1976 [inlined]
start_task at C:/workdir/src\task.c:1238
Allocations: 841296 (Pool: 840419; Big: 877); GC: 1
memcpy at C:\WINDOWS\System32\msvcrt.dll (unknown line)
fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x7ffc1bd4be8d -- at 0x7ffc1bd4be8d -- ION32\msvcrt.dll (unknown line)
fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION I don't know much about thread-safety, should this code be thread-safe? Otherwise it looks like a bug in Julia |
Bonus point for this error that seems to be somewhat repeatable in Julia nightly (1.11.0-DEV.879)
|
seems similar to JuliaLang/julia#52032 |
sometimes, it also crashes juliaup
the report file in question:
|
Ironically, it looks like ProgressMeter.jl/src/ProgressMeter.jl Lines 474 to 481 in 65d049e
error from CI:
|
dup #232 |
During the CI of #157, this error happened once only (didn't happen when re-running the job)
https://github.com/timholy/ProgressMeter.jl/actions/runs/6605620538/job/17940975807?pr=157#step:7:15122
this code errored:
ProgressMeter.jl/test/test_threads.jl
Lines 43 to 61 in 5b3bd1d
basically
sum([300.0; -rand()...]) == NaN
??the seed is set in
test.jl
so it should be repetableis it because of threads? It doesn't seem to be a problem with
ProgressMeter.jl
reallyOr is it not a big deal since it happened only once in a CI?
The text was updated successfully, but these errors were encountered: