Skip to content

rbindlist segfault #2019

Closed
Closed

Description

@arunsrinivasan

Commit 2706 segfaults rbindlist when used with idcol argument.

require(data.table)
dt <- setDT(lapply(1:11, function(x) sample(letters, 1e4L, TRUE)))

ll <- lapply(1:3000, function(x) {
  if (runif(1) > 0.5) data.table() else dt[sample(1000L)]
})

# works fine
for (i in 1:50) {
  ans1 <- rbindlist(ll)
}

# segfaults
for (i in 1:50) {
  ans2 <- rbindlist(ll, idcol="id")
}

The current CRAN version segfaults. Narrowed it down to commit 2706.

Activity

  1. mllg commented on Apr 14, 2017

    @mllg
    Contributor

    Here is an example which is easier to reproduce:

    require(data.table)
    x <- list(list(a = 1), list(), list(a = 2))
    rbindlist(x, idcol = "id")

    This is fixed with #2077, but I'm not sure where to put the test.

  2. added this to the milestone on May 11, 2017
  3. added a commit that references this issue on May 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions