Trying to debug ReadOnlyMemoryError()

When precompiling the main branch of KiteModels.jl I get:

julia> integrator = KiteModels.init_sim!(kps4_; delta=0.03, stiffness_factor=0.05, prn=false) 
ERROR: ReadOnlyMemoryError()
Stacktrace:
  [1] _evaluate(t::Vector{Float64}, c::Vector{Float64}, k::Int64, x::Float64, bc::Int64)
    @ Dierckx ~/.julia/packages/Dierckx/TDOyl/src/Dierckx.jl:279
  [2] evaluate
    @ ~/.julia/packages/Dierckx/TDOyl/src/Dierckx.jl:296 [inlined]
  [3] Spline1D
    @ ~/.julia/packages/Dierckx/TDOyl/src/Dierckx.jl:1112 [inlined]
  [4] calc_aero_forces!
    @ ~/repos/KiteModels.jl/src/KPS4.jl:359 [inlined]
  [5] residual!(res::StaticArraysCore.MVector{…}, yd::StaticArraysCore.MVector{…}, y::StaticArraysCore.MVector{…}, s::KPS4{…}, time::Float64)
    @ KiteModels ~/repos/KiteModels.jl/src/KPS4.jl:499
  [6] (::KiteModels.var"#test_initial_condition!#20"{Float64, KPS4{…}, StaticArraysCore.MVector{…}})(F::Vector{Float64}, x::Vector{Float64})
    @ KiteModels ~/repos/KiteModels.jl/src/KPS4.jl:654
  [7] (::NLSolversBase.var"#fj_finitediff!#21"{…})(F::Vector{…}, J::Matrix{…}, x::Vector{…})
    @ NLSolversBase ~/.julia/packages/NLSolversBase/kavn7/src/objective_types/oncedifferentiable.jl:138
  [8] value_jacobian!!(obj::NLSolversBase.OnceDifferentiable{Vector{…}, Matrix{…}, Vector{…}}, F::Vector{Float64}, J::Matrix{Float64}, x::Vector{Float64})
    @ NLSolversBase ~/.julia/packages/NLSolversBase/kavn7/src/interface.jl:124
  [9] value_jacobian!!
    @ ~/.julia/packages/NLSolversBase/kavn7/src/interface.jl:122 [inlined]
 [10] trust_region_(df::NLSolversBase.OnceDifferentiable{…}, initial_x::Vector{…}, xtol::Float64, ftol::Float64, iterations::Int64, store_trace::Bool, show_trace::Bool, extended_trace::Bool, factor::Float64, autoscale::Bool, cache::NLsolve.NewtonTrustRegionCache{…})
    @ NLsolve ~/.julia/packages/NLsolve/gJL1I/src/solvers/trust_region.jl:119
 [11] trust_region (repeats 2 times)
    @ ~/.julia/packages/NLsolve/gJL1I/src/solvers/trust_region.jl:235 [inlined]
 [12] nlsolve(df::NLSolversBase.OnceDifferentiable{…}, initial_x::Vector{…}; method::Symbol, xtol::Float64, ftol::Float64, iterations::Int64, store_trace::Bool, show_trace::Bool, extended_trace::Bool, linesearch::LineSearches.Static, linsolve::NLsolve.var"#27#29", factor::Float64, autoscale::Bool, m::Int64, beta::Int64, aa_start::Int64, droptol::Float64)
    @ NLsolve ~/.julia/packages/NLsolve/gJL1I/src/nlsolve/nlsolve.jl:26
 [13] nlsolve
    @ ~/.julia/packages/NLsolve/gJL1I/src/nlsolve/nlsolve.jl:1 [inlined]
 [14] nlsolve(f::Function, initial_x::Vector{…}; method::Symbol, autodiff::Symbol, inplace::Bool, kwargs::@Kwargs{…})
    @ NLsolve ~/.julia/packages/NLsolve/gJL1I/src/nlsolve/nlsolve.jl:52
 [15] nlsolve
    @ ~/.julia/packages/NLsolve/gJL1I/src/nlsolve/nlsolve.jl:40 [inlined]
 [16] find_steady_state!(s::KPS4{…}; prn::Bool, delta::Float64, stiffness_factor::Float64, upwind_dir::Float64)
    @ KiteModels ~/repos/KiteModels.jl/src/KPS4.jl:679
 [17] find_steady_state!
    @ ~/repos/KiteModels.jl/src/KPS4.jl:644 [inlined]
 [18] init_sim!(s::KPS4{…}; t_end::Float64, stiffness_factor::Float64, delta::Float64, upwind_dir::Float64, prn::Bool)
    @ KiteModels ~/repos/KiteModels.jl/src/KiteModels.jl:542
 [19] top-level scope
    @ REPL[11]:1
Some type information was truncated. Use `show(err)` to see complete types.

Any idea what could be the reason? Could it be due to some updated package version?

What is the meaning of ReadOnlyMemoryError in the first place?

I have no idea about the specific reason, but according to this, the ReadOnlyMemoryError() is raised when “an operation tried to write to memory that is read-only”.

You are not alone:

Downgrading to v0.1.0 of Dierckx_jll fixes this issue.

If someone wanted to fix the issue, I left some hints at ReadOnlyMemoryError · Issue #98 · JuliaMath/Dierckx.jl · GitHub. Looks pretty easy to do for someone motivated