Skip to content

an allocation failure on the dense-array group route answers a table short of a column, or writes through NULL, instead of oom #1811

Done

Description

@singaraiona

Follow-up to #1808, which listed these as found but not fixed. Reproduced on #1809's head (d2143ff).

An allocation that fails in the dense-array group route answers a wrong result or crashes, instead of oom.

Reproduction

A C test in the suite's style, DEBUG build, four workers, the v2 group engine off (it would take the shape otherwise). One allocation of the group's calling-thread code fails (the seam of #1809, ray_group_alloc_fail_for_test(n)):

(set F (table [k j v] (list (as 'F64 (% (* (til 262144) 7919) 3001)) (% (til 262144) 7) (til 262144))))
(select {s: (sum v) n: (min v) from: F by: j})

j is an I64 key over a small range, so the group takes the dense-array route of exec_group_run.

  • A column short. The route's key-column loop skips a key it cannot allocate (if (!key_col || RAY_IS_ERR(key_col)) continue;). emit_agg_columns, which this and several other routes use to build their aggregate columns, does the same with an aggregate column (if (!new_col || RAY_IS_ERR(new_col)) continue;). The answer then lacks that column. allocation 14 of 19 fails answers a table short of a column, and the failed allocation's error object is dropped.
  • A write through NULL. The route's dense_* scratch buffers are used unchecked: dense_counts[gi] = ... and the agg copies write through NULL when their allocation fails, and the process takes a SIGSEGV.

The keys-only select-by result build (#1808's second item)

I re-tested it with a seam over the keys-only result build of ray_select_body (query.c: first rows, the table, the gathered columns), on (select {from: F by: k}) and (select {from: F by: j}). At every position, the answer is oom keeping nothing (the process's allocation trace) or the reference. The 128 bytes I attributed to this build in #1808 were the radix emit's dropped error, which #1809 fixes. There is nothing to fix here; the seam stays as coverage.

Activity

  1. added 2 commits that reference this issue on Nov 27, 2026
    7bbcfb1
    80ce008
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