Skip to content

Tests segfault with C++17 #12104

@antonio-rojas

Description

@antonio-rojas

What version of protobuf and what language are you using?
Version: 22.0 / git master
Language: C++

What operating system (Linux, Windows, ...) and version?
Linux x86_64

What runtime / compiler are you using (e.g., python version or gcc version)
GCC 12.2.1

What did you do?
cmake -B build -S protobuf
-DCMAKE_INSTALL_PREFIX=/usr
-Dprotobuf_USE_EXTERNAL_GTEST=ON
-Dprotobuf_BUILD_SHARED_LIBS=ON
-Dprotobuf_ABSL_PROVIDER=package
cmake --build build
cmake --build build --target test

What did you expect to see
Tests pass

What did you see instead?
Tests segfault

#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007f65d1ea0953 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
#2  0x00007f65d1e51ea8 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007f65d1e3b53d in __GI_abort () at abort.c:79
#4  0x00007f65d2bb74d2 in absl::lts_20230125::log_internal::LogMessage::FailWithoutStackTrace ()
    at /usr/src/debug/abseil-cpp/abseil-cpp-20230125.1/absl/log/internal/log_message.cc:333
#5  0x00007f65d2bb7835 in absl::lts_20230125::log_internal::LogMessage::Die (this=0x7ffebae42210)
    at /usr/src/debug/abseil-cpp/abseil-cpp-20230125.1/absl/log/internal/log_message.cc:491
#6  0x00007f65d2bb7dc9 in absl::lts_20230125::log_internal::LogMessageFatal::~LogMessageFatal (this=<optimized out>, __in_chrg=<optimized out>)
    at /usr/src/debug/abseil-cpp/abseil-cpp-20230125.1/absl/log/internal/log_message.cc:582
#7  0x00007f65d283fc0b in google::protobuf::compiler::objectivec::TextFormatDecodeData::DecodeDataForString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) [clone .cold] ()
   from /home/antonio/Software/Arch/packages/protobuf/trunk/src/build/libprotoc.so.4.22.0.0
#8  0x000055700ee88053 in google::protobuf::compiler::objectivec::(anonymous namespace)::ObjCHelperDeathTest_TextFormatDecodeData_DecodeDataForString_Failures_Test::TestBody() ()
#9  0x00007f65d23adb3c in testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void> (location=0x7f65d23b68f0 "the test body", 
    method=<optimized out>, object=0x557010ad5c00) at /usr/src/debug/gtest/googletest-1.13.0/googletest/src/gtest.cc:2621
#10 testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) [clone .constprop.0] (object=0x557010ad5c00, method=<optimized out>, location=0x7f65d23b68f0 "the test body")
    at /usr/src/debug/gtest/googletest-1.13.0/googletest/src/gtest.cc:2657
#11 0x00007f65d239a198 in testing::Test::Run (this=0x557010ad5c00) at /usr/src/debug/gtest/googletest-1.13.0/googletest/src/gtest.cc:2696
#12 testing::Test::Run (this=0x557010ad5c00) at /usr/src/debug/gtest/googletest-1.13.0/googletest/src/gtest.cc:2686
#13 0x00007f65d239a3a7 in testing::TestInfo::Run (this=0x557010a67420) at /usr/src/debug/gtest/googletest-1.13.0/googletest/src/gtest.cc:2845
#14 0x00007f65d239a504 in testing::TestSuite::Run (this=0x557010a676c0) at /usr/src/debug/gtest/googletest-1.13.0/googletest/src/gtest.cc:3004
#15 testing::TestSuite::Run (this=0x557010a676c0) at /usr/src/debug/gtest/googletest-1.13.0/googletest/src/gtest.cc:2977
--Type <RET> for more, q to quit, c to continue without paging--
#16 0x00007f65d23a6a6f in testing::internal::UnitTestImpl::RunAllTests (this=this@entry=0x557010995f70)
    at /usr/src/debug/gtest/googletest-1.13.0/googletest/src/gtest.cc:5890
#17 0x00007f65d23a56a9 in testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> (
    location=0x7f65d23b7ea0 "auxiliary test code (environments or event listeners)", 
    method=(bool (testing::internal::UnitTestImpl::*)(testing::internal::UnitTestImpl * const)) 0x7f65d23a6700 <testing::internal::UnitTestImpl::RunAllTests()>, object=0x557010995f70) at /usr/src/debug/gtest/googletest-1.13.0/googletest/src/gtest.cc:2602
#18 testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> (
    location=0x7f65d23b7ea0 "auxiliary test code (environments or event listeners)", 
    method=(bool (testing::internal::UnitTestImpl::*)(testing::internal::UnitTestImpl * const)) 0x7f65d23a6700 <testing::internal::UnitTestImpl::RunAllTests()>, object=0x557010995f70) at /usr/src/debug/gtest/googletest-1.13.0/googletest/src/gtest.cc:2657
#19 testing::UnitTest::Run (this=<optimized out>) at /usr/src/debug/gtest/googletest-1.13.0/googletest/src/gtest.cc:5455
#20 0x00007f65d2bc8066 in RUN_ALL_TESTS () at /usr/src/debug/gtest/googletest-1.13.0/googletest/include/gtest/gtest.h:2314
#21 main (argc=<optimized out>, argv=0x7ffebae42768) at /usr/src/debug/gtest/googletest-1.13.0/googlemock/src/gmock_main.cc:70

Anything else we should know about your project / environment

Same issue when using the bundled abseil-cpp. Building with C++14 makes test pass correctly.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions