[ https://issues.apache.org/jira/browse/ARROW-15669?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17493604#comment-17493604 ]
Yibo Cai commented on ARROW-15669: ---------------------------------- Thanks [~yyfyyf123123]. I tried arrow 6.0.0 and 7.0.0 (build from source), but cannot reproduce this issue. My test machine is apple m1, macos 12.1, apple clang 13. >From stracktrace, the error comes from >[ipc/reader.cc:169|https://github.com/apache/arrow/blob/apache-arrow-6.0.0/cpp/src/arrow/ipc/reader.cc#L169]. {code:cpp} Status LoadType(const DataType& type) { return VisitTypeInline(type, this); } {code} VisitTypeInline casts "type" to concrete data type based on "type.id()". Looks the actual data type class doesn't match the id. This is very strange. Upload a test patch to ease debugging. It adds "arrow-mac-test" to arrow source tree, based on the test case from [~yyfyyf123123]. [^0001-mac-flight-crash-test.patch] cc [~lidavidm] > "std::bad_cast" on mac os when reading from FlightStreamReader > -------------------------------------------------------------- > > Key: ARROW-15669 > URL: https://issues.apache.org/jira/browse/ARROW-15669 > Project: Apache Arrow > Issue Type: Bug > Components: FlightRPC > Affects Versions: 6.0.0, 7.0.0 > Reporter: Yifei Yang > Priority: Major > Attachments: 0001-mac-flight-crash-test.patch, > FlightMacExceptionTest.cpp, Main.cpp, stacktrace-mac-exception.txt > > > When calling "FlightStreamReader::ReadAll()", got "std::bad_cast exception" > (this is on 6.0.0, on 7.0.0 got "segmentation violation signal"). This > happens only on mac os, it works fine on linux (tested on ubuntu). > Code snippet: > Construction of FlightDataStream inside server's DoGet(): > {{auto schema = ::arrow::schema({}} > {{ > {field("f0", ::arrow::int32())} > ,}} > {{ > {field("f1", ::arrow::int32())} > ,}} > {{ > {field("f2", ::arrow::int32())} > ,}} > {{});}} > {{auto array_0_0 = Arrays::make<::arrow::Int32Type>(\{0, 1, 2, 3, 4, 5, 6, 7, > 8, 9}).value();}} > {{auto array_0_1 = Arrays::make<::arrow::Int32Type>(\{10, 11, 12, 13, 14, 15, > 16, 17, 18, 19}).value();}} > {{auto array_0_2 = Arrays::make<::arrow::Int32Type>(\{20, 21, 22, 23, 24, 25, > 26, 27, 28, 29}).value();}} > {{auto rb_0 = ::arrow::RecordBatch::Make(schema, 10, \{array_0_0, array_0_1, > array_0_2});}} > {{auto rb_1 = ::arrow::RecordBatch::Make(schema, 10, \{array_0_0, array_0_1, > array_0_2});}} > {{auto rb_reader = ::arrow::RecordBatchReader::Make(\{rb_0, rb_1});}} > {{return std::make_unique<::arrow::flight::RecordBatchStream>(*rb_reader);}} > > Retrieve record batches from stream at client: > {{std::unique_ptr<::arrow::flight::FlightStreamReader> reader;}} > {{st = client->DoGet(ticket, &reader); // ticked is well constructed}} > {{{}std::shared_ptr<::arrow::Table> table;{}}}{{{}st = > reader->ReadAll(&table);{}}} > > Thanks! -- This message was sent by Atlassian Jira (v8.20.1#820001)