Skip to content

[Ruby] Memory behind Arrow::Buffer#data is freed by GC while the Bytes still refer to it #54687

Open

Description

@himotoyoshi

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

The GLib::Bytes returned by Arrow::Buffer#data reads freed memory once the array is garbage collected, although the Bytes object is still referenced.

require "arrow"

bytes = Arrow::StringArray.new(["hello world, a long-ish string"]).data_buffer.data
GC.start
p bytes.to_s
# => "\x80\x00_AN\x02\x00\x00rld, a long-ish string"

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

Component(s)

Ruby

Activity

  1. added 3 commits that reference this issue on Oct 21, 2026
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