Skip to content

[Ruby] Memory passed to Arrow::Buffer.new is freed by GC while an array still refers to it #54688

Closed

Description

@himotoyoshi

Describe the bug, including details regarding any error messages, version, and platform.

An array built on an Arrow::Buffer created from a String reads freed memory once the Buffer object is garbage collected, although the array is still referenced.

require "arrow"

chunked = Arrow::ChunkedArray.new([Arrow::Int32Array.new(3, Arrow::Buffer.new([1, 2, 3].pack("l*")), nil, 0)])
GC.start
Array.new(10000) { [7, 7, 7].pack("l*") }
p chunked.to_a
# => [10860, 0, 0]

Environment: red-arrow 25.0.1, apache-arrow-glib 25.0.1 (Homebrew), Ruby 3.4.1, macOS 15.4.1 (arm64)

Possibly related to #54687

Component(s)

Ruby

Activity

  1. added 2 commits that reference this issue on Nov 4, 2026
  2. added this to the 27.0.0 milestone on Nov 6, 2026
  3. kou commented on Nov 6, 2026

    @kou
    Member

    Issue resolved by pull request 55376
    #55376

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions