Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.11.0: build fails #3514

Closed
kloczek opened this issue Aug 6, 2021 · 6 comments · Fixed by #3797
Closed

1.11.0: build fails #3514

kloczek opened this issue Aug 6, 2021 · 6 comments · Fixed by #3797
Assignees
Labels

Comments

@kloczek
Copy link

kloczek commented Aug 6, 2021

Build fails with -Werror=maybe-uninitialized errors.
gcc 11.1.1

make[2]: Entering directory '/home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/x86_64-redhat-linux-gnu'
[ 27%] Building CXX object googlemock/CMakeFiles/shared_gmock_test_.dir/test/gmock-spec-builders_test.cc.o
cd /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/x86_64-redhat-linux-gnu/googlemock && /usr/bin/g++ -DGTEST_LINKED_AS_SHARED_LIBRARY=1 -I/home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/include -I/home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock -I/home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googletest/include -I/home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googletest -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -DNDEBUG -Wall -Wshadow -Werror -Wno-error=dangling-else -DGTEST_HAS_PTHREAD=1 -fexceptions -MD -MT googlemock/CMakeFiles/shared_gmock_test_.dir/test/gmock-spec-builders_test.cc.o -MF CMakeFiles/shared_gmock_test_.dir/test/gmock-spec-builders_test.cc.o.d -o CMakeFiles/shared_gmock_test_.dir/test/gmock-spec-builders_test.cc.o -c /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/test/gmock-spec-builders_test.cc
In file included from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googletest/include/gtest/internal/gtest-death-test-internal.h:39,
                 from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googletest/include/gtest/gtest-death-test.h:41,
                 from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googletest/include/gtest/gtest.h:64,
                 from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/include/gmock/internal/gmock-internal-utils.h:47,
                 from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/include/gmock/gmock-actions.h:145,
                 from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/include/gmock/gmock-spec-builders.h:73,
                 from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/test/gmock-spec-builders_test.cc:35:
In member function ‘testing::internal::MatcherBase<T>& testing::internal::MatcherBase<T>::operator=(const testing::internal::MatcherBase<T>&) [with T = const std::tuple<int>&]’,
    inlined from ‘testing::Matcher<const std::tuple<int>&>& testing::Matcher<const std::tuple<int>&>::operator=(const testing::Matcher<const std::tuple<int>&>&)’ at /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googletest/include/gtest/gtest-matchers.h:479:7,
    inlined from ‘testing::internal::OnCallSpec<F>& testing::internal::OnCallSpec<F>::With(const testing::Matcher<const typename testing::internal::Function<F>::ArgumentTuple&>&) [with F = void(int)]’ at /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/include/gmock/gmock-spec-builders.h:326:20,
    inlined from ‘virtual void {anonymous}::OnCallSyntaxTest_WithIsOptional_Test::TestBody()’ at /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/test/gmock-spec-builders_test.cc:260:12:
/home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googletest/include/gtest/gtest-matchers.h:310:5: error: ‘<unnamed>.testing::Matcher<const std::tuple<int>&>::<unnamed>.testing::internal::MatcherBase<const std::tuple<int>&>::buffer_’ may be used uninitialized [-Werror=maybe-uninitialized]
  310 |     buffer_ = other.buffer_;
      |     ^~~~~~~
/home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/test/gmock-spec-builders_test.cc: In member function ‘virtual void {anonymous}::OnCallSyntaxTest_WithIsOptional_Test::TestBody()’:
/home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/test/gmock-spec-builders_test.cc:260:12: note: ‘<anonymous>’ declared here
  260 |       .With(_)
In file included from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/include/gmock/gmock.h:65,
                 from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/test/gmock-spec-builders_test.cc:42:
In constructor ‘testing::internal::NaggyMockImpl<MockClass>::NaggyMockImpl() [with Base = {anonymous}::MockA]’,
    inlined from ‘testing::NaggyMock<MockClass>::NaggyMock() [with MockClass = {anonymous}::MockA]’ at /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/include/gmock/gmock-nice-strict.h:186:27,
    inlined from ‘void {anonymous}::GMockVerboseFlagTest::TestUninterestingCallOnNaggyMock(bool)’ at /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/test/gmock-spec-builders_test.cc:2176:22:
/home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/include/gmock/gmock-nice-strict.h:120:60: error: ‘a’ may be used uninitialized [-Werror=maybe-uninitialized]
  120 |   NaggyMockImpl() { ::testing::Mock::WarnUninterestingCalls(this); }
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
In file included from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/test/gmock-spec-builders_test.cc:35:
/home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/include/gmock/gmock-spec-builders.h: In member function ‘void {anonymous}::GMockVerboseFlagTest::TestUninterestingCallOnNaggyMock(bool)’:
/home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/include/gmock/gmock-spec-builders.h:438:15: note: by argument 1 of type ‘const void*’ to ‘static void testing::Mock::WarnUninterestingCalls(const void*)’ declared here
  438 |   static void WarnUninterestingCalls(const void* mock_obj)
      |               ^~~~~~~~~~~~~~~~~~~~~~
/home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/test/gmock-spec-builders_test.cc:2176:22: note: ‘a’ declared here
 2176 |     NaggyMock<MockA> a;
      |                      ^
In file included from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/include/gmock/gmock.h:65,
                 from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/test/gmock-spec-builders_test.cc:42:
In constructor ‘testing::internal::NaggyMockImpl<MockClass>::NaggyMockImpl() [with Base = {anonymous}::MockB]’,
    inlined from ‘testing::NaggyMock<MockClass>::NaggyMock() [with MockClass = {anonymous}::MockB]’ at /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/include/gmock/gmock-nice-strict.h:186:27,
    inlined from ‘virtual void {anonymous}::FunctionCallMessageTest_UninterestingCallOnNaggyMockPrintsArgumentsAndReturnValue_Test::TestBody()’ at /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/test/gmock-spec-builders_test.cc:2092:20:
/home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/include/gmock/gmock-nice-strict.h:120:60: error: ‘b’ may be used uninitialized [-Werror=maybe-uninitialized]
  120 |   NaggyMockImpl() { ::testing::Mock::WarnUninterestingCalls(this); }
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
In file included from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/test/gmock-spec-builders_test.cc:35:
/home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/include/gmock/gmock-spec-builders.h: In member function ‘virtual void {anonymous}::FunctionCallMessageTest_UninterestingCallOnNaggyMockPrintsArgumentsAndReturnValue_Test::TestBody()’:
/home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/include/gmock/gmock-spec-builders.h:438:15: note: by argument 1 of type ‘const void*’ to ‘static void testing::Mock::WarnUninterestingCalls(const void*)’ declared here
  438 |   static void WarnUninterestingCalls(const void* mock_obj)
      |               ^~~~~~~~~~~~~~~~~~~~~~
/home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/test/gmock-spec-builders_test.cc:2092:20: note: ‘b’ declared here
 2092 |   NaggyMock<MockB> b;
      |                    ^
In file included from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googletest/include/gtest/internal/gtest-death-test-internal.h:39,
                 from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googletest/include/gtest/gtest-death-test.h:41,
                 from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googletest/include/gtest/gtest.h:64,
                 from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/include/gmock/internal/gmock-internal-utils.h:47,
                 from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/include/gmock/gmock-actions.h:145,
                 from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/include/gmock/gmock-spec-builders.h:73,
                 from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/test/gmock-spec-builders_test.cc:35:
In copy constructor ‘testing::internal::MatcherBase<T>::MatcherBase(const testing::internal::MatcherBase<T>&) [with T = int]’,
    inlined from ‘testing::Matcher<int>::Matcher(const testing::Matcher<int>&)’ at /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googletest/include/gtest/gtest-matchers.h:479:7,
    inlined from ‘testing::internal::MockSpec<{anonymous}::Result(int)> {anonymous}::MockA::gmock_ReturnResult(const testing::Matcher<int>&)’ at /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/test/gmock-spec-builders_test.cc:152:3,
    inlined from ‘virtual void {anonymous}::OnCallSyntaxTest_WithCanAppearAtMostOnce_Test::TestBody()’ at /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/test/gmock-spec-builders_test.cc:267:3:
/home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googletest/include/gtest/gtest-matchers.h:302:33: error: ‘<unnamed>.testing::Matcher<int>::<unnamed>.testing::internal::MatcherBase<int>::buffer_’ may be used uninitialized [-Werror=maybe-uninitialized]
  302 |       : vtable_(other.vtable_), buffer_(other.buffer_) {
      |                                 ^~~~~~~~~~~~~~~~~~~~~~
In file included from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/test/gmock-spec-builders_test.cc:45:
/home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/test/gmock-spec-builders_test.cc: In member function ‘virtual void {anonymous}::OnCallSyntaxTest_WithCanAppearAtMostOnce_Test::TestBody()’:
/home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/test/gmock-spec-builders_test.cc:268:28: note: ‘<anonymous>’ declared here
  268 |     ON_CALL(a, ReturnResult(_))
/home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googletest/include/gtest/gtest-spi.h:220:48: note: in definition of macro ‘EXPECT_NONFATAL_FAILURE’
  220 |       if (::testing::internal::AlwaysTrue()) { statement; }\
      |                                                ^~~~~~~~~
/home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/include/gmock/gmock-spec-builders.h:2033:3: note: in expansion of macro ‘GMOCK_ON_CALL_IMPL_’
 2033 |   GMOCK_ON_CALL_IMPL_(obj, InternalDefaultActionSetAt, call)
      |   ^~~~~~~~~~~~~~~~~~~
/home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/test/gmock-spec-builders_test.cc:268:5: note: in expansion of macro ‘ON_CALL’
  268 |     ON_CALL(a, ReturnResult(_))
      |     ^~~~~~~
In file included from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googletest/include/gtest/internal/gtest-death-test-internal.h:39,
                 from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googletest/include/gtest/gtest-death-test.h:41,
                 from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googletest/include/gtest/gtest.h:64,
                 from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/include/gmock/internal/gmock-internal-utils.h:47,
                 from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/include/gmock/gmock-actions.h:145,
                 from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/include/gmock/gmock-spec-builders.h:73,
                 from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/test/gmock-spec-builders_test.cc:35:
In member function ‘testing::internal::MatcherBase<T>& testing::internal::MatcherBase<T>::operator=(const testing::internal::MatcherBase<T>&) [with T = const std::tuple<int>&]’,
    inlined from ‘testing::Matcher<const std::tuple<int>&>& testing::Matcher<const std::tuple<int>&>::operator=(const testing::Matcher<const std::tuple<int>&>&)’ at /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googletest/include/gtest/gtest-matchers.h:479:7,
    inlined from ‘testing::internal::OnCallSpec<F>& testing::internal::OnCallSpec<F>::With(const testing::Matcher<const typename testing::internal::Function<F>::ArgumentTuple&>&) [with F = {anonymous}::Result(int)]’ at /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/include/gmock/gmock-spec-builders.h:326:20,
    inlined from ‘virtual void {anonymous}::OnCallSyntaxTest_WithCanAppearAtMostOnce_Test::TestBody()’ at /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/test/gmock-spec-builders_test.cc:267:3:
/home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googletest/include/gtest/gtest-matchers.h:310:5: error: ‘<unnamed>.testing::Matcher<const std::tuple<int>&>::<unnamed>.testing::internal::MatcherBase<const std::tuple<int>&>::buffer_’ may be used uninitialized [-Werror=maybe-uninitialized]
  310 |     buffer_ = other.buffer_;
      |     ^~~~~~~
In file included from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/test/gmock-spec-builders_test.cc:45:
/home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/test/gmock-spec-builders_test.cc: In member function ‘virtual void {anonymous}::OnCallSyntaxTest_WithCanAppearAtMostOnce_Test::TestBody()’:
/home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/test/gmock-spec-builders_test.cc:269:14: note: ‘<anonymous>’ declared here
  269 |         .With(_)
/home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googletest/include/gtest/gtest-spi.h:220:48: note: in definition of macro ‘EXPECT_NONFATAL_FAILURE’
  220 |       if (::testing::internal::AlwaysTrue()) { statement; }\
      |                                                ^~~~~~~~~
In file included from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googletest/include/gtest/internal/gtest-death-test-internal.h:39,
                 from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googletest/include/gtest/gtest-death-test.h:41,
                 from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googletest/include/gtest/gtest.h:64,
                 from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/include/gmock/internal/gmock-internal-utils.h:47,
                 from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/include/gmock/gmock-actions.h:145,
                 from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/include/gmock/gmock-spec-builders.h:73,
                 from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/test/gmock-spec-builders_test.cc:35:
In member function ‘testing::internal::MatcherBase<T>& testing::internal::MatcherBase<T>::operator=(const testing::internal::MatcherBase<T>&) [with T = const std::tuple<int>&]’,
    inlined from ‘testing::Matcher<const std::tuple<int>&>& testing::Matcher<const std::tuple<int>&>::operator=(const testing::Matcher<const std::tuple<int>&>&)’ at /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googletest/include/gtest/gtest-matchers.h:479:7,
    inlined from ‘testing::internal::OnCallSpec<F>& testing::internal::OnCallSpec<F>::With(const testing::Matcher<const typename testing::internal::Function<F>::ArgumentTuple&>&) [with F = {anonymous}::Result(int)]’ at /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/include/gmock/gmock-spec-builders.h:326:20,
    inlined from ‘virtual void {anonymous}::OnCallSyntaxTest_WithCanAppearAtMostOnce_Test::TestBody()’ at /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/test/gmock-spec-builders_test.cc:267:3:
/home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googletest/include/gtest/gtest-matchers.h:310:5: error: ‘<unnamed>.testing::Matcher<const std::tuple<int>&>::<unnamed>.testing::internal::MatcherBase<const std::tuple<int>&>::buffer_’ may be used uninitialized [-Werror=maybe-uninitialized]
  310 |     buffer_ = other.buffer_;
      |     ^~~~~~~
In file included from /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/test/gmock-spec-builders_test.cc:45:
/home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/test/gmock-spec-builders_test.cc: In member function ‘virtual void {anonymous}::OnCallSyntaxTest_WithCanAppearAtMostOnce_Test::TestBody()’:
/home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/test/gmock-spec-builders_test.cc:270:14: note: ‘<anonymous>’ declared here
  270 |         .With(_)
/home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/googletest/include/gtest/gtest-spi.h:220:48: note: in definition of macro ‘EXPECT_NONFATAL_FAILURE’
  220 |       if (::testing::internal::AlwaysTrue()) { statement; }\
      |                                                ^~~~~~~~~
cc1plus: all warnings being treated as errors
@kloczek kloczek added the bug label Aug 6, 2021
@kloczek
Copy link
Author

kloczek commented Aug 6, 2021

After add -Wno-error=maybe-uninitialized to CXXFLSGS I was able to build gtest but after that two ctest units are failing with SIGSEGV

+ cd googletest-release-1.11.0
+ /usr/bin/make -O -j48 V=1 VERBOSE=1 -C x86_64-redhat-linux-gnu test ARGS=--output-on-failure
make: Entering directory '/home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/x86_64-redhat-linux-gnu'
Running tests...
/usr/bin/ctest --force-new-ctest-process --output-on-failure
Test project /home/tkloczko/rpmbuild/BUILD/googletest-release-1.11.0/x86_64-redhat-linux-gnu
      Start  1: gmock-actions_test
 1/60 Test  #1: gmock-actions_test .........................   Passed    0.90 sec
      Start  2: gmock-cardinalities_test
 2/60 Test  #2: gmock-cardinalities_test ...................   Passed    0.01 sec
      Start  3: gmock_ex_test
 3/60 Test  #3: gmock_ex_test ..............................   Passed    0.01 sec
      Start  4: gmock-function-mocker_test
 4/60 Test  #4: gmock-function-mocker_test .................   Passed    0.01 sec
      Start  5: gmock-internal-utils_test
 5/60 Test  #5: gmock-internal-utils_test ..................   Passed    0.27 sec
      Start  6: gmock-matchers_test
 6/60 Test  #6: gmock-matchers_test ........................   Passed    0.48 sec
      Start  7: gmock-more-actions_test
 7/60 Test  #7: gmock-more-actions_test ....................***Exception: SegFault  0.14 sec
Running main() from gmock_main.cc
[==========] Running 109 tests from 18 test suites.
[----------] Global test environment set-up.
[----------] 15 tests from InvokeTest
[ RUN      ] InvokeTest.Nullary
[       OK ] InvokeTest.Nullary (0 ms)
[ RUN      ] InvokeTest.Unary
[       OK ] InvokeTest.Unary (0 ms)
[ RUN      ] InvokeTest.Binary
[       OK ] InvokeTest.Binary (0 ms)
[ RUN      ] InvokeTest.Ternary
[       OK ] InvokeTest.Ternary (0 ms)
[ RUN      ] InvokeTest.FunctionThatTakes4Arguments
[       OK ] InvokeTest.FunctionThatTakes4Arguments (0 ms)
[ RUN      ] InvokeTest.FunctionThatTakes5Arguments
[       OK ] InvokeTest.FunctionThatTakes5Arguments (0 ms)
[ RUN      ] InvokeTest.FunctionThatTakes6Arguments
[       OK ] InvokeTest.FunctionThatTakes6Arguments (0 ms)
[ RUN      ] InvokeTest.FunctionThatTakes7Arguments
[       OK ] InvokeTest.FunctionThatTakes7Arguments (0 ms)
[ RUN      ] InvokeTest.FunctionThatTakes8Arguments
[       OK ] InvokeTest.FunctionThatTakes8Arguments (0 ms)
[ RUN      ] InvokeTest.FunctionThatTakes9Arguments
[       OK ] InvokeTest.FunctionThatTakes9Arguments (0 ms)
[ RUN      ] InvokeTest.FunctionThatTakes10Arguments
[       OK ] InvokeTest.FunctionThatTakes10Arguments (0 ms)
[ RUN      ] InvokeTest.FunctionWithUnusedParameters
[       OK ] InvokeTest.FunctionWithUnusedParameters (0 ms)
[ RUN      ] InvokeTest.MethodWithUnusedParameters
[       OK ] InvokeTest.MethodWithUnusedParameters (0 ms)
[ RUN      ] InvokeTest.Functor
[       OK ] InvokeTest.Functor (0 ms)
[ RUN      ] InvokeTest.FunctionWithCompatibleType
[       OK ] InvokeTest.FunctionWithCompatibleType (0 ms)
[----------] 15 tests from InvokeTest (0 ms total)

[----------] 12 tests from InvokeMethodTest
[ RUN      ] InvokeMethodTest.Nullary
[       OK ] InvokeMethodTest.Nullary (0 ms)
[ RUN      ] InvokeMethodTest.Unary
[       OK ] InvokeMethodTest.Unary (0 ms)
[ RUN      ] InvokeMethodTest.Binary
[       OK ] InvokeMethodTest.Binary (0 ms)
[ RUN      ] InvokeMethodTest.Ternary
[       OK ] InvokeMethodTest.Ternary (0 ms)
[ RUN      ] InvokeMethodTest.MethodThatTakes4Arguments
[       OK ] InvokeMethodTest.MethodThatTakes4Arguments (0 ms)
[ RUN      ] InvokeMethodTest.MethodThatTakes5Arguments
[       OK ] InvokeMethodTest.MethodThatTakes5Arguments (0 ms)
[ RUN      ] InvokeMethodTest.MethodThatTakes6Arguments
[       OK ] InvokeMethodTest.MethodThatTakes6Arguments (0 ms)
[ RUN      ] InvokeMethodTest.MethodThatTakes7Arguments
[       OK ] InvokeMethodTest.MethodThatTakes7Arguments (0 ms)
[ RUN      ] InvokeMethodTest.MethodThatTakes8Arguments
[       OK ] InvokeMethodTest.MethodThatTakes8Arguments (0 ms)
[ RUN      ] InvokeMethodTest.MethodThatTakes9Arguments
[       OK ] InvokeMethodTest.MethodThatTakes9Arguments (0 ms)
[ RUN      ] InvokeMethodTest.MethodThatTakes10Arguments
[       OK ] InvokeMethodTest.MethodThatTakes10Arguments (0 ms)
[ RUN      ] InvokeMethodTest.MethodWithCompatibleType
[       OK ] InvokeMethodTest.MethodWithCompatibleType (0 ms)
[----------] 12 tests from InvokeMethodTest (0 ms total)

[----------] 1 test from WithoutArgsTest
[ RUN      ] WithoutArgsTest.NoArg
[       OK ] WithoutArgsTest.NoArg (0 ms)
[----------] 1 test from WithoutArgsTest (0 ms total)

[----------] 1 test from WithArgTest
[ RUN      ] WithArgTest.OneArg
[       OK ] WithArgTest.OneArg (0 ms)
[----------] 1 test from WithArgTest (0 ms total)

[----------] 3 tests from ReturnArgActionTest
[ RUN      ] ReturnArgActionTest.WorksForOneArgIntArg0
[       OK ] ReturnArgActionTest.WorksForOneArgIntArg0 (0 ms)
[ RUN      ] ReturnArgActionTest.WorksForMultiArgBoolArg0
[       OK ] ReturnArgActionTest.WorksForMultiArgBoolArg0 (0 ms)
[ RUN      ] ReturnArgActionTest.WorksForMultiArgStringArg2
[       OK ] ReturnArgActionTest.WorksForMultiArgStringArg2 (0 ms)
[----------] 3 tests from ReturnArgActionTest (0 ms total)

[----------] 2 tests from SaveArgActionTest
[ RUN      ] SaveArgActionTest.WorksForSameType
[       OK ] SaveArgActionTest.WorksForSameType (0 ms)
[ RUN      ] SaveArgActionTest.WorksForCompatibleType
[       OK ] SaveArgActionTest.WorksForCompatibleType (0 ms)
[----------] 2 tests from SaveArgActionTest (0 ms total)

[----------] 2 tests from SaveArgPointeeActionTest
[ RUN      ] SaveArgPointeeActionTest.WorksForSameType
[       OK ] SaveArgPointeeActionTest.WorksForSameType (0 ms)
[ RUN      ] SaveArgPointeeActionTest.WorksForCompatibleType
[       OK ] SaveArgPointeeActionTest.WorksForCompatibleType (0 ms)
[----------] 2 tests from SaveArgPointeeActionTest (0 ms total)

[----------] 3 tests from SetArgRefereeActionTest
[ RUN      ] SetArgRefereeActionTest.WorksForSameType
[       OK ] SetArgRefereeActionTest.WorksForSameType (0 ms)
[ RUN      ] SetArgRefereeActionTest.WorksForCompatibleType
[       OK ] SetArgRefereeActionTest.WorksForCompatibleType (0 ms)
[ RUN      ] SetArgRefereeActionTest.WorksWithExtraArguments
[       OK ] SetArgRefereeActionTest.WorksWithExtraArguments (0 ms)
[----------] 3 tests from SetArgRefereeActionTest (0 ms total)

[----------] 2 tests from DeleteArgActionTest
[ RUN      ] DeleteArgActionTest.OneArg

      Start  8: gmock-nice-strict_test
 8/60 Test  #8: gmock-nice-strict_test .....................   Passed    0.01 sec
      Start  9: gmock-port_test
 9/60 Test  #9: gmock-port_test ............................   Passed    0.01 sec
      Start 10: gmock-spec-builders_test
10/60 Test #10: gmock-spec-builders_test ...................   Passed    0.16 sec
      Start 11: gmock_link_test
11/60 Test #11: gmock_link_test ............................   Passed    0.01 sec
      Start 12: gmock_test
12/60 Test #12: gmock_test .................................   Passed    0.01 sec
      Start 13: gmock_stress_test
13/60 Test #13: gmock_stress_test ..........................   Passed    0.24 sec
      Start 14: gmock-more-actions_no_exception_test
14/60 Test #14: gmock-more-actions_no_exception_test .......***Exception: SegFault  0.15 sec
Running main() from gmock_main.cc
[==========] Running 105 tests from 17 test suites.
[----------] Global test environment set-up.
[----------] 15 tests from InvokeTest
[ RUN      ] InvokeTest.Nullary
[       OK ] InvokeTest.Nullary (0 ms)
[ RUN      ] InvokeTest.Unary
[       OK ] InvokeTest.Unary (0 ms)
[ RUN      ] InvokeTest.Binary
[       OK ] InvokeTest.Binary (0 ms)
[ RUN      ] InvokeTest.Ternary
[       OK ] InvokeTest.Ternary (0 ms)
[ RUN      ] InvokeTest.FunctionThatTakes4Arguments
[       OK ] InvokeTest.FunctionThatTakes4Arguments (0 ms)
[ RUN      ] InvokeTest.FunctionThatTakes5Arguments
[       OK ] InvokeTest.FunctionThatTakes5Arguments (0 ms)
[ RUN      ] InvokeTest.FunctionThatTakes6Arguments
[       OK ] InvokeTest.FunctionThatTakes6Arguments (0 ms)
[ RUN      ] InvokeTest.FunctionThatTakes7Arguments
[       OK ] InvokeTest.FunctionThatTakes7Arguments (0 ms)
[ RUN      ] InvokeTest.FunctionThatTakes8Arguments
[       OK ] InvokeTest.FunctionThatTakes8Arguments (0 ms)
[ RUN      ] InvokeTest.FunctionThatTakes9Arguments
[       OK ] InvokeTest.FunctionThatTakes9Arguments (0 ms)
[ RUN      ] InvokeTest.FunctionThatTakes10Arguments
[       OK ] InvokeTest.FunctionThatTakes10Arguments (0 ms)
[ RUN      ] InvokeTest.FunctionWithUnusedParameters
[       OK ] InvokeTest.FunctionWithUnusedParameters (0 ms)
[ RUN      ] InvokeTest.MethodWithUnusedParameters
[       OK ] InvokeTest.MethodWithUnusedParameters (0 ms)
[ RUN      ] InvokeTest.Functor
[       OK ] InvokeTest.Functor (0 ms)
[ RUN      ] InvokeTest.FunctionWithCompatibleType
[       OK ] InvokeTest.FunctionWithCompatibleType (0 ms)
[----------] 15 tests from InvokeTest (0 ms total)

[----------] 12 tests from InvokeMethodTest
[ RUN      ] InvokeMethodTest.Nullary
[       OK ] InvokeMethodTest.Nullary (0 ms)
[ RUN      ] InvokeMethodTest.Unary
[       OK ] InvokeMethodTest.Unary (0 ms)
[ RUN      ] InvokeMethodTest.Binary
[       OK ] InvokeMethodTest.Binary (0 ms)
[ RUN      ] InvokeMethodTest.Ternary
[       OK ] InvokeMethodTest.Ternary (0 ms)
[ RUN      ] InvokeMethodTest.MethodThatTakes4Arguments
[       OK ] InvokeMethodTest.MethodThatTakes4Arguments (0 ms)
[ RUN      ] InvokeMethodTest.MethodThatTakes5Arguments
[       OK ] InvokeMethodTest.MethodThatTakes5Arguments (0 ms)
[ RUN      ] InvokeMethodTest.MethodThatTakes6Arguments
[       OK ] InvokeMethodTest.MethodThatTakes6Arguments (0 ms)
[ RUN      ] InvokeMethodTest.MethodThatTakes7Arguments
[       OK ] InvokeMethodTest.MethodThatTakes7Arguments (0 ms)
[ RUN      ] InvokeMethodTest.MethodThatTakes8Arguments
[       OK ] InvokeMethodTest.MethodThatTakes8Arguments (0 ms)
[ RUN      ] InvokeMethodTest.MethodThatTakes9Arguments
[       OK ] InvokeMethodTest.MethodThatTakes9Arguments (0 ms)
[ RUN      ] InvokeMethodTest.MethodThatTakes10Arguments
[       OK ] InvokeMethodTest.MethodThatTakes10Arguments (0 ms)
[ RUN      ] InvokeMethodTest.MethodWithCompatibleType
[       OK ] InvokeMethodTest.MethodWithCompatibleType (0 ms)
[----------] 12 tests from InvokeMethodTest (0 ms total)

[----------] 1 test from WithoutArgsTest
[ RUN      ] WithoutArgsTest.NoArg
[       OK ] WithoutArgsTest.NoArg (0 ms)
[----------] 1 test from WithoutArgsTest (0 ms total)

[----------] 1 test from WithArgTest
[ RUN      ] WithArgTest.OneArg
[       OK ] WithArgTest.OneArg (0 ms)
[----------] 1 test from WithArgTest (0 ms total)

[----------] 3 tests from ReturnArgActionTest
[ RUN      ] ReturnArgActionTest.WorksForOneArgIntArg0
[       OK ] ReturnArgActionTest.WorksForOneArgIntArg0 (0 ms)
[ RUN      ] ReturnArgActionTest.WorksForMultiArgBoolArg0
[       OK ] ReturnArgActionTest.WorksForMultiArgBoolArg0 (0 ms)
[ RUN      ] ReturnArgActionTest.WorksForMultiArgStringArg2
[       OK ] ReturnArgActionTest.WorksForMultiArgStringArg2 (0 ms)
[----------] 3 tests from ReturnArgActionTest (0 ms total)

[----------] 2 tests from SaveArgActionTest
[ RUN      ] SaveArgActionTest.WorksForSameType
[       OK ] SaveArgActionTest.WorksForSameType (0 ms)
[ RUN      ] SaveArgActionTest.WorksForCompatibleType
[       OK ] SaveArgActionTest.WorksForCompatibleType (0 ms)
[----------] 2 tests from SaveArgActionTest (0 ms total)

[----------] 2 tests from SaveArgPointeeActionTest
[ RUN      ] SaveArgPointeeActionTest.WorksForSameType
[       OK ] SaveArgPointeeActionTest.WorksForSameType (0 ms)
[ RUN      ] SaveArgPointeeActionTest.WorksForCompatibleType
[       OK ] SaveArgPointeeActionTest.WorksForCompatibleType (0 ms)
[----------] 2 tests from SaveArgPointeeActionTest (0 ms total)

[----------] 3 tests from SetArgRefereeActionTest
[ RUN      ] SetArgRefereeActionTest.WorksForSameType
[       OK ] SetArgRefereeActionTest.WorksForSameType (0 ms)
[ RUN      ] SetArgRefereeActionTest.WorksForCompatibleType
[       OK ] SetArgRefereeActionTest.WorksForCompatibleType (0 ms)
[ RUN      ] SetArgRefereeActionTest.WorksWithExtraArguments
[       OK ] SetArgRefereeActionTest.WorksWithExtraArguments (0 ms)
[----------] 3 tests from SetArgRefereeActionTest (0 ms total)

[----------] 2 tests from DeleteArgActionTest
[ RUN      ] DeleteArgActionTest.OneArg

      Start 15: gmock_no_rtti_test
15/60 Test #15: gmock_no_rtti_test .........................   Passed    0.17 sec
      Start 16: googletest-death-test-test
16/60 Test #16: googletest-death-test-test .................   Passed    0.57 sec
      Start 17: gtest_environment_test
17/60 Test #17: gtest_environment_test .....................   Passed    0.01 sec
      Start 18: googletest-filepath-test
18/60 Test #18: googletest-filepath-test ...................   Passed    0.01 sec
      Start 19: googletest-listener-test
19/60 Test #19: googletest-listener-test ...................   Passed    0.01 sec
      Start 20: gtest_main_unittest
20/60 Test #20: gtest_main_unittest ........................   Passed    0.01 sec
      Start 21: googletest-message-test
21/60 Test #21: googletest-message-test ....................   Passed    0.01 sec
      Start 22: gtest_no_test_unittest
22/60 Test #22: gtest_no_test_unittest .....................   Passed    0.01 sec
      Start 23: googletest-options-test
23/60 Test #23: googletest-options-test ....................   Passed    0.01 sec
      Start 24: googletest-param-test-test
24/60 Test #24: googletest-param-test-test .................   Passed    0.16 sec
      Start 25: googletest-port-test
25/60 Test #25: googletest-port-test .......................   Passed    2.45 sec
      Start 26: gtest_pred_impl_unittest
26/60 Test #26: gtest_pred_impl_unittest ...................   Passed    0.01 sec
      Start 27: gtest_premature_exit_test
27/60 Test #27: gtest_premature_exit_test ..................   Passed    0.00 sec
      Start 28: googletest-printers-test
28/60 Test #28: googletest-printers-test ...................   Passed    0.01 sec
      Start 29: gtest_prod_test
29/60 Test #29: gtest_prod_test ............................   Passed    0.00 sec
      Start 30: gtest_repeat_test
30/60 Test #30: gtest_repeat_test ..........................   Passed    2.70 sec
      Start 31: gtest_sole_header_test
31/60 Test #31: gtest_sole_header_test .....................   Passed    0.01 sec
      Start 32: gtest_stress_test
32/60 Test #32: gtest_stress_test ..........................   Passed    0.23 sec
      Start 33: googletest-test-part-test
33/60 Test #33: googletest-test-part-test ..................   Passed    0.28 sec
      Start 34: gtest_throw_on_failure_ex_test
34/60 Test #34: gtest_throw_on_failure_ex_test .............   Passed    0.01 sec
      Start 35: gtest-typed-test_test
35/60 Test #35: gtest-typed-test_test ......................   Passed    0.55 sec
      Start 36: gtest_unittest
36/60 Test #36: gtest_unittest .............................   Passed    1.58 sec
      Start 37: gtest-unittest-api_test
37/60 Test #37: gtest-unittest-api_test ....................   Passed    0.00 sec
      Start 38: gtest_skip_in_environment_setup_test
38/60 Test #38: gtest_skip_in_environment_setup_test .......   Passed    0.00 sec
      Start 39: gtest_skip_test
39/60 Test #39: gtest_skip_test ............................   Passed    0.00 sec
      Start 40: gtest-death-test_ex_nocatch_test
40/60 Test #40: gtest-death-test_ex_nocatch_test ...........   Passed    0.01 sec
      Start 41: gtest-death-test_ex_catch_test
41/60 Test #41: gtest-death-test_ex_catch_test .............   Passed    0.01 sec
      Start 42: gtest_no_rtti_unittest
42/60 Test #42: gtest_no_rtti_unittest .....................   Passed    1.58 sec
      Start 43: googletest-break-on-failure-unittest
43/60 Test #43: googletest-break-on-failure-unittest .......   Passed    0.86 sec
      Start 44: gtest_skip_check_output_test
44/60 Test #44: gtest_skip_check_output_test ...............   Passed    0.12 sec
      Start 45: gtest_skip_environment_check_output_test
45/60 Test #45: gtest_skip_environment_check_output_test ...   Passed    0.11 sec
      Start 46: googletest-catch-exceptions-test
46/60 Test #46: googletest-catch-exceptions-test ...........   Passed    0.12 sec
      Start 47: googletest-color-test
47/60 Test #47: googletest-color-test ......................   Passed    0.34 sec
      Start 48: googletest-env-var-test
48/60 Test #48: googletest-env-var-test ....................   Passed    0.32 sec
      Start 49: googletest-filter-unittest
49/60 Test #49: googletest-filter-unittest .................   Passed    1.70 sec
      Start 50: gtest_help_test
50/60 Test #50: gtest_help_test ............................   Passed    0.19 sec
      Start 51: googletest-list-tests-unittest
51/60 Test #51: googletest-list-tests-unittest .............   Passed    0.15 sec
      Start 52: googletest-output-test
52/60 Test #52: googletest-output-test .....................   Passed    0.22 sec
      Start 53: googletest-shuffle-test
53/60 Test #53: googletest-shuffle-test ....................   Passed    0.23 sec
      Start 54: googletest-throw-on-failure-test
54/60 Test #54: googletest-throw-on-failure-test ...........   Passed    0.70 sec
      Start 55: googletest-uninitialized-test
55/60 Test #55: googletest-uninitialized-test ..............   Passed    0.11 sec
      Start 56: gtest_list_output_unittest
56/60 Test #56: gtest_list_output_unittest .................   Passed    0.12 sec
      Start 57: gtest_xml_outfiles_test
57/60 Test #57: gtest_xml_outfiles_test ....................   Passed    0.12 sec
      Start 58: googletest-json-outfiles-test
58/60 Test #58: googletest-json-outfiles-test ..............   Passed    0.11 sec
      Start 59: gtest_xml_output_unittest
59/60 Test #59: gtest_xml_output_unittest ..................   Passed    0.20 sec
      Start 60: googletest-json-output-unittest
60/60 Test #60: googletest-json-output-unittest ............   Passed    0.17 sec

97% tests passed, 2 tests failed out of 60

Total Test time (real) =  18.74 sec

The following tests FAILED:
          7 - gmock-more-actions_test (SEGFAULT)
         14 - gmock-more-actions_no_exception_test (SEGFAULT)
Errors while running CTest
make: *** [Makefile:139: test] Error 8

@kloczek
Copy link
Author

kloczek commented Aug 6, 2021

Please let me know if ypu need back traces.

@magpie514
Copy link

Happened to me as well to build an unrelated project (googletest was a submodule). It did require adding "-Wno-error=maybe-uninitialized" to CXXFLAGS as well.
Since that project only required it to build I'm not aware if this caused any problems on the final executables.

@StefanBruens
Copy link

The default constructor leaves buffer_ uninitialized:

MatcherBase() : vtable_(nullptr) {}

This affects all copy, move and assignment constructors.

To silence the warning, it would be sufficient to assign a value to one of the union Buffer members.

Probably related: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80635

@StefanBruens
Copy link

On ARMv7 we also get reproducible testsuite errors:

[  405s] /home/abuild/rpmbuild/BUILD/googletest-release-1.11.0/googlemock/test/gmock-matchers_test.cc:6967: Failure
[  405s] Value of: Describe(m)
[  405s] Expected: contains regular expression "is an 'any' type with value of type '.*' and the value is equal to 1"
[  405s]   Actual: "is an 'any' type with value of type 'int' and the value is equal to 40481380"

The non-matching value is different on each run.

glandium added a commit to glandium/googletest that referenced this issue Apr 20, 2022
This fixes -Wuninitialized warnings with GCC.

Fixes google#3514.
glandium added a commit to glandium/googletest that referenced this issue Apr 20, 2022
This fixes -Wuninitialized warnings with GCC.

Fixes google#3514.
@kloczek
Copy link
Author

kloczek commented Apr 26, 2022

Tested and it works.
Thank you 😄

jjyao pushed a commit to ray-project/ray that referenced this issue Nov 3, 2022
While working on #28209 I hit issue google/googletest#3514, which causes a couple gtest-dependent tests to be unable to build

Signed-off-by: Pablo E <pabloem@apache.org>
NKcqx pushed a commit to NKcqx/ray that referenced this issue Nov 8, 2022
While working on ray-project#28209 I hit issue google/googletest#3514, which causes a couple gtest-dependent tests to be unable to build

Signed-off-by: Pablo E <pabloem@apache.org>
Signed-off-by: JasonChen <892670992@qq.com>
minerharry pushed a commit to minerharry/ray that referenced this issue Dec 6, 2022
…9164)" (ray-project#29… (ray-project#29196)

This reverts the PR and fixes the test failures

This also fixes a bug around _monitor_jobs API. the monitor job can be called on the same job twice now, which will break the event (because at the end of monitor job, we record the event that job is completed). The same completed event can be reported twice without the fix

upgrade gtest to 1.12.1 (ray-project#29902)

While working on ray-project#28209 I hit issue google/googletest#3514, which causes a couple gtest-dependent tests to be unable to build

Signed-off-by: Pablo E <pabloem@apache.org>
peytondmurray pushed a commit to peytondmurray/ray that referenced this issue Dec 16, 2022
While working on ray-project#28209 I hit issue google/googletest#3514, which causes a couple gtest-dependent tests to be unable to build

Signed-off-by: Pablo E <pabloem@apache.org>
WeichenXu123 pushed a commit to WeichenXu123/ray that referenced this issue Dec 19, 2022
While working on ray-project#28209 I hit issue google/googletest#3514, which causes a couple gtest-dependent tests to be unable to build

Signed-off-by: Pablo E <pabloem@apache.org>
Signed-off-by: Weichen Xu <weichen.xu@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants