I'm trying to use a TypedTables.Table instead of a DataFrame to make memory usage smoother in a threaded function of mine, however, I'm running into a segfault issue.
signal (11): Segmentation fault
in expression starting at REPL[16]:1
map at ./tuple.jl:0
unknown function (ip: 0x7f43b6734ae8)
_jl_invoke at /cache/build/default-amdci5-6/julialang/julia-release-1-dot-8/src/gf.c:2365 [inlined]
ijl_apply_generic at /cache/build/default-amdci5-6/julialang/julia-release-1-dot-8/src/gf.c:2547
map at ./namedtuple.jl:219
getindex at /home/tec/.julia/packages/TypedTables/dycVq/src/Table.jl:139 [inlined]
macro expansion at /home/tec/.julia/dev/DecisionTree/src/classification/tree.jl:123 [inlined]
For reference, Table.jl:139
refers to the second last line of the following function (just before end
)
@inline function Base.getindex(t::Table{T}, i::Int...) where {T}
@boundscheck checkbounds(t, i...)
convert(T, map(col -> @inbounds(getindex(col, i...)), columns(t)))::T
end
you only checked the bounds of all i
against t
, not against the columns of t
presumably you only want to use the nth i
on the nth column?
sounds like a bug in TypedTables
Do you have a code example, of how this getindex is actually called? What are table columns - regular arrays?
I've now had a bit more of a look at the codebase of TypedTables... and I don't like what I'm seeing. For my use case, I think I'll just write a quick Tables.jl compatible wrapper around a Matrix and so I'll solve this problem by no longer using TypedTables.
Timothy has marked this topic as resolved.
Last updated: Nov 06 2024 at 04:40 UTC