Segmentation fault on Mac


I wrote some Julia code and it is working on Windows 11 but not on OSX. When I run the code in terminal on Mac, I get segmentation fault (see below).

How can I solve the issue? Thank you for any advice.

signal (11): Segmentation fault: 11
in expression starting at /Users/ekozlowska/Documents/work/STING_project/model_Julia/test.jl:107
ntuple at ./ntuple.jl:0
unknown function (ip: 0x102b5b837)
jl_apply_generic at /Applications/ (unknown line)
_typed_hvncat at ./abstractarray.jl:2196
jl_apply_generic at /Applications/ (unknown line)
do_apply at /Applications/ (unknown line)
_typed_hvncat at ./abstractarray.jl:2156
_hvncat at ./abstractarray.jl:2137 [inlined]
hvncat at ./abstractarray.jl:2130 [inlined]
neighbors at /Users/ekozlowska/Documents/work/STING_project/model_Julia/ABM.jl:127
getFreeNgh at /Users/ekozlowska/Documents/work/STING_project/model_Julia/ABM.jl:138
jl_apply_generic at /Applications/ (unknown line)
migration at /Users/ekozlowska/Documents/work/STING_project/model_Julia/ABM.jl:249
sim_iteration at /Users/ekozlowska/Documents/work/STING_project/model_Julia/ABM.jl:354
run_model at /Users/ekozlowska/Documents/work/STING_project/model_Julia/test.jl:37
macro expansion at ./timing.jl:220 [inlined]
main at /Users/ekozlowska/Documents/work/STING_project/model_Julia/test.jl:101
unknown function (ip: 0x1028bc3e3)
jl_apply_generic at /Applications/ (unknown line)
do_call at /Applications/ (unknown line)
eval_body at /Applications/ (unknown line)
jl_interpret_toplevel_thunk at /Applications/ (unknown line)
jl_toplevel_eval_flex at /Applications/ (unknown line)
jl_toplevel_eval_flex at /Applications/ (unknown line)
jl_toplevel_eval_in at /Applications/ (unknown line)
eval at ./boot.jl:373 [inlined]
include_string at ./loading.jl:1196
jl_apply_generic at /Applications/ (unknown line)
_include at ./loading.jl:1253
include at ./Base.jl:418
jl_apply_generic at /Applications/ (unknown line)
exec_options at ./client.jl:292
_start at ./client.jl:495
jl_sysimg_fvars_base at /Applications/ (unknown line)
jl_apply_generic at /Applications/ (unknown line)
true_main at /Applications/ (unknown line)
jl_repl_entrypoint at /Applications/ (unknown line)
Allocations: 195215072 (Pool: 195173509; Big: 41563); GC: 89
ekozlowska@MacBook-Pro-Emilia model_Julia % 

You didn’t specify it, but my educated guess is that that’s an M1 macbook, isn’t it? If so, the v1.7 series of Julia for the aarch64-apple-darwin platform is affected by a few issues. Unfortunately there isn’t much that can’t be done for v1.7, but these issues have been fixed for v1.8 and so the next new minor version of Julia will work much better on this machine.

Until v1.8 is officially released, you can build julia from source locally: after you clone the repository it’s only a matter of running make -j8 and it’ll be done in less than 5 minutes. You’ll need to have installed xcode



1 Like