Skip to content

UndefVarError: ct not defined #84

@ForceBru

Description

@ForceBru

The version of Libtask that's currently shipped with Turing.jl (0.5.1, I guess) raises this error when I run sample(model, sampler, 100):

CTaskException:
Failed to show error:
UndefVarError: ct not defined
Stacktrace:
[1] showerror(io::IOBuffer, ex::Libtask.CTaskException)
@ Libtask ~/.julia/packages/Libtask/00Il9/src/ctask.jl:30
[2] try_showerror(::IOBuffer, ::Libtask.CTaskException)
@ Main.PlutoRunner ~/.julia/packages/Pluto/yDJcG/src/runner/PlutoRunner.jl:454
[3] sprint(f::Function, args::Libtask.CTaskException; context::Nothing, sizehint::Int64)
@ Base ./strings/io.jl:105
[4] sprint(f::Function, args::Libtask.CTaskException)
@ Base ./strings/io.jl:101
[5] format_output(val::CapturedException; context::Pair{Symbol, Dict{Tuple{UInt64, Int64}, Int64}})
@ Main.PlutoRunner ~/.julia/packages/Pluto/yDJcG/src/runner/PlutoRunner.jl:549
[6] formatted_result_of(cell_id::Base.UUID, ends_with_semicolon::Bool, showmore::Nothing)
@ Main.PlutoRunner ~/.julia/packages/Pluto/yDJcG/src/runner/PlutoRunner.jl:436
[7] top-level scope
@ none:1
[8] eval(m::Module, e::Any)
@ Core ./boot.jl:360
[9] (::Distributed.var"#106#108"{Distributed.CallMsg{:call_fetch}})()
@ Distributed /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Distributed/src/process_messages.jl:278
[10] run_work_thunk(thunk::Distributed.var"#106#108"{Distributed.CallMsg{:call_fetch}}, print_error::Bool)
@ Distributed /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Distributed/src/process_messages.jl:63
[11] macro expansion
@ /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Distributed/src/process_messages.jl:278 [inlined]
[12] (::Distributed.var"#105#107"{Distributed.CallMsg{:call_fetch}, Distributed.MsgHeader, Sockets.TCPSocket})()
@ Distributed ./task.jl:411

This happens because, indeed, ct is not defined in version 0.5.1:

Libtask.jl/src/ctask.jl

Lines 25 to 33 in ca8099f

function Base.showerror(io::IO, ex::CTaskException)
println(io, "CTaskException:")
bt = @static if VERSION < v"1.6.0-DEV.1145"
ct.backtrace
else
ct.storage[:_libtask_bt]
end
showerror(io, ex.task.exception, bt)
end

It was fixed in the next commit:

Libtask.jl/src/ctask.jl

Lines 30 to 35 in c66b8c9

ct = ex.task
bt = @static if VERSION < v"1.6.0-DEV.1145"
ct.backtrace
else
ct.storage[:_libtask_bt]
end

...yet this version was never published, it seems? Turing v0.15.20 uses Libtask 0.5.1:

[[Libtask]]
deps = ["Libtask_jll", "LinearAlgebra", "Statistics"]
git-tree-sha1 = "6088b80fb5017440579ea8113a516ad2807afe19"
uuid = "6f1fad26-d15e-5dc8-ae53-837a1d7b8c9f"
version = "0.5.1"

[[Libtask_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "901fc8752bbc527a6006a951716d661baa9d54e9"
uuid = "3ae2931a-708c-5973-9c38-ccf7496fb450"
version = "0.4.3+0"

  • julia version 1.6.1
  • Turing.jl version 0.15.20
  • macOS

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions