Skip to content

Potential segfault in forder #6797

@dkutner

Description

@dkutner

I've been hitting an issue running dt[, .(a = mean(a)), keyby = .(b, c, d)] leading to an error INTEGER() can only be applied to a 'integer', not a 'NULL'. Unfortunately it's difficult to reproduce without sharing proprietary data and the error only happens intermittently, but I think I've traced it back to this line https://github.com/Rdatatable/data.table/blob/1.16.4/src/forder.c#L545. If I try to run Rf_PrintValue(ascArg); immediately before this line, I eventually hit a segfault. My knowledge of R internals is limited, but it may be related to unprotecting the value in line 469.

It's worth noting that I've only hit this issue when running my code in a foreach loop with doParallel, but this may be leading to increased garbage collection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions