Skip to content

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

Open

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

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions