Skip to content

access to undefined reference #190

@mhauru

Description

@mhauru
julia> module MWE

       using Libtask

       obs = Any[:a,:b]

       produce_wrapper(x) = Libtask.produce(x)
       Libtask.might_produce(::Type{<:Tuple{typeof(produce_wrapper),Any}}) = true

       function f(obs)
           for o in obs
               produce_wrapper(o)
           end
           return nothing
       end

       tt = Libtask.TapedTask(nothing, f, obs)
       for i in 1:length(obs)
           println(Libtask.consume(tt))
       end

       end
a
ERROR: UndefRefError: access to undefined reference
Stacktrace:
  [1] getproperty
    @ ./Base.jl:49 [inlined]
  [2] getindex
    @ ./refvalue.jl:59 [inlined]
  [3] get_ref_at
    @ ~/.julia/packages/Libtask/7zdQp/src/copyable_task.jl:1074 [inlined]
  [4] produce_wrapper
    @ ./REPL[2]:7 [inlined]
  [5] (::Tuple{Base.RefValue{Symbol}, Base.RefValue{Int32}})(none::typeof(Main.MWE.produce_wrapper), none::Symbol)
    @ Base.Experimental ./<missing>:0
  [6] (::MistyClosures.MistyClosure{Core.OpaqueClosure{Tuple{typeof(Main.MWE.produce_wrapper), Symbol}, Union{Symbol, Libtask.ProducedValue{Symbol}}}})(::Function, ::Symbol)
    @ MistyClosures ~/.julia/packages/MistyClosures/4rFSA/src/MistyClosures.jl:22
  [7] (::Libtask.DynamicCallable{Dict{Any, Any}})(::Function, ::Symbol)
    @ Libtask ~/.julia/packages/Libtask/7zdQp/src/copyable_task.jl:1153
  [8] f
    @ ./REPL[2]:11 [inlined]
  [9] (::Tuple{…})(none::typeof(Main.MWE.f), none::Vector{…})
    @ Base.Experimental ./<missing>:0
 [10] consume(t::Libtask.TapedTask{Nothing, Tuple{typeof(Main.MWE.f), Vector{Any}}, MistyClosures.MistyClosure{Core.OpaqueClosure{Tuple{typeof(Main.MWE.f), Vector{Any}}, Union{Nothing, Libtask.ProducedValue}}}})
    @ Libtask ~/.julia/packages/Libtask/7zdQp/src/copyable_task.jl:347
 [11] top-level scope
    @ ./REPL[2]:19
Some type information was truncated. Use `show(err)` to see complete types.

That obs = Any[:a,:b] has eltype Any seems to be significant, as is the fact that at least some of the values are symbols or strings. This works as expected for e.g. obs = [:a,:b,:c,:d] and obs = Any[1,2,true,0.3].

Any hints as to what this could possibly be about are very welcome. I'll have a look, but I don't have an idea for where to start currently.

Metadata

Metadata

Assignees

No one assigned

    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