Skip to content

bumping lots of columns in fread makes R crash #722

Description

@richierocks

When fread has to bump many columns to a different data type, R can crash. This dataset with 10k rows and 40 columns makes R consistently crash:

library(data.table)

# Create a character column that is mostly empty,
# so it gets bumped.
x <- character(1e4)
x[9994] <- "+"
# For very powerful machines, you might need to  
# increase the number of rows a little.
dfr <- as.data.frame(
  replicate(40, x, simplify = FALSE)
)
write.table(dfr, "test.txt", quote = FALSE)

fread("test.txt")

Activity

  1. dwaggott commented on Aug 14, 2014

    @dwaggott

    This one is really frustrating. The majority of my large datasets are sparse and crash R using fread.

  2. mattdowle commented on Oct 24, 2014

    @mattdowle
    Member

    Fixed in v1.9.4 on CRAN. Have added this one into the same item - thanks.

    Fixed seg fault in sparse data files when bumping to character, #796 and #722. Thanks to Adam Kennedy and Richard Cotton for the detailed reproducible reports.

  3. added this to the v1.9.4 milestone on Oct 24, 2014
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