Skip to content

Edge case bug in GForce #1994

@arunsrinivasan

Description

@arunsrinivasan
require(data.table)
dt <- data.table(a=1, b=2)[0] # empty table
dt[rep(NA_integer_, 10), mean(a), by=list(vv=1:10)] # subset with NA_integer_

This results in segfault.. and would result in the same with median, min, max etc. Since they all depend on the input table, as opposed to gN() (equivalent of .N), for example.

Not sure, but I think this happens because irows is non-empty (all NAs), but x (input table) is. And I think this difference is not taken care of in this line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GForceissues relating to optimized grouping calculations (GForce)bugsegfault

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions