Skip to content

Crash in fread in dev when under-estimating the number of rows #2246

@st-pasha

Description

@st-pasha
require(data.table)
DT1 = data.table(A=rep(123, 100), B=456)
DT2 = data.table(A=rep(1, 200), B=2)
DT = rbind(DT1, DT2, DT1, DT2, DT1, DT2, DT1, DT2, DT1, DT2, DT1, DT2, DT1, DT2, DT1, DT2, DT1, DT2, DT1, DT1)
fwrite(DT, f<-tempfile())
ff = fread(f)

Normally this produces

Error in fread(f) : 
  Internal error: DTi(2900) > allocnrow(2208) but nrows=9223372036854775807 (not limited)

but occasionally also

R(22039,0x7fff7504e000) malloc: *** error for object 0x7f957ec29608: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions