Open c42f opened 3 years ago
I see the require(uuidkey::Base.PkgId)
is called in the error callstack, so this thread issue perhaps happens during the io backend loading time.
@IanButterworth is this the exact reason that we have checked_import
in ImageIO.jl? https://github.com/JuliaIO/ImageIO.jl/blob/bae08524621a7b14c1d1d9e9d77c9117e3e85807/src/ImageIO.jl#L25-L32
Yes, the fact that the crash happens during a call to require()
was concerning.
Perhaps this indicates that Base.require
itself is not threadsafe, because it appears to use plain Base.Condition
, rather than Threads.Condition
.
Calls to require
should very likely be behind a lock.
For the record, #339 fixes this for Julia >= 1.3. For old Julia versions, it's still broken.
Debugging some concurrency issues, I ended up inside the source of
FileIO
and saw that it maintains global state insym2loader
andsym2safer
(and maybe other places) which is not protected by locks.Presumably this can cause problems when these dictionaries are mutated during
load
, etc.I don't have time to make an MWE right now, but I thought I'd leave a note about this nevertheless.
Here's a sample stacktrace from a loop which essentially does the following for a bunch of JPEG files: