TuringLang/docs

Segmentation Fault on Bayesian Hidden Markov Model Tutorial

trentfridey opened this issue · 1 comments

I am getting stuck running the HMM tutorial.
The problem is with running the sampler; everything up to then runs perfectly.

When I run the sampler code via the Julia REPL:

chn = sample(BayesHmm(y, 3), g, 1000);

I get a segmentation fault. This is running Julia 1.7.1 on Linux. My package environment is:

  • Julia 1.7.1
  • Turing v0.15.1
  • StatsPlots v0.14.30

Is there something I should do to make the sampler run?

signal (11): Segmentation fault
in expression starting at REPL[9]:1
getproperty at ./task.jl:170 [inlined]
n_copies at /home/trent/.julia/packages/Libtask/OtgFl/src/ctask.jl:35
n_copies at /home/trent/.julia/packages/Libtask/OtgFl/src/ctask.jl:33 [inlined]
tzeros at /home/trent/.julia/packages/Libtask/OtgFl/src/tarray.jl:165
unknown function (ip: 0x7f1cd4170c51)
tzeros at /home/trent/.julia/packages/Libtask/OtgFl/src/tarray.jl:171 [inlined]
#1 at ./REPL[7]:7 [inlined]
#1 at ./none:0
macro expansion at /home/trent/.julia/packages/DynamicPPL/SgzCy/src/model.jl:0 [inlined]
_evaluate at /home/trent/.julia/packages/DynamicPPL/SgzCy/src/model.jl:154 [inlined]
evaluate_threadunsafe at /home/trent/.julia/packages/DynamicPPL/SgzCy/src/model.jl:127 [inlined]
Model at /home/trent/.julia/packages/DynamicPPL/SgzCy/src/model.jl:92 [inlined]
VarInfo at /home/trent/.julia/packages/DynamicPPL/SgzCy/src/varinfo.jl:126 [inlined]
VarInfo at /home/trent/.julia/packages/DynamicPPL/SgzCy/src/varinfo.jl:125 [inlined]
#step#18 at /home/trent/.julia/packages/DynamicPPL/SgzCy/src/sampler.jl:73
step at /home/trent/.julia/packages/DynamicPPL/SgzCy/src/sampler.jl:66 [inlined]
macro expansion at /home/trent/.julia/packages/AbstractMCMC/oou1a/src/sample.jl:97 [inlined]
macro expansion at /home/trent/.julia/packages/AbstractMCMC/oou1a/src/logging.jl:15 [inlined]
#mcmcsample#19 at /home/trent/.julia/packages/AbstractMCMC/oou1a/src/sample.jl:88
unknown function (ip: 0x7f1cd41707c5)
mcmcsample##kw at /home/trent/.julia/packages/AbstractMCMC/oou1a/src/sample.jl:85
unknown function (ip: 0x7f1cd414df65)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
#sample#3 at /home/trent/.julia/packages/Turing/uAz5c/src/inference/Inference.jl:156
unknown function (ip: 0x7f1cd414dc3d)
sample at /home/trent/.julia/packages/Turing/uAz5c/src/inference/Inference.jl:155 [inlined]
#sample#2 at /home/trent/.julia/packages/Turing/uAz5c/src/inference/Inference.jl:142 [inlined]
sample at /home/trent/.julia/packages/Turing/uAz5c/src/inference/Inference.jl:142 [inlined]
#sample#1 at /home/trent/.julia/packages/Turing/uAz5c/src/inference/Inference.jl:132 [inlined]
sample at /home/trent/.julia/packages/Turing/uAz5c/src/inference/Inference.jl:132
unknown function (ip: 0x7f1cd414d9d2)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1788 [inlined]
do_call at /buildworker/worker/package_linux64/build/src/interpreter.c:126
eval_value at /buildworker/worker/package_linux64/build/src/interpreter.c:215
eval_stmt_value at /buildworker/worker/package_linux64/build/src/interpreter.c:166 [inlined]
eval_body at /buildworker/worker/package_linux64/build/src/interpreter.c:587
jl_interpret_toplevel_thunk at /buildworker/worker/package_linux64/build/src/interpreter.c:731
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:885
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:830
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:830
jl_toplevel_eval_in at /buildworker/worker/package_linux64/build/src/toplevel.c:944
eval at ./boot.jl:373 [inlined]
eval_user_input at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:150
repl_backend_loop at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:244
start_repl_backend at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:229
#run_repl#47 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:362
run_repl at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:349
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
#930 at ./client.jl:394
jfptr_YY.930_40362.clone_1 at /usr/lib/julia-1.7.1/lib/julia/sys.so (unknown line)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1788 [inlined]
jl_f__call_latest at /buildworker/worker/package_linux64/build/src/builtins.c:757
#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_40531.clone_1 at /usr/lib/julia-1.7.1/lib/julia/sys.so (unknown line)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1788 [inlined]
true_main at /buildworker/worker/package_linux64/build/src/jlapi.c:559
jl_repl_entrypoint at /buildworker/worker/package_linux64/build/src/jlapi.c:701
main at julia (unknown line)
__libc_start_main at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x400808)
Allocations: 144520746 (Pool: 144483959; Big: 36787); GC: 113
Segmentation fault (core dumped)

See TuringLang/Turing.jl#1738. Should be fixed very soon.