Hello! I am trying out a function I have written to implement the power method. I am filling a CSRMatrix (a type created in the project I am working on) and then running my function with that matrix. I have no problems when I just fill the matrix OR when I just run the function on an unfilled matrix. However, if I try to fill the matrix and use my function, the Julia REPL crashes and the error in the attached screenshot appears.
From some googling, it seems like the issue has to do with a file being read/written to, but I do not know how to start with fixing it. Does anyone have any ideas?
Thank you for the response. I tried the tmux approach, but the Julia REPL still crashed (the bash terminal stayed open, but no error messages appeared there) so I could not see the error message. Does that mean I didn’t use tmux properly?
Try the second approach and post the output here. It’s definitely possible, but rare, for Julia to die without any output. In that case, I’d recommend trying to repro the issue in a normal REPL (without the VS Code integration loaded) and run Julia through gdb or RR.
Does it only happen in VSCode and not when you run the same code in an (external) REPL? You could try running julia with --check-bounds=yes to check for out of bounds indexing.
When I run it in an external REPL, the seg fault still happens, but this time I can see the error message:
signal (11): Segmentation fault: 11
in expression starting at /Users/fionasmith/SandiaJuliaWork/tryPower.jl:104
* at ./float.jl:404 [inlined]
localApply at /Users/fionasmith/.julia/packages/JuliaPetra/JBvpV/src/CSRMatrix.jl:1039
power1 at /Users/fionasmith/SandiaJuliaWork/tryPower.jl:69
unknown function (ip: 0x102379094)
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]
include_string at ./loading.jl:1196
jl_apply_generic at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
_include at ./loading.jl:1253
include at ./client.jl:451
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/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:150
repl_backend_loop at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:246
start_repl_backend at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:231
#run_repl#47 at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:364
run_repl at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:351
jl_apply_generic at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
#936 at ./client.jl:394
jfptr_YY.936_47061.clone_1 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
jfptr__start_33485.clone_1 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: 10776274 (Pool: 10771648; Big: 4626); GC: 13
[Process completed]
So is the error originating with the localApply function that I am using in tryPower.jl?
./tryPower.jl: line 1: using: command not found
./tryPower.jl: line 5: syntax error near unexpected token `A::Matrix{},'
./tryPower.jl: line 5: `function power(A::Matrix{}, niter::Integer, tol::Float64)'
Ok, you don’t have julia on your path. Use the full path from that error message in your screenshot (/Applications/...) instead of julia in that code snippet.