Massive crash

This is very hard to figure out. I’ll try the debugger to find the exact line that crashes. Most of the code works, but there is new code that is run based on one input parameter, so I at least know what code file causes this to blow up.

I don’t know if the segfault error messages give anyone here an immediate clue:

signal (11): Segmentation fault: 11
in expression starting at REPL[18]:1
jl_gc_pool_alloc at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
jl_gc_alloc at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
_new_array_ at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
_new_array at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
jl_alloc_array_1d at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
Array at ./boot.jl:457 [inlined]
Array at ./boot.jl:466 [inlined]
zeros at ./array.jl:525 [inlined]
zeros at ./array.jl:521 [inlined]
Dict at ./dict.jl:90
Dict at ./dict.jl:118 [inlined]
do_history! at /Users/lewis/Dropbox/Covid Modeling/Covid-ILM/source/sim.jl:170
unknown function (ip: 0x106c8d5ef)
jl_apply_generic at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
macro expansion at ./timing.jl:299 [inlined]
#run_a_sim#153 at /Users/lewis/Dropbox/Covid Modeling/Covid-ILM/source/sim.jl:111
run_a_sim##kw at /Users/lewis/Dropbox/Covid Modeling/Covid-ILM/source/sim.jl:21
unknown function (ip: 0x106b0ec3b)
jl_apply_generic at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
do_call at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
eval_body at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
jl_interpret_toplevel_thunk at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
jl_toplevel_eval_flex at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
jl_toplevel_eval_flex at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
jl_toplevel_eval_flex at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
jl_toplevel_eval_flex at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
jl_toplevel_eval_in at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
eval at ./boot.jl:373 [inlined]
eval_user_input at /Users/administrator/src/julia/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:150
repl_backend_loop at /Users/administrator/src/julia/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:244
start_repl_backend at /Users/administrator/src/julia/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:229
#run_repl#47 at /Users/administrator/src/julia/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:362
run_repl at /Users/administrator/src/julia/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:349
jl_apply_generic at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
#930 at ./client.jl:394
jfptr_YY.930_43775 at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/sys.dylib (unknown line)
jl_apply_generic at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
jl_f__call_latest at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
#invokelatest#2 at ./essentials.jl:716 [inlined]
invokelatest at ./essentials.jl:714 [inlined]
run_main_repl at ./client.jl:379
exec_options at ./client.jl:309
_start at ./client.jl:495
jl_sysimg_fvars_base at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/sys.dylib (unknown line)
jl_apply_generic at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
true_main at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
jl_repl_entrypoint at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
Allocations: 242925520 (Pool: 242823752; Big: 101768); GC: 153

signal (11): Segmentation fault: 11
in expression starting at REPL[18]:1
jl_gc_pool_alloc at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
jl_new_uninitialized_datatype at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
inst_datatype_inner at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
jl_inst_arg_tuple_type at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
jl_apply_generic at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
run_finalizer at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
jl_gc_run_finalizers_in_list at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
jl_gc_run_all_finalizers at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
jl_atexit_hook at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
jl_exit at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
jl_exit_thread0_cb at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
Allocations: 242925520 (Pool: 242823752; Big: 101768); GC: 153

What is the expression that causes this segfault, and which version of Julia?

Julia 1.7 on Apple Silicon

I can’t tell what statement it is because I am running code from a large, complex module.

I am having trouble with Jupyter Notebooks in VS Code: it seems to lose cell results, requiring restarting over and over.

Something similar happens with Jupyter Lab run in the browser.

So, I am breaking things down to smaller sequences of code and will run in the debugger.

It is clear it is a memory leak of some kind. The code is a discrete simulation. If I run for a moderate number of days there is no problem. As I increase the days, then the problem is encountered.

It also seems that either Julia or the Julia extension for VS code leads to some kind of corruption: Julia will generate the same segfault and other messages when it starts—before any code is even run.

I am reinstalling Julia for the 3rd time.

1 Like

It could be an Apple Silicon issue. Check these issues to see if any of them match what you’re seeing:

https://github.com/JuliaLang/julia/issues?q=label%3A"apple%20silicon"

Solved.

Nothing to do with Apple Silicon or Julia 1.7.

Bad indexing in MY code.

I plunged ahead and fixed it so no problem. I will reconstruct it to test on 1.6.3. Seems like Julia should have triggered an error for my code and stopped running it, but not crashed. But, I need to look because it involved two layers of indexing. Might abend (there’s an archaic word for you–abnormal end) for 1.6.3 also.

I sort of freak out when I see a segfault and a few dozen lines of impenetrable messages.

2 Likes

This is why I would like a way to differentiate release (+@inbounds) and debug (-@inbounds) mode.

For the case of bounds checking and a few other things you can do this:

$ julia --help
...
 --check-bounds={yes|no|auto}
                           Emit bounds checks always, never, or respect @inbounds declarations
...
2 Likes