Skip to content

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

Closed

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
  2. added a commit that references this issue on Oct 21, 2026
  3. added this to the 27.0.0 milestone on Oct 21, 2026
  4. kou commented on Oct 21, 2026

    @kou
    Member

    Issue resolved by pull request 54883
    #54883

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