Jemalloc error using WGLMakie on RPI 5

I am running Julia 1.10.10 on Win11, RPI 4, and RPI 5, and only on the RPI 5 have I started getting a jemalloc error recently when calling WGLMakie. Any thoughts on why it wants a page file size of 5 bytes and why it is only filing on the RPI 5?

julia> using WGLMakie
Info Given WGLMakie was explicitly requested, output will be shown live 
ERROR: LoadError: Failed to bundle https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.mjs: <jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
memory allocation of 5 bytes failed

Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] generate_bundle_file(file::String, bundle_file::String)
    @ Bonito ~/.julia/packages/Bonito/j7uJq/src/asset-serving/asset.jl:155
  [3] Bonito.Asset(path_or_url::String; name::String, es6module::Bool, check_isfile::Bool, bundle_dir::Nothing, mediatype::Symbol)
    @ Bonito ~/.julia/packages/Bonito/j7uJq/src/asset-serving/asset.jl:177
  [4] ES6Module(path::String)
    @ Bonito ~/.julia/packages/Bonito/j7uJq/src/asset-serving/asset.jl:195
  [5] top-level scope
    @ ~/.julia/packages/Bonito/j7uJq/src/components.jl:608
  [6] include(mod::Module, _path::String)
    @ Base ./Base.jl:495
  [7] include(x::String)
    @ Bonito ~/.julia/packages/Bonito/j7uJq/src/Bonito.jl:1
  [8] top-level scope
    @ ~/.julia/packages/Bonito/j7uJq/src/Bonito.jl:65
  [9] include
    @ ./Base.jl:495 [inlined]
 [10] 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:2292
 [11] top-level scope
    @ stdin:4
in expression starting at /home/jakez/.julia/packages/Bonito/j7uJq/src/components.jl:608
in expression starting at /home/jakez/.julia/packages/Bonito/j7uJq/src/Bonito.jl:1
in expression starting at stdin:4
ERROR: LoadError: Failed to precompile Bonito [824d6782-a2ef-11e9-3a09-e5662e0c26f8] to "/home/jakez/.julia/compiled/v1.10/Bonito/jl_W8imfK".
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
    @ Base ./loading.jl:2539
  [3] compilecache
    @ ./loading.jl:2411 [inlined]
  [4] (::Base.var"#971#972"{Base.PkgId})()
    @ Base ./loading.jl:2044
  [5] mkpidlock(f::Base.var"#971#972"{Base.PkgId}, at::String, pid::Int32; kwopts::@Kwargs{stale_age::Int64, wait::Bool})
    @ FileWatching.Pidfile ~/.julia/juliaup/julia-1.10.10+0.aarch64.linux.gnu/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:93
  [6] #mkpidlock#6
    @ ~/.julia/juliaup/julia-1.10.10+0.aarch64.linux.gnu/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:88 [inlined]
  [7] trymkpidlock(::Function, ::Vararg{Any}; kwargs::@Kwargs{stale_age::Int64})
    @ FileWatching.Pidfile ~/.julia/juliaup/julia-1.10.10+0.aarch64.linux.gnu/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:111
  [8] #invokelatest#2
    @ ./essentials.jl:894 [inlined]
  [9] invokelatest
    @ ./essentials.jl:889 [inlined]
 [10] maybe_cachefile_lock(f::Base.var"#971#972"{Base.PkgId}, pkg::Base.PkgId, srcpath::String; stale_age::Int64)
    @ Base ./loading.jl:3054
 [11] maybe_cachefile_lock
    @ ./loading.jl:3051 [inlined]
 [12] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:2040
 [13] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1882
 [14] #invoke_in_world#3
    @ ./essentials.jl:926 [inlined]
 [15] invoke_in_world
    @ ./essentials.jl:923 [inlined]
 [16] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1873
 [17] macro expansion
    @ ./loading.jl:1860 [inlined]
 [18] macro expansion
    @ ./lock.jl:267 [inlined]
 [19] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1823
 [20] #invoke_in_world#3
    @ ./essentials.jl:926 [inlined]
 [21] invoke_in_world
    @ ./essentials.jl:923 [inlined]
 [22] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1816
 [23] include
    @ ./Base.jl:495 [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::Nothing)
    @ Base ./loading.jl:2292
 [25] top-level scope
    @ stdin:4
in expression starting at /home/jakez/.julia/packages/WGLMakie/FbMOf/src/WGLMakie.jl:1
in expression starting at stdin:4
  âś— Bonito
  âś— WGLMakie
Precompiling WGLMakie finished.
  0 dependencies successfully precompiled in 13 seconds. 254 already precompiled.

ERROR: The following 1 direct dependency failed to precompile:

WGLMakie 

Failed to precompile WGLMakie [276b4fcb-3e11-5398-bf8b-a0c2d153d008] to "/home/jakez/.julia/compiled/v1.10/WGLMakie/jl_dObvtt".
ERROR: LoadError: Failed to bundle https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.mjs: <jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
memory allocation of 5 bytes failed

Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] generate_bundle_file(file::String, bundle_file::String)
    @ Bonito ~/.julia/packages/Bonito/j7uJq/src/asset-serving/asset.jl:155
  [3] Bonito.Asset(path_or_url::String; name::String, es6module::Bool, check_isfile::Bool, bundle_dir::Nothing, mediatype::Symbol)
    @ Bonito ~/.julia/packages/Bonito/j7uJq/src/asset-serving/asset.jl:177
  [4] ES6Module(path::String)
    @ Bonito ~/.julia/packages/Bonito/j7uJq/src/asset-serving/asset.jl:195
  [5] top-level scope
    @ ~/.julia/packages/Bonito/j7uJq/src/components.jl:608
  [6] include(mod::Module, _path::String)
    @ Base ./Base.jl:495
  [7] include(x::String)
    @ Bonito ~/.julia/packages/Bonito/j7uJq/src/Bonito.jl:1
  [8] top-level scope
    @ ~/.julia/packages/Bonito/j7uJq/src/Bonito.jl:65
  [9] include
    @ ./Base.jl:495 [inlined]
 [10] 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:2292
 [11] top-level scope
    @ stdin:4
in expression starting at /home/jakez/.julia/packages/Bonito/j7uJq/src/components.jl:608
in expression starting at /home/jakez/.julia/packages/Bonito/j7uJq/src/Bonito.jl:1
in expression starting at stdin:4
ERROR: LoadError: Failed to precompile Bonito [824d6782-a2ef-11e9-3a09-e5662e0c26f8] to "/home/jakez/.julia/compiled/v1.10/Bonito/jl_W8imfK".
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
    @ Base ./loading.jl:2539
  [3] compilecache
    @ ./loading.jl:2411 [inlined]
  [4] (::Base.var"#971#972"{Base.PkgId})()
    @ Base ./loading.jl:2044
  [5] mkpidlock(f::Base.var"#971#972"{Base.PkgId}, at::String, pid::Int32; kwopts::@Kwargs{stale_age::Int64, wait::Bool})
    @ FileWatching.Pidfile ~/.julia/juliaup/julia-1.10.10+0.aarch64.linux.gnu/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:93
  [6] #mkpidlock#6
    @ ~/.julia/juliaup/julia-1.10.10+0.aarch64.linux.gnu/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:88 [inlined]
  [7] trymkpidlock(::Function, ::Vararg{Any}; kwargs::@Kwargs{stale_age::Int64})
    @ FileWatching.Pidfile ~/.julia/juliaup/julia-1.10.10+0.aarch64.linux.gnu/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:111
  [8] #invokelatest#2
    @ ./essentials.jl:894 [inlined]
  [9] invokelatest
    @ ./essentials.jl:889 [inlined]
 [10] maybe_cachefile_lock(f::Base.var"#971#972"{Base.PkgId}, pkg::Base.PkgId, srcpath::String; stale_age::Int64)
    @ Base ./loading.jl:3054
 [11] maybe_cachefile_lock
    @ ./loading.jl:3051 [inlined]
 [12] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:2040
 [13] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1882
 [14] #invoke_in_world#3
    @ ./essentials.jl:926 [inlined]
 [15] invoke_in_world
    @ ./essentials.jl:923 [inlined]
 [16] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1873
 [17] macro expansion
    @ ./loading.jl:1860 [inlined]
 [18] macro expansion
    @ ./lock.jl:267 [inlined]
 [19] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1823
 [20] #invoke_in_world#3
    @ ./essentials.jl:926 [inlined]
 [21] invoke_in_world
    @ ./essentials.jl:923 [inlined]
 [22] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1816
 [23] include
    @ ./Base.jl:495 [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::Nothing)
    @ Base ./loading.jl:2292
 [25] top-level scope
    @ stdin:4
in expression starting at /home/jakez/.julia/packages/WGLMakie/FbMOf/src/WGLMakie.jl:1
in expression starting at stdin:

I don’t have an answer to your question, but in general Julia doesn’t support custom memory allocators, and jemalloc specifically is also unmaintained at this point.

Sounds like a Deno bundling problem.
I just merged a fix into master, so that the bundle is already shipped with bonito without needing bundling on the system.

Thanks for looking into this. It sounds like you are saying that if I try updating or using it, that it should work. With that assumption, I just tried “up” on the project that uses WGLMakie that uses Bonito, and got the same error.
Then, in a clean directory, I tried “using Bonito” and got the same error.

Its on master, not tagged yet.
Although i did just start the tagging process.

Ahhh, sorry. I’m not familiar with the Git process jargon.

Is there a way I can pull the master and see if it works? Or a link to learning about Git and versions and such?
Thanks :slight_smile:

Oh, I tagged it last week, but didn’t realize the register bot was down…
I just tagged it again, this time for real I hope :wink:
Will take ~30 min until you can call Pkg.update(), or better ]add Bonito@4.1.4, to make sure the newest version gets added.
Meanwhile you can always do ]add Bonito#master in the Julia repl.

Looks like the same error with 4.1.4:

(directory) pkg> add Bonito@4.1.4
   Resolving package versions...
    Updating `~/Project.toml`
  [824d6782] + Bonito v4.1.4
    Updating `~/Manifest.toml`
  [d1d4a3ce] + BitFlags v0.1.9
  [824d6782] + Bonito v4.1.4
  [944b1d66] + CodecZlib v0.7.8
  [3da002f7] + ColorTypes v0.12.1
  [5ae59095] + Colors v0.13.1
  [f0e56b4a] + ConcurrentUtilities v2.5.0
  [9a962f9c] + DataAPI v1.16.0
  [e2d170a0] + DataValueInterfaces v1.0.0
  [460bff9d] + ExceptionUnwrapping v0.1.11
  [53c48c17] + FixedPointNumbers v0.8.5
  [cd3eb016] + HTTP v1.10.19
  [47d2ed2b] + Hyperscript v0.0.5
  [82899510] + IteratorInterfaceExtensions v1.0.0
  [692b3bcd] + JLLWrappers v1.7.1
  [e6f89c97] + LoggingExtras v1.2.0
  [739be429] + MbedTLS v1.1.9
  [99f44e22] + MsgPack v1.2.1
  [510215fc] + Observables v0.5.5
  [4d8831e6] + OpenSSL v1.5.0
  [bac558e1] + OrderedCollections v1.8.1
⌅ [aea7be01] + PrecompileTools v1.2.1
  [21216c6a] + Preferences v1.5.0
  [3cdcf5f2] + RecipesBase v1.3.4
  [189a3867] + Reexport v1.2.2
  [05181044] + RelocatableFolders v1.0.1
  [6c6a2e73] + Scratch v1.3.0
  [777ac1f9] + SimpleBufferStream v1.2.0
  [10745b16] + Statistics v1.11.1
  [3783bdb8] + TableTraits v1.0.1
  [bd369af6] + Tables v1.12.1
  [b189fb0b] + ThreadPools v2.1.1
  [3bb67fe8] + TranscodingStreams v0.11.3
  [5c2747f8] + URIs v1.6.1
  [eead4739] + WidgetsBase v0.1.4
⌅ [04572ae6] + Deno_jll v1.33.4+0
  [458c3c95] + OpenSSL_jll v3.5.4+0
  [56f22d72] + Artifacts v1.11.0
  [2a0f44e3] + Base64 v1.11.0
  [ade2ca70] + Dates v1.11.0
  [b77e0a4c] + InteractiveUtils v1.11.0
  [8f399da3] + Libdl v1.11.0
  [37e2e46d] + LinearAlgebra v1.11.0
  [56ddb016] + Logging v1.11.0
  [d6f4376e] + Markdown v1.11.0
  [ca575930] + NetworkOptions v1.2.0
  [de0858da] + Printf v1.11.0
  [9a3f8284] + Random v1.11.0
  [ea8e919c] + SHA v0.7.0
  [9e88b42a] + Serialization v1.11.0
  [6462fe0b] + Sockets v1.11.0
  [fa267f1f] + TOML v1.0.3
  [8dfed614] + Test v1.11.0
  [cf7118a7] + UUIDs v1.11.0
  [4ec0a83e] + Unicode v1.11.0
  [e66e0078] + CompilerSupportLibraries_jll v1.1.1+0
  [c8ffd9c3] + MbedTLS_jll v2.28.6+0
  [14a3606d] + MozillaCACerts_jll v2023.12.12
  [4536629a] + OpenBLAS_jll v0.3.27+1
  [83775a58] + Zlib_jll v1.2.13+1
  [8e850b90] + libblastrampoline_jll v5.11.0+0
        Info Packages marked with ⌅ have new versions available but compatibility constraints restrict them from upgrading. To see why use `status --outdated -m`
Precompiling project...
  âś— Bonito
  0 dependencies successfully precompiled in 6 seconds. 51 already precompiled.
  1 dependency errored.
  For a report of the errors see `julia> err`. To retry use `pkg> precompile`

julia> err
PkgPrecompileError: The following 1 direct dependency failed to precompile:

Bonito 

Failed to precompile Bonito [824d6782-a2ef-11e9-3a09-e5662e0c26f8] to "/home/directory/.julia/compiled/v1.11/Bonito/jl_8WKxEM".
ERROR: LoadError: Failed to bundle https://cdn.jsdelivr.net/npm/choices.js/public/assets/scripts/choices.min.js: <jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
memory allocation of 5 bytes failed

Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] generate_bundle_file(file::String, bundle_file::String)
    @ Bonito ~/.julia/packages/Bonito/Wixad/src/asset-serving/asset.jl:155
  [3] Bonito.Asset(path_or_url::String; name::String, es6module::Bool, check_isfile::Bool, bundle_dir::Nothing, mediatype::Symbol)
    @ Bonito ~/.julia/packages/Bonito/Wixad/src/asset-serving/asset.jl:177
  [4] ES6Module(path::String)
    @ Bonito ~/.julia/packages/Bonito/Wixad/src/asset-serving/asset.jl:195
  [5] top-level scope
    @ ~/.julia/packages/Bonito/Wixad/src/widgets.jl:864
  [6] include(mod::Module, _path::String)
    @ Base ./Base.jl:562
  [7] include(x::String)
    @ Bonito ~/.julia/packages/Bonito/Wixad/src/Bonito.jl:1
  [8] top-level scope
    @ ~/.julia/packages/Bonito/Wixad/src/Bonito.jl:64
  [9] include
    @ ./Base.jl:562 [inlined]
 [10] 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::Nothing)
    @ Base ./loading.jl:2881
 [11] top-level scope
    @ stdin:6
in expression starting at /home/directory/.julia/packages/Bonito/Wixad/src/widgets.jl:864
in expression starting at /home/directory/.julia/packages/Bonito/Wixad/src/Bonito.jl:1
in expression starting at stdin:

It’s not the same error :slight_smile:
Didn’t realize the new Choice widget also needs Deno for bundling while compiling.
I’m guessing Deno is the culprit here to bring in jemalloc and I guess this confirms it.
Will try to make a new release with prebundled deps for Choices as well.

Curious that on an RPI 4 I don’t get the same problem. This is with any version I have used in the past and specifically v4.1.3 and v4.1.4.

Not sure if you tried prebundling Choices, but still getting the “Failed to bundle choices” with 4.1.5:

(folder) pkg> status
Status `~/Project.toml`
  [824d6782] Bonito v4.1.5

julia> using Bonito
Precompiling Bonito...
Info Given Bonito was explicitly requested, output will be shown live 
ERROR: LoadError: Failed to bundle https://cdn.jsdelivr.net/npm/choices.js/public/assets/scripts/choices.min.js: <jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
memory allocation of 5 bytes failed

Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] generate_bundle_file(file::String, bundle_file::String)
    @ Bonito ~/.julia/packages/Bonito/tWcqJ/src/asset-serving/asset.jl:155
  [3] Bonito.Asset(path_or_url::String; name::String, es6module::Bool, check_isfile::Bool, bundle_dir::Nothing, mediatype::Symbol)
    @ Bonito ~/.julia/packages/Bonito/tWcqJ/src/asset-serving/asset.jl:177
  [4] ES6Module(path::String)
    @ Bonito ~/.julia/packages/Bonito/tWcqJ/src/asset-serving/asset.jl:195
  [5] top-level scope
    @ ~/.julia/packages/Bonito/tWcqJ/src/widgets.jl:864
  [6] include(mod::Module, _path::String)
    @ Base ./Base.jl:562
  [7] include(x::String)
    @ Bonito ~/.julia/packages/Bonito/tWcqJ/src/Bonito.jl:1
  [8] top-level scope
    @ ~/.julia/packages/Bonito/tWcqJ/src/Bonito.jl:64
  [9] include
    @ ./Base.jl:562 [inlined]
 [10] 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::Nothing)
    @ Base ./loading.jl:2881
 [11] top-level scope
    @ stdin:6
in expression starting at /home/jakez/.julia/packages/Bonito/tWcqJ/src/widgets.jl:864
in expression starting at /home/jakez/.julia/packages/Bonito/tWcqJ/src/Bonito.jl:1
in expression starting at stdin:6
  âś“ Colors
  âś— Bonito
  1 dependency successfully precompiled in 12 seconds. 49 already precompiled.
  1 dependency precompiled but a different version is currently loaded. Restart julia to access the new version. Otherwise, loading dependents of this package may trigger further precompilation to work with the unexpected version.

ERROR: The following 1 direct dependency failed to precompile:

Bonito 

Failed to precompile Bonito [824d6782-a2ef-11e9-3a09-e5662e0c26f8] to "/home/jakez/.julia/compiled/v1.11/Bonito/jl_ooYAsv".
ERROR: LoadError: Failed to bundle https://cdn.jsdelivr.net/npm/choices.js/public/assets/scripts/choices.min.js: <jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
memory allocation of 5 bytes failed

Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] generate_bundle_file(file::String, bundle_file::String)
    @ Bonito ~/.julia/packages/Bonito/tWcqJ/src/asset-serving/asset.jl:155
  [3] Bonito.Asset(path_or_url::String; name::String, es6module::Bool, check_isfile::Bool, bundle_dir::Nothing, mediatype::Symbol)
    @ Bonito ~/.julia/packages/Bonito/tWcqJ/src/asset-serving/asset.jl:177
  [4] ES6Module(path::String)
    @ Bonito ~/.julia/packages/Bonito/tWcqJ/src/asset-serving/asset.jl:195
  [5] top-level scope
    @ ~/.julia/packages/Bonito/tWcqJ/src/widgets.jl:864
  [6] include(mod::Module, _path::String)
    @ Base ./Base.jl:562
  [7] include(x::String)
    @ Bonito ~/.julia/packages/Bonito/tWcqJ/src/Bonito.jl:1
  [8] top-level scope
    @ ~/.julia/packages/Bonito/tWcqJ/src/Bonito.jl:64
  [9] include
    @ ./Base.jl:562 [inlined]
 [10] 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::Nothing)
    @ Base ./loading.jl:2881
 [11] top-level scope
    @ stdin:6
in expression starting at /home/jakez/.julia/packages/Bonito/tWcqJ/src/widgets.jl:864
in expression starting at /home/jakez/.julia/packages/Bonito/tWcqJ/src/Bonito.jl:1
in expression starting at stdin:

Ah no, i never merged it.
Let me merge & tag it

I added @4.1.6 and it seems to be working. Thank-you!