# ConcurrencyViolationError in precompiling JLD2 on Julia 1.12

**URL:** <https://discourse.julialang.org/t/concurrencyviolationerror-in-precompiling-jld2-on-julia-1-12/133080>\
**Category:** General Usage\
**Tags:** package\
**Created:** [October 12, 2025, 3:09am UTC](https://discourse.julialang.org/t/concurrencyviolationerror-in-precompiling-jld2-on-julia-1-12/133080 "2025-10-12T03:09:33Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ultradian](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ultradian/32/17802_2.png) [@ultradian](https://discourse.julialang.org/u/ultradian)\
**Post date:** [October 12, 2025, 3:09am UTC](https://discourse.julialang.org/t/concurrencyviolationerror-in-precompiling-jld2-on-julia-1-12/133080/1 "2025-10-12T03:09:33Z")

</div>

I just did a new install of Julia 1.12.0 and was adding packages when I got this error:

```julia-auto
PkgPrecompileError: The following 1 direct dependency failed to precompile:

JLD2 
rror encountered while load FileIO.File{FileIO.DataFormat{:JLD2}, String}("/tmp/jl_RFt2v9").

Fatal error:
ERROR: LoadError: ConcurrencyViolationError("deadlock detected in loading JLD2 using JLD2")

```

There is a Stacktrace I can add if it helps, but I wasn’t sure what would make this happen or how to approach it. Any help appreciated.

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [October 12, 2025, 8:37am UTC](https://discourse.julialang.org/t/concurrencyviolationerror-in-precompiling-jld2-on-julia-1-12/133080/2 "2025-10-12T08:37:22Z")

</div>

Can you share the output of:

```julia-auto
using Pkg
Pkg.status()

```

and the output of

```julia-auto
versioninfo()

```

?

---

<div class="post-metadata">

**Author:** ![ultradian](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ultradian/32/17802_2.png) [@ultradian](https://discourse.julialang.org/u/ultradian)\
**Post date:** [October 12, 2025, 1:48pm UTC](https://discourse.julialang.org/t/concurrencyviolationerror-in-precompiling-jld2-on-julia-1-12/133080/3 "2025-10-12T13:48:10Z")

</div>

```julia-auto
versioninfo()
Julia Version 1.12.0
Commit b907bd0600f (2025-10-07 15:42 UTC)
Build Info:
  Official https://julialang.org release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 4 × Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz
  WORD_SIZE: 64
  LLVM: libLLVM-18.1.7 (ORCJIT, skylake)
  GC: Built with stock GC
Threads: 1 default, 1 interactive, 1 GC (on 4 virtual cores)

(@v1.12) pkg> st
Status `~/.julia/environments/v1.12/Project.toml`
  [336ed68f] CSV v0.10.15
  [861a8166] Combinatorics v1.0.3
  [a93c6f00] DataFrames v1.8.0
⌅ [864edb3b] DataStructures v0.18.22
  [5c1252a2] GeometryBasics v0.5.10
⌃ [1ecd5474] GraphMakie v0.5.14
  [86223c79] Graphs v1.13.1
⌃ [033835bb] JLD2 v0.4.54
  [46757867] NetworkLayout v0.4.10

```

---

<div class="post-metadata">

**Author:** ![ultradian](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ultradian/32/17802_2.png) [@ultradian](https://discourse.julialang.org/u/ultradian)\
**Post date:** [October 12, 2025, 1:51pm UTC](https://discourse.julialang.org/t/concurrencyviolationerror-in-precompiling-jld2-on-julia-1-12/133080/4 "2025-10-12T13:51:01Z")

</div>

actually to see if it makes a difference, I removed some packages, so now it’s

```julia-auto
Status `~/.julia/environments/v1.12/Project.toml`
  [861a8166] Combinatorics v1.0.3
  [a93c6f00] DataFrames v1.8.0
⌃ [864edb3b] DataStructures v0.18.22
  [5c1252a2] GeometryBasics v0.5.10
⌃ [033835bb] JLD2 v0.4.54

```

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [October 12, 2025, 2:02pm UTC](https://discourse.julialang.org/t/concurrencyviolationerror-in-precompiling-jld2-on-julia-1-12/133080/5 "2025-10-12T14:02:50Z")

</div>

Did you try:

```julia-auto
using Pkg
Pkg.update()

```

Sometimes older versions of the packages don’t work well with the newest Julia version.

This works fine for me on Ubuntu:

```julia-auto
(tmp) pkg> st
Status `~/tmp/Project.toml`
  [861a8166] Combinatorics v1.0.3
  [a93c6f00] DataFrames v1.8.0
  [864edb3b] DataStructures v0.19.1
  [5c1252a2] GeometryBasics v0.5.10
  [033835bb] JLD2 v0.6.2

julia> using JLD2

```

---

<div class="post-metadata">

**Author:** ![nhz2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nhz2/32/44428_2.png) [@nhz2](https://discourse.julialang.org/u/nhz2)\
**Post date:** [October 12, 2025, 7:16pm UTC](https://discourse.julialang.org/t/concurrencyviolationerror-in-precompiling-jld2-on-julia-1-12/133080/6 "2025-10-12T19:16:20Z")

</div>

This was fixed in [stop precompiling FileIO.load by JonasIsensee · Pull Request #637 · JuliaIO/JLD2.jl · GitHub](https://github.com/JuliaIO/JLD2.jl/pull/637) and [convert UnPack into an extension by JonasIsensee · Pull Request #643 · JuliaIO/JLD2.jl · GitHub](https://github.com/JuliaIO/JLD2.jl/pull/643)

So only available in JLD2 0.5 or above.

Feel free to try and backport fixes to JLD2 0.4, but you probably want to be on JLD2 0.6 to avoid other fragile loading code. Any help updating packages to JLD2 0.6 is greatly appreciated. [7. Compatibility · Pkg.jl](https://pkgdocs.julialang.org/v1/compatibility/#Fixing-conflicts)

---

<div class="post-metadata">

**Author:** ![ultradian](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ultradian/32/17802_2.png) [@ultradian](https://discourse.julialang.org/u/ultradian)\
**Post date:** [October 13, 2025, 12:34am UTC](https://discourse.julialang.org/t/concurrencyviolationerror-in-precompiling-jld2-on-julia-1-12/133080/7 "2025-10-13T00:34:09Z")

</div>

That explains everything. I had installed `Agents.jl` and that pinned my to version v0.4.54. Removing, updating as @ufechner7 suggested and restarting Julia got around this issue.

I’ll see if I can help get this package updated in the Agents repo.

---

<div class="post-metadata">

**Author:** ![renatomc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/renatomc/32/217492_2.png) [@renatomc](https://discourse.julialang.org/u/renatomc)\
**Post date:** [October 14, 2025, 8:05pm UTC](https://discourse.julialang.org/t/concurrencyviolationerror-in-precompiling-jld2-on-julia-1-12/133080/8 "2025-10-14T20:05:26Z")

</div>

I have the same issue with Agents.jl; after digging around a bit, the issue is really with LightOSM, not Agents: [#111 precompile fails on Julia v1.12.0](https://github.com/DeloitteOptimalReality/LightOSM.jl/issues/111).

---

<div class="post-metadata">

**Author:** ![WyattSP](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wyattsp/32/219030_2.png) [@WyattSP](https://discourse.julialang.org/u/WyattSP)\
**Post date:** [October 16, 2025, 6:19pm UTC](https://discourse.julialang.org/t/concurrencyviolationerror-in-precompiling-jld2-on-julia-1-12/133080/9 "2025-10-16T18:19:16Z")

</div>

As a quick note for anyone else with this issue… the quickest fix for me was to just edit the project.toml for LightOSM to 0.8.1 as described by @renatomc, then re-add Agents.

---

<div class="post-metadata">

**Author:** ![nhz2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nhz2/32/44428_2.png) [@nhz2](https://discourse.julialang.org/u/nhz2)\
**Post date:** [October 17, 2025, 2:47am UTC](https://discourse.julialang.org/t/concurrencyviolationerror-in-precompiling-jld2-on-julia-1-12/133080/10 "2025-10-17T02:47:42Z")

</div>

A fix was just backported to JLD2 v0.4

> <https://github.com/JuliaIO/JLD2.jl/pull/690>
>
> This PR should allow JLD2 v0.4 to successfully compile on latest julia. 
> This …is necessary because many packages are still stuck on the v0.4 JLD2 versions due to transient dependencies and their compat bounds.
