Skip to content

rbindlist segfault when a table includes an 'ordered factor' with NA in its levels #3601

@dbetebenner

Description

@dbetebenner

We've encountered an issue that didn't appear in 1.12.0 with rbindlist but does appear in 1.12.2 and later. Below is a small example that produces the problem on version 1.12.3 on Amazon Linux.

dt1 <- structure(list(V1 = c("2016", "2016", "2016", "2016", "2016"),
    V46 = structure(c(3L, 1L, 1L, NA, 3L), .Label = c("Low",
    "Typical", "High", NA), class = c("ordered", "factor"))), class = c("data.table", "data.frame"), row.names = c(NA, -5L))

dt2 <- structure(list(V1 = c("2018", "2018", "2018", "2018", "2018")), row.names = c(NA, -5L), class = c("data.table", "data.frame"))

dt3 <- rbindlist(list(dt1, dt2), fill=TRUE)

*** caught segfault ***
address (nil), cause 'unknown'

sessionInfo()
R version 3.5.2 (2018-12-20)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Amazon Linux 2

Matrix products: default
BLAS: /usr/local/lib64/R/lib/libRblas.so
LAPACK: /usr/local/lib64/R/lib/libRlapack.so

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C

[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] data.table_1.12.3

loaded via a namespace (and not attached):
[1] compiler_3.5.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions