apache / apache/arrow

[C++] Arrow Substrait test fails with SIGSEGV, possibly due to gtest 1.11.0

Open
#32,103 4 comments 0 reactions 0 assignees View on GitHub
Component: C++ Type: bug
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 13h
Merged PRs (30d)
88

Description

I built Arrow using the instructions in the Python development page, under the pyarrow-dev environment, and found that `arrow-substrait-substrait-test` fails with SIGSEGV - see gdb session below. The same Arrow builds and runs correctly on my system, outside of pyarrow-dev. I suspect this is due to something different about gtest 1.11.0 as compared to gtest 1.10.0 based on the following observations:
1. The backtrace in the gdb session shows gtest 1.11.0 is used.
1. The backtrace also shows the error is deep inside gtest, working on an `UnorderedElementsAre` expectation.
1. My system, outside pyarrow-dev, uses gtest 1.10.0.

 
{noformat}
$ gdb --args ./release/arrow-substrait-substrait-test
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
    .
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./release/arrow-substrait-substrait-test...
(gdb) run
Starting program: /mnt/user1/tscontract/github/rtpsw/arrow/cpp/build/debug/release/arrow-substrait-substrait-test 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff41ff700 (LWP 115128)]
Running main() from /home/conda/feedstock_root/build_artifacts/gtest_1647154636757/work/googletest/src/gtest_main.cc
[==========] Running 33 tests from 3 test suites.
[----------] Global test environment set-up.
[----------] 4 tests from ExtensionIdRegistryTest
[ RUN      ] ExtensionIdRegistryTest.RegisterTempTypes
[       OK ] ExtensionIdRegistryTest.RegisterTempTypes (0 ms)
[ RUN      ] ExtensionIdRegistryTest.RegisterTempFunctions
[       OK ] ExtensionIdRegistryTest.RegisterTempFunctions (0 ms)
[ RUN      ] ExtensionIdRegistryTest.RegisterNestedTypes
[       OK ] ExtensionIdRegistryTest.RegisterNestedTypes (0 ms)
[ RUN      ] ExtensionIdRegistryTest.RegisterNestedFunctions
[       OK ] ExtensionIdRegistryTest.RegisterNestedFunctions (0 ms)
[----------] 4 tests from ExtensionIdRegistryTest (0 ms total)
[----------] 21 tests from Substrait
[ RUN      ] Substrait.SupportedTypes
[       OK ] Substrait.SupportedTypes (0 ms)
[ RUN      ] Substrait.SupportedExtensionTypes
[       OK ] Substrait.SupportedExtensionTypes (0 ms)
[ RUN      ] Substrait.NamedStruct
[       OK ] Substrait.NamedStruct (0 ms)
[ RUN      ] Substrait.NoEquivalentArrowType
[       OK ] Substrait.NoEquivalentArrowType (0 ms)
[ RUN      ] Substrait.NoEquivalentSubstraitType
[       OK ] Substrait.NoEquivalentSubstraitType (0 ms)
[ RUN      ] Substrait.SupportedLiterals
[       OK ] Substrait.SupportedLiterals (1 ms)
[ RUN      ] Substrait.CannotDeserializeLiteral
[       OK ] Substrait.CannotDeserializeLiteral (0 ms)
[ RUN      ] Substrait.FieldRefRoundTrip
[       OK ] Substrait.FieldRefRoundTrip (1 ms)
[ RUN      ] Substrait.RecursiveFieldRef
[       OK ] Substrait.RecursiveFieldRef (0 ms)
[ RUN      ] Substrait.FieldRefsInExpressions
[       OK ] Substrait.FieldRefsInExpressions (0 ms)
[ RUN      ] Substrait.CallSpecialCaseRoundTrip
[       OK ] Substrait.CallSpecialCaseRoundTrip (0 ms)
[ RUN      ] Substrait.CallExtensionFunction
[       OK ] Substrait.CallExtensionFunction (0 ms)
[ RUN      ] Substrait.ReadRel
Thread 1 "arrow-substrait" received signal SIGSEGV, Segmentation fault.
0x00005555555b02e6 in testing::internal::MatcherBase, std::allocator > const&>::MatchAndExplain (listener=0x7fffffffb3a0, x=..., 
    this=) at /mnt/soft1/tscontract/pkg/miniconda3/envs/pyarrow-dev/x86_64-conda-linux-gnu/include/c++/10.3.0/bits/shared_ptr_base.h:1324
1324          get() const noexcept
(gdb) bt
#0  0x00005555555b02e6 in testing::internal::MatcherBase, std::allocator > const&>::MatchAndExplain (listener=0x7fffffffb3a0, x=..., 
    this=) at /mnt/soft1/tscontract/pkg/miniconda3/envs/pyarrow-dev/x86_64-conda-linux-gnu/include/c++/10.3.0/bits/shared_ptr_base.h:1324
#1  testing::internal::UnorderedElementsAreMatcherImpl, std::allocator >, std::allocator, std::allocator > > > const&>::AnalyzeElements<__gnu_cxx::__normal_iterator, std::allocator > const\*, std::vector, std::allocator >, std::allocator, std::allocator > > > > > (listener=0x7fffffffb640, 
    element_printouts=0x7fffffffb3b0, elem_last=..., elem_first=..., this=0x555555765610) at /mnt/soft1/tscontract/pkg/miniconda3/envs/pyarrow-dev/include/gmock/gmock-matchers.h:3504
#2  testing::internal::UnorderedElementsAreMatcherImpl, std::allocator >, std::allocator, std::allocator > > > const&>::MatchAndExplain (this=0x555555765610, container=..., listener=0x7fffffffb640)
    at /mnt/soft1/tscontract/pkg/miniconda3/envs/pyarrow-dev/include/gmock/gmock-matchers.h:3464
#3  0x00005555555af714 in testing::internal::MatcherBase, std::allocator >, std::allocator, std::allocator > > > const&>::MatchAndExplain (listener=0x7fffffffb640, x=..., this=0x7fffffffb620)
    at /mnt/soft1/tscontract/pkg/miniconda3/envs/pyarrow-dev/x86_64-conda-linux-gnu/include/c++/10.3.0/bits/shared_ptr_base.h:1324
#4  testing::internal::MatcherBase, std::allocator >, std::allocator, std::allocator > > > const&>::Matches (x=..., this=0x7fffffffb620) at /mnt/soft1/tscontract/pkg/miniconda3/envs/pyarrow-dev/include/gtest/gtest-matchers.h:270
#5  testing::internal::PredicateFormatterFromMatcher > >::operator(), std::allocator >, std::allocator, std::allocator > > > > (this=this@entry=0x7fffffffbae0, 
    value_text=value_text@entry=0x5555555b79f1 "dataset.files()", x=...) at /mnt/soft1/tscontract/pkg/miniconda3/envs/pyarrow-dev/include/gmock/gmock-matchers.h:1544
#6  0x0000555555598a2b in arrow::engine::Substrait_ReadRel_Test::TestBody (this=) at /mnt/soft1/tscontract/pkg/miniconda3/envs/pyarrow-dev/include/gmock/gmock-matchers.h:3533
#7  0x00007ffff7c20d3e in void testing::internal::HandleExceptionsInMethodIfSupported(testing::Test\*, void (testing::Test::**)(), char const**) ()
   from /mnt/soft1/tscontract/pkg/miniconda3/envs/pyarrow-dev/lib/libgtest.so.1.11.0
#8  0x00007ffff7c21011 in testing::Test::Run() () from /mnt/soft1/tscontract/pkg/miniconda3/envs/pyarrow-dev/lib/libgtest.so.1.11.0
#9  0x00007ffff7c213a7 in testing::TestInfo::Run() () from /mnt/soft1/tscontract/pkg/miniconda3/envs/pyarrow-dev/lib/libgtest.so.1.11.0
#10 0x00007ffff7c21abc in testing::TestSuite::Run() () from /mnt/soft1/tscontract/pkg/miniconda3/envs/pyarrow-dev/lib/libgtest.so.1.11.0
#11 0x00007ffff7c2228e in testing::internal::UnitTestImpl::RunAllTests() () from /mnt/soft1/tscontract/pkg/miniconda3/envs/pyarrow-dev/lib/libgtest.so.1.11.0
#12 0x00007ffff7c216ae in testing::UnitTest::Run() () from /mnt/soft1/tscontract/pkg/miniconda3/envs/pyarrow-dev/lib/libgtest.so.1.11.0
#13 0x00007ffff7c3f06f in main () from /mnt/soft1/tscontract/pkg/miniconda3/envs/pyarrow-dev/lib/libgtest_main.so.1.11.0
#14 0x00007ffff5b840b3 in __libc_start_main (main=0x7ffff7c3f030 , argc=1, argv=0x7fffffffc0d8, init=, fini=, rtld_fini=, stack_end=0x7fffffffc0c8)
    at ../csu/libc-start.c:308
#15 0x00005555555780f1 in _start () at /mnt/user1/tscontract/github/rtpsw/arrow/cpp/sr
{noformat}
 

**Reporter**: [Yaron Gvili](https://issues.apache.org/jira/browse/ARROW-16770) / @rtpsw

**Note**: *This issue was originally created as [ARROW-16770](https://issues.apache.org/jira/browse/ARROW-16770). Please see the [migration documentation](https://github.com/apache/arrow/issues/14542) for further details.*

Contributor guide

Open the contributing guide

Research direction

Start by running arrow-substrait-substrait-test in the pyarrow-dev environment and focus on the Substrait.ReadRel test, where the report shows a SIGSEGV in gtest's UnorderedElementsAre matcher. Compare the gtest 1.11.0 environment with the working gtest 1.10.0 setup; done means the test completes without a segmentation fault.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.