Skip to content

[Ruby] Exported Arrow::TableBatchReader crashes after GC when its table is not referenced #54689

Closed

Description

@himotoyoshi

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

A stream exported from an Arrow::TableBatchReader crashes when it is imported, if the table it was created from has been garbage collected.

require "arrow"

address = Arrow::TableBatchReader.new(Arrow::Table.new("a" => Arrow::Int32Array.new([1, 2, 3]))).export
GC.start
p Arrow::RecordBatchReader.import(address).read_all
# => [BUG] Segmentation fault at 0x0000000000000018

The crash is in arrow::ExportSchema, called from ExportStreamSchema:

libarrow.2500.1.0.dylib(_ZN5arrow12ExportSchemaERKNS_6SchemaEP11ArrowSchema+0x90)
libarrow.2500.1.0.dylib(_ZN5arrow12_GLOBAL__N_118ExportStreamSchemaERKNSt3__110shared_ptrINS_17RecordBatchReaderEEEP11ArrowSchema)

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 a commit that references this issue on Nov 6, 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 55387
    #55387

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