# "cache misses, incompatible header" when loading library

**URL:** <https://discourse.julialang.org/t/cache-misses-incompatible-header-when-loading-library/125357>\
**Category:** General Usage\
**Tags:** question, precompilation, stacked-environments\
**Created:** [January 29, 2025, 6:39pm UTC](https://discourse.julialang.org/t/cache-misses-incompatible-header-when-loading-library/125357 "2025-01-29T18:39:35Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [January 29, 2025, 6:39pm UTC](https://discourse.julialang.org/t/cache-misses-incompatible-header-when-loading-library/125357/1 "2025-01-29T18:39:35Z")

</div>

On Julia 11.3, I am getting errors with the above message when loading some libraries, eg

```julia
using Profile, PProf
[Info: Precompiling PProf [e4faabce-9ead-11e9-39d9-4379958e3056] (cache misses: wrong dep version loaded (2), incompatible header (2))
ERROR: LoadError: InitError: could not load library "/home/tamas/.julia/artifacts/a58c60683d9991d236f2a2d707edcc09974ca62b/lib/libpango-1.0.so"
/home/tamas/.julia/artifacts/a58c60683d9991d236f2a2d707edcc09974ca62b/lib/libpango-1.0.so: undefined symbol: hb_ot_color_has_paint
Stacktrace:
  [1] dlopen(s::String, flags::UInt32; throw_error::Bool)
    @ Base.Libc.Libdl ./libdl.jl:120
  [2] dlopen(s::String, flags::UInt32)
    @ Base.Libc.Libdl ./libdl.jl:119
  [3] macro expansion
    @ ~/.julia/packages/JLLWrappers/GfYNv/src/products/library_generators.jl:63 [inlined]
  [4] __init__ ()
    @ Pango_jll ~/.julia/packages/Pango_jll/HJ4pp/src/wrappers/x86_64-linux-gnu.jl:16
  [5] run_module_init(mod::Module, i::Int64)
    @ Base ./loading.jl:1378
  [6] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1366
  [7] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any}, ignore_native::Nothing; register::Bool)
    @ Base ./loading.jl:1254
  [8] _include_from_serialized (repeats 2 times)
    @ ./loading.jl:1210 [inlined]
  [9] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128, stalecheck::Bool; reasons::Dict{String, Int64}, DEPOT_PATH::Vector{String})
    @ Base ./loading.jl:2057
 [10] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:2527
 [11] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:2388
 [12] #invoke_in_world#3
    @ ./essentials.jl:1089 [inlined]
 [13] invoke_in_world
    @ ./essentials.jl:1086 [inlined]
 [14] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:2375
 [15] macro expansion
    @ ./loading.jl:2314 [inlined]
 [16] macro expansion
    @ ./lock.jl:273 [inlined]
 [17] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:2271
 [18] #invoke_in_world#3
    @ ./essentials.jl:1089 [inlined]
 [19] invoke_in_world
    @ ./essentials.jl:1086 [inlined]
 [20] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:2260
 [21] include(mod::Module, _path::String)
    @ Base ./Base.jl:557
 [22] top-level scope
    @ ~/.julia/packages/JLLWrappers/GfYNv/src/toplevel_generators.jl:199
 [23] include
    @ ./Base.jl:557 [inlined]
 [24] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::String)
    @ Base ./loading.jl:2881
 [25] top-level scope
    @ stdin:6

```

Is this a bug? Deleting `~/.julia/artifacts` or `~/.julia/compiled` does not fix it.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [January 29, 2025, 7:05pm UTC](https://discourse.julialang.org/t/cache-misses-incompatible-header-when-loading-library/125357/2 "2025-01-29T19:05:03Z")

</div>

But deleting **everything** in `~/.julia` (except `config`) does fix it, so it must have been some kind of database/file corruption. But I am wondering what I could have deleted selectively to make this work.

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [January 29, 2025, 7:20pm UTC](https://discourse.julialang.org/t/cache-misses-incompatible-header-when-loading-library/125357/3 "2025-01-29T19:20:59Z")

</div>

The real error is

```julia
ERROR: LoadError: InitError: could not load library "/home/tamas/.julia/artifacts/a58c60683d9991d236f2a2d707edcc09974ca62b/lib/libpango-1.0.so"
/home/tamas/.julia/artifacts/a58c60683d9991d236f2a2d707edcc09974ca62b/lib/libpango-1.0.so: undefined symbol: hb_ot_color_has_paint

```

The warning you quoted in the title is irrelevant here, it was only informing you that an existing pkgimage couldn’t be loaded. It’s however now impossible to investigate why you got that error message after you nuked your entire depot, which I generally strongly discourage doing, it’s bad practice and can cause data loss for someone who doesn’t know what they’re doing.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [January 29, 2025, 7:35pm UTC](https://discourse.julialang.org/t/cache-misses-incompatible-header-when-loading-library/125357/4 "2025-01-29T19:35:45Z")

</div>

> [@giordano](#):
>
> which I generally strongly discourage doing, it’s bad practice and can cause data loss for someone who doesn’t know what they’re doing.

I had to proceed with some work and did not want to backup 2G of data, and I know what I was doing (I don’t have any data there except for `config`, I don’t work in `dev`).

But I am curious what the good practice is, for the next time something like this happens.

**EDIT** Ouch, somehow I am getting the same error again. Ready to debug this if you give me some hints.

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [January 29, 2025, 7:42pm UTC](https://discourse.julialang.org/t/cache-misses-incompatible-header-when-loading-library/125357/5 "2025-01-29T19:42:52Z")

</div>

> [@Tamas\_Papp](#):
>
> **EDIT** Ouch, somehow I am getting the same error again. Ready to debug this if you give me some hints.

I’d start with

```julia
]status -m Pango_jll HarfBuzz_jll

```

Also, do you have `LD_LIBRARY_PATH` set?

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [January 30, 2025, 6:21am UTC](https://discourse.julialang.org/t/cache-misses-incompatible-header-when-loading-library/125357/6 "2025-01-30T06:21:11Z")

</div>

Thanks, that solved the mystery. It works like this: my global environment has PProf.jl, with

```julia
  [2e76f6c2] HarfBuzz_jll v8.5.0+0
  [36c8627f] Pango_jll v1.55.5+0

```

( **EDIT** pasted the wrong versions first)

But then I activate a particular environment that includes Miter.jl, which depends on tectonic\_jll, currently version 0.15.0, which is pinned to

```julia
⌅ [2e76f6c2] HarfBuzz_jll v2.8.1+1

```

On the one hand, I understand how [stacked environments](https://docs.julialang.org/en/v1/manual/code-loading/#Environments) can lead to this kind of bug. But getting a more direct warning about it would be nice, as the root cause is not apparent at first sight.

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [January 30, 2025, 6:30am UTC](https://discourse.julialang.org/t/cache-misses-incompatible-header-when-loading-library/125357/7 "2025-01-30T06:30:34Z")

</div>

> [@Tamas\_Papp](#):
>
> I understand how [stacked environments](https://docs.julialang.org/en/v1/manual/code-loading/#Environments) can lead to this kind of bug. But getting a more direct warning about it would be nice,

I believe Julia v1.12 shows you in `]status` the version actually loaded of a package in addition to the one nominally in the environment, if the two differ.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [January 30, 2025, 10:16am UTC](https://discourse.julialang.org/t/cache-misses-incompatible-header-when-loading-library/125357/8 "2025-01-30T10:16:00Z")

</div>

Thanks, I don’t see it in the NEWS file but that should be useful.

But to step back a bit: I was assuming that I can keep debug tools like PProf.jl in the global Julia project, and load them from a specific project I activated. Clearly this assumption is incorrect because it could lead to errors like this.

What is the right approach then? Add them to the project I am debugging, and remove when I am done?
