Skip to content

VectorOfArray with OffsetArray inner arrays returns garbage from A[i,j] (@inbounds after size-only check) #675

In review

Description

@ChrisRackauckas-Claude

A VectorOfArray whose inner arrays are OffsetArrays returns garbage values from A[i,j]. Only the size is checked; the axes are not.

using RecursiveArrayTools, OffsetArrays
O = VectorOfArray([OffsetArray([1.0, 2.0, 3.0], 0:2), OffsetArray([4.0, 5.0, 6.0], 0:2)])
O[3, 1]       # 7.2e-322 (out-of-bounds read; the last element of column 1 is 3.0)
collect(O)    # contains garbage

With --check-bounds=yes the same call throws BoundsError, which points at the @inbounds access in getindex(A, I::Vararg{Int,N}) (src/vector_of_array.jl ~955-969). The access goes into the inner array with 1-based indices after only a size check. It should either check axes and translate the index (firstindex), or reject offset inner arrays. Related: #28.

Found in a measurement audit of RecursiveArrayTools.jl master 02c477c (v4.5.3). It reproduces on Julia 1.12.4 and 1.10.12, and the reproducer above was re-run as written before filing.

🤖 Filed by Claude Code (model: claude-opus-5-5[1m]) on behalf of @ChrisRackauckas. The audit was done by a Claude Code Opus 5.5 subagent. Session: https://claude.ai/code/session_01LPHREnnonfLg1VcE1EJovv

Activity

  1. ChrisRackauckas-Claude commented on Nov 27, 2026

    @ChrisRackauckas-Claude
    MemberAuthor

    🤖 Automated comment from an AI agent running as @ChrisRackauckas — not written or reviewed by Chris.

    Taking this — Codex CLI 0.170.0, model gpt-6.1-terra (job 675-codex).


    🤖 Posted by an AI agent — harness: Codex CLI 0.170.0 · model: gpt-6.1-terra
    Conversation: local session 01a21b42-61bb-7543-b515-20b0fa4883f0 (no session URL)

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