Hi,
Julia crashes with the following error when I execute abm_plot()
or abm_play()
functions from agents.jl
package.
The terminal process "julia '-i', '--banner=no', '--project=/Users/imantha/.julia/environments/v1.7', '/Users/imantha/.vscode/extensions/julialang.language-julia-1.5.6/scripts/terminalserver/terminalserver.jl', '/var/folders/_1/j0f_5zq95qd_2dpzlmfh8njm0000gn/T/vsc-jl-repl-953781b4-ea37-4157-b1d8-3f66b4098fa6', '/var/folders/_1/j0f_5zq95qd_2dpzlmfh8njm0000gn/T/vsc-jl-cr-cbe88cd0-df11-4fb8-b504-978d30ec9150', 'USE_REVISE=true', 'USE_PLOTPANE=true', 'USE_PROGRESS=true', 'DEBUG_MODE=false'" terminated with exit code: 139.
Any Ideas perhaps why?
Details
- Julia 1.7
- vscode
- macbook pro (m1 chip)
Environment Details
- Agents 4.5.7
- GLMakie 0.4.7
- InteractiveDynamics 0.18.1
Code
using Pkg
Pkg.activate("envs/abmEnv")
using Agents
using InteractiveDynamics, GLMakie
using Random
# Define Space and Agent type
# --------------------------------------------------------------------------------
space = GridSpace((10,10))
mutable struct Schelling <: AbstractAgent
id::Int
pos::Tuple{Int,Int}
group::Int
happy::Bool
end
# Initialize Agent Based model
# --------------------------------------------------------------------------------
function initialize(; N = 320, M = 20, min_to_be_happy = 3)
space = GridSpace((M,M))
model = AgentBasedModel(
Schelling,
space;
properties = Dict(:min_to_be_happy => min_to_be_happy),
scheduler = Schedulers.randomly
)
for n = 1:N
agent = Schelling(n, (1,1), (n < N/2) ? 1 : 2, false)
add_agent_single!(agent, model)
end
return model
end
# Agent stepping function
# --------------------------------------------------------------------------------
function agent_step!(agent, model)
agent.happy && return
nearby_same = 0
for neighbor in nearby_agents(agent, model)
if agent.group == neighbor.group
nearby_same += 1
end
end
if nearby_same >= model.min_to_be_happy
agent.happy = true
else
move_agent_single!(agent, model)
end
return
end
model = initialize()
fig, _ = abm_plot(model, ac = groupcolor, am = groupmarker)
display(fig)
When I type the same code in the Julia REPL I get the following error.
signal (11): Segmentation fault: 11
in expression starting at REPL[18]:1
_buffer_color_type at /Users/imantha/.julia/packages/PNGFiles/TGHP2/src/io.jl:0
#_load#6 at /Users/imantha/.julia/packages/PNGFiles/TGHP2/src/io.jl:149
_load##kw at /Users/imantha/.julia/packages/PNGFiles/TGHP2/src/io.jl:82 [inlined]
#load#2 at /Users/imantha/.julia/packages/PNGFiles/TGHP2/src/io.jl:29
load at /Users/imantha/.julia/packages/PNGFiles/TGHP2/src/io.jl:23
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]
#load#3 at /Users/imantha/.julia/packages/ImageIO/vgskl/src/ImageIO.jl:53
load at /Users/imantha/.julia/packages/ImageIO/vgskl/src/ImageIO.jl:53
unknown function (ip: 0x13fe7e78b)
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]
#action#33 at /Users/imantha/.julia/packages/FileIO/FUXWu/src/loadsave.jl:219
action at /Users/imantha/.julia/packages/FileIO/FUXWu/src/loadsave.jl:197 [inlined]
#action#32 at /Users/imantha/.julia/packages/FileIO/FUXWu/src/loadsave.jl:185
action at /Users/imantha/.julia/packages/FileIO/FUXWu/src/loadsave.jl:185 [inlined]
#load#14 at /Users/imantha/.julia/packages/FileIO/FUXWu/src/loadsave.jl:113
load at /Users/imantha/.julia/packages/FileIO/FUXWu/src/loadsave.jl:110 [inlined]
_broadcast_getindex_evalf at ./broadcast.jl:670 [inlined]
_broadcast_getindex at ./broadcast.jl:643 [inlined]
getindex at ./broadcast.jl:597 [inlined]
copy at ./broadcast.jl:899 [inlined]
materialize at ./broadcast.jl:860 [inlined]
icon at /Users/imantha/.julia/packages/Makie/gQOQF/src/Makie.jl:254
unknown function (ip: 0x13fe7b2b3)
#Screen#48 at /Users/imantha/.julia/packages/GLMakie/pFGSp/src/screen.jl:346
Screen at /Users/imantha/.julia/packages/GLMakie/pFGSp/src/screen.jl:301 [inlined]
global_gl_screen at /Users/imantha/.julia/packages/GLMakie/pFGSp/src/screen.jl:247 [inlined]
global_gl_screen at /Users/imantha/.julia/packages/GLMakie/pFGSp/src/screen.jl:394
global_gl_screen at /Users/imantha/.julia/packages/GLMakie/pFGSp/src/screen.jl:393 [inlined]
backend_display at /Users/imantha/.julia/packages/GLMakie/pFGSp/src/display.jl:2 [inlined]
#display#907 at /Users/imantha/.julia/packages/Makie/gQOQF/src/display.jl:60
display at /Users/imantha/.julia/packages/Makie/gQOQF/src/display.jl:56 [inlined]
#display#906 at /Users/imantha/.julia/packages/Makie/gQOQF/src/display.jl:52 [inlined]
display at /Users/imantha/.julia/packages/Makie/gQOQF/src/display.jl:52
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_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: 179925494 (Pool: 179887488; Big: 38006); GC: 98