Skip to content

An allocation failure while building a group node crashes the parted group or answers nyi, not oom #1817

In review

Description

@singaraiona

What happens

An allocation that fails while a group node is being built gives a crash or the wrong error class.

  • SIGSEGV in ray_group_build (graph.c:1128). Take a parted table of 3 partitions and (select {s: (sum v) c: (count v) from: P by: j}). The per-partition route (exec_group_per_partition) builds each partition's scans and hands them to ray_group unchecked. When a scan fails to allocate, ray_group_build reads keys[i]->id through NULL. Found in the review of fix(group): an allocation failure on the dense-array group route answers oom, not a table short of a column or a write through NULL #1812.
  • nyi instead of oom. In-memory tables answer nyi (not implemented) at one failure position in the planner, for every group shape tried: by: k, by: [k j], median, pearson_corr, keyless sum/avg, wavg, sum (* v w).
    • The planner gets a NULL root back from ray_group_build and runs it.
    • ray_execute answers nyi for any NULL root.
    • The node allocators record the failure in g->compile_err, but ray_execute never reads it.
    • The builders' own scratch carves (ray_group_build's id buffer and the sort, join, pivot and window builders) return NULL without recording anything.

Reproduction (DEBUG seams)

  • ray_group_alloc_fail_for_test(n), swept over every n on the parted query above: SIGSEGV at the first scan failure.
  • The per-thread heap seam ray_alloc_fail_set_for_test(n, 1) over the whole evaluation: on (select {from: F by: k}), allocation 27 (ray_group_build's id buffer) answers nyi.

Expected

The unfailed answer, or oom, nothing kept and no crash.

Activity

  1. added 2 commits that reference this issue on Nov 27, 2026
    4e05e20
    ffcb87c
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions