VectorOfArray with OffsetArray inner arrays returns garbage from A[i,j] (@inbounds after size-only check)
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start with src/vector_of_array.jl around lines 955–969, where getindex(A, I::Vararg{Int,N}) accesses the inner array, and inspect how its size check handles axes. Run the supplied OffsetArray reproducer, then verify the chosen behavior: translate indices using the inner array's axes or reject offset inner arrays. Confirm O[3, 1] and collect(O) no longer return garbage.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Julia
- スター
- 234
- フォーク
- 77
- 平均マージ
- 1日 5時間
- マージ済み PR(30日)
- 10
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
SciML/RecursiveArrayTools.jl のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
SciML/RecursiveArrayTools.jl#255 ·
メンテナーはふだん 2 日以内に返信
-
ArrayPartition of GPU arrays: norm, dot, Vector, any scalar-index; no KernelAbstractions.get_backendオープン
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
SciML/RecursiveArrayTools.jl#676 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 1〜2日 初心者へのやさしさ 57/100
SciML/RecursiveArrayTools.jl#674 ·
メンテナーはふだん 2 日以内に返信
-
JET: similar_type(::Any) no-matching-method in RecursiveArrayToolsRaggedArrays (pre-existing QA red)オープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
SciML/RecursiveArrayTools.jl#620 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
SciML/RecursiveArrayTools.jl#619 ·
メンテナーはふだん 2 日以内に返信
SciML/RecursiveArrayTools.jl の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
SciML/PETScDiffEq.jl#196 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 84/100
SciML/Catalyst.jl#1571 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
SciML/Optimization.jl#1414 ·
メンテナーはふだん 1 日以内に返信