Stream: helpdesk (published)

Topic: Segfault from TypedTables getindex


view this post on Zulip Timothy (Dec 14 2022 at 09:28):

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

view this post on Zulip Sukera (Dec 14 2022 at 10:13):

you only checked the bounds of all i against t, not against the columns of t

view this post on Zulip Sukera (Dec 14 2022 at 10:13):

presumably you only want to use the nth i on the nth column?

view this post on Zulip Sukera (Dec 14 2022 at 10:14):

sounds like a bug in TypedTables

view this post on Zulip Alexander (Dec 14 2022 at 15:23):

Do you have a code example, of how this getindex is actually called? What are table columns - regular arrays?


Last updated: Oct 02 2023 at 04:34 UTC