Skip to content

Instantly share code, notes, and snippets.

@tshort
Created April 25, 2021 22:57
Show Gist options
  • Save tshort/c56ce4d57f9ee99bb1717e784bdef08b to your computer and use it in GitHub Desktop.
Save tshort/c56ce4d57f9ee99bb1717e784bdef08b to your computer and use it in GitHub Desktop.
Julia crash with v1.6.1

Here's the code to trigger the crash:

using Pkg
Pkg.add(url="https://github.com/tshort/Sims.jl", rev="mtk")
Pkg.add("ModelingToolkit")
using Sims, Sims.Examples.Lib
m = CauerLowPassOPV()

Here is the error on Windows:

<unknown>:0: error: starting new .cfi frame before finishing the previous one
<unknown>:0: error: this directive must appear between .cfi_startproc and .cfi_endproc directives
<unknown>:0: error: starting new .cfi frame before finishing the previous one
<unknown>:0: error: this directive must appear between .cfi_startproc and .cfi_endproc directives
ERROR: ReadOnlyMemoryError()
Stacktrace:
 [1] CauerLowPassOPV()
   @ Sims.Examples.Lib C:\XXX\.julia\dev\Sims\examples\lib\electrical.jl:84
 [2] top-level scope
   @ REPL[4]:1

Here is the segfault on Linux:

julia> m = CauerLowPassOPV()

signal (11): Segmentation fault
in expression starting at REPL[9]:1
_ZN4llvm11Instruction15eraseFromParentEv at /home/tshort/julia-1.6.1/bin/../lib/julia/libLLVM-11jl.so (unknown line)
finalize at /buildworker/worker/package_linux64/build/src/llvm-alloc-opt.cpp:380 [inlined]
runOnFunction at /buildworker/worker/package_linux64/build/src/llvm-alloc-opt.cpp:1518
_ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE at /home/tshort/julia-1.6.1/bin/../lib/julia/libLLVM-11jl.so (unknown line)
_ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE at /home/tshort/julia-1.6.1/bin/../lib/julia/libLLVM-11jl.so (unknown line)
_ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE at /home/tshort/julia-1.6.1/bin/../lib/julia/libLLVM-11jl.so (unknown line)
operator() at /buildworker/worker/package_linux64/build/src/jitlayers.cpp:613
_ZN4llvm3orc14IRCompileLayer4emitENS0_29MaterializationResponsibilityENS0_16ThreadSafeModuleE at /home/tshort/julia-1.6.1/bin/../lib/julia/libLLVM-11jl.so (unknown line)
_ZN4llvm3orc31BasicIRLayerMaterializationUnit11materializeENS0_29MaterializationResponsibilityE at /home/tshort/julia-1.6.1/bin/../lib/julia/libLLVM-11jl.so (unknown line)
_ZN4llvm3orc16ExecutionSession26materializeOnCurrentThreadESt10unique_ptrINS0_19MaterializationUnitESt14default_deleteIS3_EENS0_29MaterializationResponsibilityE at /home/tshort/julia-1.6.1/bin/../lib/julia/libLLVM-11jl.so (unknown line)
_ZNSt17_Function_handlerIFvSt10unique_ptrIN4llvm3orc19MaterializationUnitESt14default_deleteIS3_EENS2_29MaterializationResponsibilityEEPS8_E9_M_invokeERKSt9_Any_dataOS6_OS7_ at /home/tshort/julia-1.6.1/bin/../lib/julia/libLLVM-11jl.so (unknown line)
_ZN4llvm3orc16ExecutionSession17runOutstandingMUsEv at /home/tshort/julia-1.6.1/bin/../lib/julia/libLLVM-11jl.so (unknown line)
_ZN4llvm3orc16ExecutionSession6lookupENS0_10LookupKindERKSt6vectorISt4pairIPNS0_8JITDylibENS0_19JITDylibLookupFlagsEESaIS8_EENS0_15SymbolLookupSetENS0_11SymbolStateENS_15unique_functionIFvNS_8ExpectedINS_8DenseMapINS0_15SymbolStringPtrENS_18JITEvaluatedSymbolENS_12DenseMapInfoISI_EENS_6detail12DenseMapPairISI_SJ_EEEEEEEEESt8functionIFvRKNSH_IS6_NS_8DenseSetISI_SL_EENSK_IS6_EENSN_IS6_SV_EEEEEE at /home/tshort/julia-1.6.1/bin/../lib/julia/libLLVM-11jl.so (unknown line)
_ZN4llvm3orc16ExecutionSession6lookupERKSt6vectorISt4pairIPNS0_8JITDylibENS0_19JITDylibLookupFlagsEESaIS7_EERKNS0_15SymbolLookupSetENS0_10LookupKindENS0_11SymbolStateESt8functionIFvRKNS_8DenseMapIS5_NS_8DenseSetINS0_15SymbolStringPtrENS_12DenseMapInfoISK_EEEENSL_IS5_EENS_6detail12DenseMapPairIS5_SN_EEEEEE at /home/tshort/julia-1.6.1/bin/../lib/julia/libLLVM-11jl.so (unknown line)
_ZN4llvm3orc16ExecutionSession6lookupERKSt6vectorISt4pairIPNS0_8JITDylibENS0_19JITDylibLookupFlagsEESaIS7_EENS0_15SymbolStringPtrENS0_11SymbolStateE at /home/tshort/julia-1.6.1/bin/../lib/julia/libLLVM-11jl.so (unknown line)
_ZN4llvm3orc16ExecutionSession6lookupENS_8ArrayRefIPNS0_8JITDylibEEENS0_15SymbolStringPtrENS0_11SymbolStateE at /home/tshort/julia-1.6.1/bin/../lib/julia/libLLVM-11jl.so (unknown line)
_ZN4llvm3orc16ExecutionSession6lookupENS_8ArrayRefIPNS0_8JITDylibEEENS_9StringRefENS0_11SymbolStateE at /home/tshort/julia-1.6.1/bin/../lib/julia/libLLVM-11jl.so (unknown line)
addModule at /buildworker/worker/package_linux64/build/src/jitlayers.cpp:788
jl_add_to_ee at /buildworker/worker/package_linux64/build/src/jitlayers.cpp:1067
jl_add_to_ee at /buildworker/worker/package_linux64/build/src/jitlayers.cpp:1111
jl_add_to_ee at /buildworker/worker/package_linux64/build/src/jitlayers.cpp:1133 [inlined]
_jl_compile_codeinst at /buildworker/worker/package_linux64/build/src/jitlayers.cpp:154
jl_generate_fptr at /buildworker/worker/package_linux64/build/src/jitlayers.cpp:352
jl_compile_method_internal at /buildworker/worker/package_linux64/build/src/gf.c:1970
jl_compile_method_internal at /buildworker/worker/package_linux64/build/src/gf.c:2236 [inlined]
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2229 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2419
CauerLowPassOPV at /home/tshort/.julia/packages/Sims/xseDP/examples/lib/electrical.jl:84
unknown function (ip: 0x7f7db0e8c1ec)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2237 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2419
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1703 [inlined]
do_call at /buildworker/worker/package_linux64/build/src/interpreter.c:115
eval_value at /buildworker/worker/package_linux64/build/src/interpreter.c:204
eval_stmt_value at /buildworker/worker/package_linux64/build/src/interpreter.c:155 [inlined]
eval_body at /buildworker/worker/package_linux64/build/src/interpreter.c:562
jl_interpret_toplevel_thunk at /buildworker/worker/package_linux64/build/src/interpreter.c:670
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:877
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:825
jl_toplevel_eval_in at /buildworker/worker/package_linux64/build/src/toplevel.c:929
eval at ./boot.jl:360 [inlined]
eval_user_input at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:139
repl_backend_loop at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:200
start_repl_backend at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:185
#run_repl#42 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:317
run_repl at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:305
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2237 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2419
#874 at ./client.jl:387
jfptr_YY.874_41532.clone_1 at /home/tshort/julia-1.6.1/lib/julia/sys.so (unknown line)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2237 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2419
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1703 [inlined]
jl_f__call_latest at /buildworker/worker/package_linux64/build/src/builtins.c:714
#invokelatest#2 at ./essentials.jl:708 [inlined]
invokelatest at ./essentials.jl:706 [inlined]
run_main_repl at ./client.jl:372
exec_options at ./client.jl:302
_start at ./client.jl:485
jfptr__start_34289.clone_1 at /home/tshort/julia-1.6.1/lib/julia/sys.so (unknown line)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2237 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2419
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1703 [inlined]
true_main at /buildworker/worker/package_linux64/build/src/jlapi.c:560
repl_entrypoint at /buildworker/worker/package_linux64/build/src/jlapi.c:702
main at /buildworker/worker/package_linux64/build/cli/loader_exe.c:51
__libc_start_main at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
_start at julia-1.6.1/bin/julia (unknown line)
Allocations: 28487662 (Pool: 28477850; Big: 9812); GC: 29
Segmentation fault
@tshort
Copy link
Author

tshort commented Apr 25, 2021

Here's what I know about it:

  • The code works fine in Julia v1.5.3.
  • The function that errors works fine when run as part of tests. It fails in the REPL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment