JuliaLabs / Cassette.jl

Overdub Your Julia Code
Other
371 stars 35 forks source link

nightly failing to precompile with `ERROR: LoadError: invalid struct allocation` #204

Open anandijain opened 1 year ago

anandijain commented 1 year ago

i dont really know much about this package, but SciMLSensitivity failed to precompile.

ERROR: LoadError: MethodError: no method matching retrieve_code_info(::Core.MethodInstance)

Closest candidates are:
  retrieve_code_info(::Core.MethodInstance, ::UInt64)
   @ Core compiler/utilities.jl:128

Stacktrace:
 [1] reflect(sigtypes::Tuple, world::UInt64)
   @ Cassette ~/.julia/packages/Cassette/4Z3UO/src/overdub.jl:121
 [2] reflect(sigtypes::Tuple)
   @ Cassette ~/.julia/packages/Cassette/4Z3UO/src/overdub.jl:89
 [3] top-level scope
   @ ~/.julia/packages/Cassette/4Z3UO/src/overdub.jl:595
 [4] include(mod::Module, _path::String)
   @ Base ./Base.jl:488
 [5] include(x::String)
   @ Cassette ~/.julia/packages/Cassette/4Z3UO/src/Cassette.jl:1
 [6] top-level scope
   @ ~/.julia/packages/Cassette/4Z3UO/src/Cassette.jl:8
 [7] include(mod::Module, _path::String)
   @ Base ./Base.jl:488 [inlined]
 [8] 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:2091
 [9] top-level scope
   @ stdin:2
in expression starting at /Users/anand/.julia/packages/Cassette/4Z3UO/src/overdub.jl:594
in expression starting at /Users/anand/.julia/packages/Cassette/4Z3UO/src/Cassette.jl:1
in expression starting at stdin:2

if i just change the usage of that to have world, I get

(Cassette) pkg> precompile
Precompiling project...
  ✗ Cassette
  0 dependencies successfully precompiled in 2 seconds

ERROR: The following 1 direct dependency failed to precompile:

Cassette [7057c7e9-c182-5462-911a-8362d720325c]

Failed to precompile Cassette [7057c7e9-c182-5462-911a-8362d720325c] to "/Users/anand/.julia/compiled/v1.10/Cassette/jl_wuXDXf".
ERROR: LoadError: invalid struct allocation
Stacktrace:
  [1] top-level scope
    @ none:1
  [2] top-level scope
    @ ~/.julia/dev/Cassette/src/overdub.jl:642
  [3] eval(m::Module, e::Any)
    @ Core ./boot.jl:383
  [4] top-level scope
    @ ~/.julia/dev/Cassette/src/overdub.jl:641
  [5] include(mod::Module, _path::String)
    @ Base ./Base.jl:488
  [6] include(x::String)
    @ Cassette ~/.julia/dev/Cassette/src/Cassette.jl:1
  [7] top-level scope
    @ ~/.julia/dev/Cassette/src/Cassette.jl:8
  [8] include(mod::Module, _path::String)
    @ Base ./Base.jl:488 [inlined]
  [9] 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:2091
 [10] top-level scope
    @ stdin:2
in expression starting at /Users/anand/.julia/dev/Cassette/src/overdub.jl:640
in expression starting at /Users/anand/.julia/dev/Cassette/src/Cassette.jl:1
in expression starting at stdin:2
julia> versioninfo()
Julia Version 1.10.0-DEV.1268
Commit 6618d4416d2 (2023-05-11 08:40 UTC)
Platform Info:
  OS: macOS (arm64-apple-darwin22.4.0)
  CPU: 8 × Apple M1
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, apple-m1)
  Threads: 11 on 4 virtual cores
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS = 8
wsphillips commented 1 year ago

commenting to point out that this issue persists on Julia 1.10-alpha and could affect the eventual release version

frankschae commented 1 year ago

I also ran into this on:

julia> versioninfo()
Julia Version 1.10.0-beta1
Commit 6616549950e (2023-07-25 17:43 UTC)
Platform Info:
  OS: macOS (arm64-apple-darwin22.4.0)
  CPU: 10 × Apple M1 Pro
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, apple-m1)
  Threads: 1 on 8 virtual cores
isaaclelias commented 11 months ago

I ran into this also on:

julia> versioninfo()
Julia Version 1.9.0
Commit 8e630552924 (2023-05-07 11:25 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 8 × Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, skylake)
  Threads: 1 on 8 virtual cores
Environment:
  JULIA_IMAGE_THREADS = 1