`munmap_chunk(): invalid pointer` when wrapping a C++ package

Hello community,

I’ve been trying to wrap a C++ package using CxxWrap.jl. My wrapper code and CMakeList.txt are available here, and they seem to work locally. Then, using this build_tarballs.jl I created a jll package ghostbasil_jll which is deployed to my github succesfully but seems to cause mysterious crashes in Julia.

The problem:
I cannot get the jll package to work as intended even though my wrappers work locally. The current package crashes Julia on exit without running anything.

MWE: (this only works on Linux with julia 1.8.x and 1.9.x):

(@v1.8) pkg> add https://github.com/biona001/ghostbasil_jll.jl
julia> using CxxWrap
julia> using ghostbasil_jll
julia> @wrapmodule(ghostbasil_jll.get_libghostbasil_wrap_path)
julia> exit()

*** Error in `julia': munmap_chunk(): invalid pointer: 0x00007fa6ff48e390 ***
======= Backtrace: =========

... error truncated.

What could be going on here? I’m not sure if this is an issue with my C++ code, my build_tarballs.jl, or something internal with CxxWrap.jl? But it seems to crash without calling any of my own code, so I’m not sure what to do. The error message is not meaningful to me.

The issue was due to libcxxwrrap_julia releasing a breaking change, see 0.15 not yet registered (was Regression with 0.15) · Issue #402 · JuliaInterop/CxxWrap.jl · GitHub

It seems that for jll packages depending on libcxxwrap_julia, one should always specify a compat in the build_tarballs.jl, e.g.

Dependency("libcxxwrap_julia_jll"; compat = "0.11.2")
1 Like