Skip to content

Commit

Permalink
[yugabyte#13895] docdb: Switched to GoogleTest 1.12.1
Browse files Browse the repository at this point in the history
Summary:
BlockingQueueDeathTest.TestPointerParamsMustBeEmptyOnDestruct was failing under ASAN on Jenkins.
```
    Result: died but not with expected error.
  Expected: BlockingQueue holds bare pointers
Actual msg:
[  DEATH   ]
```

It turned out that `gtest-death-test_test` gtest's own unit-tests are also failing on Jenkins with the common failure pattern:
```
[  DEATH   ] AddressSanitizer:DEADLYSIGNAL
[  DEATH   ] =================================================================
[  DEATH   ] ==2262872==ERROR: AddressSanitizer: stack-overflow on address 0x7f823b324f80 (pc 0x7f823b2edc03 bp 0x7f823b325fb0 sp 0x7f823b324f80 T0)
[  DEATH   ]     #0 0x7f823b2edc03  (/lib64/ld-linux-x86-64.so.2+0x1c03)
[  DEATH   ]     #1 0x7f823a362684  (/nfusr/alma8-gcp-cloud/jenkins-worker-74vryc/jenkins/ty/yugabyte-db-thirdparty/build/asan/gmock-1.8.0/shared/googlemock/gtest/libgtest.so+0x134684)
[  DEATH   ]     #2 0x7f8239900dd2  (/lib64/libc.so.6+0x39dd2)
[  DEATH   ]
[  DEATH   ] SUMMARY: AddressSanitizer: stack-overflow (/lib64/ld-linux-x86-64.so.2+0x1c03)
[  DEATH   ] ==2262872==ABORTING
[  DEATH   ]
```

Which is related to https://chromium.googlesource.com/external/github.com/pwnall/googletest/+/681454dae48f109abf68c424c9d2e6db9a092238. With ASAN on x86_64, ExecDeathTestChildMain has frame size of 1728 bytes. Call to `chdir()` in `ExecDeathTestChildMain` ends up in `_dl_runtime_resolve_xsavec`, which attempts to save register state on the stack. And `XSAVE register save area size` is larger than 1728 bytes on Jenkins nodes:
```
$ cpuid -i | grep -i xsave
...
   XSAVE features (0xd/0):
      bytes required by XSAVE/XRSTOR area     = 0x00000a80 (2688)

$ cat /proc/cpuinfo
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 85
model name	: Intel(R) Xeon(R) CPU @ 2.80GHz
```

GoogleTest 1.11.0 has a fix for this issue: google/googletest@681454d.
Decided to upgrade to latest GoogleTest 1.12.0 that also contains the fix.

Test Plan: - Jenkins

Reviewers: esheng, jhe, mbautin

Reviewed By: esheng, jhe, mbautin

Subscribers: bogdan, ybase

Differential Revision: https://phabricator.dev.yugabyte.com/D19390
  • Loading branch information
ttyusupov committed Sep 22, 2022
1 parent 6a7acd4 commit 8cce925
Show file tree
Hide file tree
Showing 14 changed files with 97 additions and 81 deletions.
122 changes: 61 additions & 61 deletions build-support/thirdparty_archives.yml
Original file line number Diff line number Diff line change
@@ -1,212 +1,212 @@
sha_for_local_checkout: ded72a9921d08cdd9f802dbe3c9a0069da7402f0
sha_for_local_checkout: 7f25c9789abad31b4c22c7395879209cfb83d694
archives:
- os_type: almalinux8
architecture: aarch64
compiler_type: clang12
is_linuxbrew: false
sha: ded72a9921d08cdd9f802dbe3c9a0069da7402f0
sha: 7f25c9789abad31b4c22c7395879209cfb83d694
lto_type:
tag: v20220913150632-ded72a9921-almalinux8-aarch64-clang12
tag: v20220920000517-7f25c9789a-almalinux8-aarch64-clang12
- os_type: almalinux8
architecture: aarch64
compiler_type: clang12
is_linuxbrew: false
sha: ded72a9921d08cdd9f802dbe3c9a0069da7402f0
sha: 7f25c9789abad31b4c22c7395879209cfb83d694
lto_type: full
tag: v20220913150547-ded72a9921-almalinux8-aarch64-clang12-full-lto
tag: v20220920000516-7f25c9789a-almalinux8-aarch64-clang12-full-lto
- os_type: almalinux8
architecture: x86_64
compiler_type: clang12
is_linuxbrew: false
sha: ded72a9921d08cdd9f802dbe3c9a0069da7402f0
sha: 89d2bc5aa9fb17f33bb7a1b718a4df138ad1c3cf
lto_type:
tag: v20220913150508-ded72a9921-almalinux8-x86_64-clang12
tag: v20220920000443-7f25c9789a-almalinux8-x86_64-clang12
- os_type: almalinux8
architecture: x86_64
compiler_type: clang12
is_linuxbrew: true
sha: ded72a9921d08cdd9f802dbe3c9a0069da7402f0
sha: 7f25c9789abad31b4c22c7395879209cfb83d694
lto_type:
tag: v20220913150545-ded72a9921-almalinux8-x86_64-clang12-linuxbrew
tag: v20220920000440-7f25c9789a-almalinux8-x86_64-clang12-linuxbrew
- os_type: almalinux8
architecture: x86_64
compiler_type: clang13
is_linuxbrew: false
sha: ded72a9921d08cdd9f802dbe3c9a0069da7402f0
sha: 7f25c9789abad31b4c22c7395879209cfb83d694
lto_type:
tag: v20220913150515-ded72a9921-almalinux8-x86_64-clang13
tag: v20220920000458-7f25c9789a-almalinux8-x86_64-clang13
- os_type: almalinux8
architecture: x86_64
compiler_type: clang13
is_linuxbrew: false
sha: ded72a9921d08cdd9f802dbe3c9a0069da7402f0
sha: 7f25c9789abad31b4c22c7395879209cfb83d694
lto_type: full
tag: v20220913150535-ded72a9921-almalinux8-x86_64-clang13-full-lto
tag: v20220920000441-7f25c9789a-almalinux8-x86_64-clang13-full-lto
- os_type: almalinux8
architecture: x86_64
compiler_type: clang13
is_linuxbrew: true
sha: ded72a9921d08cdd9f802dbe3c9a0069da7402f0
sha: 7f25c9789abad31b4c22c7395879209cfb83d694
lto_type:
tag: v20220913150511-ded72a9921-almalinux8-x86_64-clang13-linuxbrew
tag: v20220920000437-7f25c9789a-almalinux8-x86_64-clang13-linuxbrew
- os_type: almalinux8
architecture: x86_64
compiler_type: clang13
is_linuxbrew: true
sha: ded72a9921d08cdd9f802dbe3c9a0069da7402f0
sha: 7f25c9789abad31b4c22c7395879209cfb83d694
lto_type: full
tag: v20220913150519-ded72a9921-almalinux8-x86_64-clang13-linuxbrew-full-lto
tag: v20220920000517-7f25c9789a-almalinux8-x86_64-clang13-linuxbrew-full-lto
- os_type: almalinux8
architecture: x86_64
compiler_type: clang14
is_linuxbrew: false
sha: ded72a9921d08cdd9f802dbe3c9a0069da7402f0
sha: 7f25c9789abad31b4c22c7395879209cfb83d694
lto_type:
tag: v20220913150532-ded72a9921-almalinux8-x86_64-clang14
tag: v20220920000524-7f25c9789a-almalinux8-x86_64-clang14
- os_type: almalinux8
architecture: x86_64
compiler_type: clang14
is_linuxbrew: false
sha: ded72a9921d08cdd9f802dbe3c9a0069da7402f0
sha: 7f25c9789abad31b4c22c7395879209cfb83d694
lto_type: full
tag: v20220913150515-ded72a9921-almalinux8-x86_64-clang14-full-lto
tag: v20220920000520-7f25c9789a-almalinux8-x86_64-clang14-full-lto
- os_type: almalinux8
architecture: x86_64
compiler_type: clang14
is_linuxbrew: true
sha: ded72a9921d08cdd9f802dbe3c9a0069da7402f0
sha: 7f25c9789abad31b4c22c7395879209cfb83d694
lto_type:
tag: v20220913150511-ded72a9921-almalinux8-x86_64-clang14-linuxbrew
tag: v20220920000508-7f25c9789a-almalinux8-x86_64-clang14-linuxbrew
- os_type: almalinux8
architecture: x86_64
compiler_type: clang14
is_linuxbrew: true
sha: ded72a9921d08cdd9f802dbe3c9a0069da7402f0
sha: 7f25c9789abad31b4c22c7395879209cfb83d694
lto_type: full
tag: v20220913150523-ded72a9921-almalinux8-x86_64-clang14-linuxbrew-full-lto
tag: v20220920000440-7f25c9789a-almalinux8-x86_64-clang14-linuxbrew-full-lto
- os_type: almalinux8
architecture: x86_64
compiler_type: gcc11
is_linuxbrew: false
sha: ded72a9921d08cdd9f802dbe3c9a0069da7402f0
sha: 7f25c9789abad31b4c22c7395879209cfb83d694
lto_type:
tag: v20220913150541-ded72a9921-almalinux8-x86_64-gcc11
tag: v20220920000527-7f25c9789a-almalinux8-x86_64-gcc11
- os_type: centos7
architecture: x86_64
compiler_type: clang12
is_linuxbrew: false
sha: ded72a9921d08cdd9f802dbe3c9a0069da7402f0
sha: 7f25c9789abad31b4c22c7395879209cfb83d694
lto_type:
tag: v20220913150533-ded72a9921-centos7-x86_64-clang12
tag: v20220920000632-7f25c9789a-centos7-x86_64-clang12
- os_type: centos7
architecture: x86_64
compiler_type: clang13
is_linuxbrew: false
sha: ded72a9921d08cdd9f802dbe3c9a0069da7402f0
sha: 7f25c9789abad31b4c22c7395879209cfb83d694
lto_type:
tag: v20220913150546-ded72a9921-centos7-x86_64-clang13
tag: v20220920000458-7f25c9789a-centos7-x86_64-clang13
- os_type: centos7
architecture: x86_64
compiler_type: clang13
is_linuxbrew: false
sha: ded72a9921d08cdd9f802dbe3c9a0069da7402f0
sha: 7f25c9789abad31b4c22c7395879209cfb83d694
lto_type: full
tag: v20220913150620-ded72a9921-centos7-x86_64-clang13-full-lto
tag: v20220920000543-7f25c9789a-centos7-x86_64-clang13-full-lto
- os_type: centos7
architecture: x86_64
compiler_type: clang14
is_linuxbrew: false
sha: ded72a9921d08cdd9f802dbe3c9a0069da7402f0
sha: 7f25c9789abad31b4c22c7395879209cfb83d694
lto_type:
tag: v20220913150608-ded72a9921-centos7-x86_64-clang14
tag: v20220920000530-7f25c9789a-centos7-x86_64-clang14
- os_type: centos7
architecture: x86_64
compiler_type: clang14
is_linuxbrew: false
sha: ded72a9921d08cdd9f802dbe3c9a0069da7402f0
sha: 7f25c9789abad31b4c22c7395879209cfb83d694
lto_type: full
tag: v20220913150523-ded72a9921-centos7-x86_64-clang14-full-lto
tag: v20220920000543-7f25c9789a-centos7-x86_64-clang14-full-lto
- os_type: centos7
architecture: x86_64
compiler_type: gcc11
is_linuxbrew: false
sha: ded72a9921d08cdd9f802dbe3c9a0069da7402f0
sha: 7f25c9789abad31b4c22c7395879209cfb83d694
lto_type:
tag: v20220913150611-ded72a9921-centos7-x86_64-gcc11
tag: v20220920000610-7f25c9789a-centos7-x86_64-gcc11
- os_type: macos
architecture: arm64
compiler_type: clang
is_linuxbrew: false
sha: ded72a9921d08cdd9f802dbe3c9a0069da7402f0
sha: 7f25c9789abad31b4c22c7395879209cfb83d694
lto_type:
tag: v20220915100628-ded72a9921-macos-arm64
tag: v20220921072723-7f25c9789a-macos-arm64
- os_type: macos
architecture: x86_64
compiler_type: clang
is_linuxbrew: false
sha: ded72a9921d08cdd9f802dbe3c9a0069da7402f0
sha: 7f25c9789abad31b4c22c7395879209cfb83d694
lto_type:
tag: v20220913150512-ded72a9921-macos-x86_64
tag: v20220920000444-7f25c9789a-macos-x86_64
- os_type: ubuntu20.04
architecture: aarch64
compiler_type: clang12
is_linuxbrew: false
sha: ded72a9921d08cdd9f802dbe3c9a0069da7402f0
sha: 7f25c9789abad31b4c22c7395879209cfb83d694
lto_type:
tag: v20220913150559-ded72a9921-ubuntu2004-aarch64-clang12
tag: v20220920000448-7f25c9789a-ubuntu2004-aarch64-clang12
- os_type: ubuntu20.04
architecture: aarch64
compiler_type: clang12
is_linuxbrew: false
sha: ded72a9921d08cdd9f802dbe3c9a0069da7402f0
sha: 7f25c9789abad31b4c22c7395879209cfb83d694
lto_type: full
tag: v20220913150536-ded72a9921-ubuntu2004-aarch64-clang12-full-lto
tag: v20220920000453-7f25c9789a-ubuntu2004-aarch64-clang12-full-lto
- os_type: ubuntu20.04
architecture: x86_64
compiler_type: clang12
is_linuxbrew: false
sha: ded72a9921d08cdd9f802dbe3c9a0069da7402f0
sha: 7f25c9789abad31b4c22c7395879209cfb83d694
lto_type:
tag: v20220913150506-ded72a9921-ubuntu2004-x86_64-clang12
tag: v20220920000446-7f25c9789a-ubuntu2004-x86_64-clang12
- os_type: ubuntu20.04
architecture: x86_64
compiler_type: clang13
is_linuxbrew: false
sha: ded72a9921d08cdd9f802dbe3c9a0069da7402f0
sha: 7f25c9789abad31b4c22c7395879209cfb83d694
lto_type:
tag: v20220913150509-ded72a9921-ubuntu2004-x86_64-clang13
tag: v20220920000421-7f25c9789a-ubuntu2004-x86_64-clang13
- os_type: ubuntu20.04
architecture: x86_64
compiler_type: clang14
is_linuxbrew: false
sha: ded72a9921d08cdd9f802dbe3c9a0069da7402f0
sha: 7f25c9789abad31b4c22c7395879209cfb83d694
lto_type:
tag: v20220913150511-ded72a9921-ubuntu2004-x86_64-clang14
tag: v20220920000430-7f25c9789a-ubuntu2004-x86_64-clang14
- os_type: ubuntu22.04
architecture: x86_64
compiler_type: clang12
is_linuxbrew: false
sha: ded72a9921d08cdd9f802dbe3c9a0069da7402f0
sha: 7f25c9789abad31b4c22c7395879209cfb83d694
lto_type:
tag: v20220913150503-ded72a9921-ubuntu2204-x86_64-clang12
tag: v20220920000446-7f25c9789a-ubuntu2004-x86_64-clang12
- os_type: ubuntu22.04
architecture: x86_64
compiler_type: clang13
is_linuxbrew: false
sha: ded72a9921d08cdd9f802dbe3c9a0069da7402f0
sha: 7f25c9789abad31b4c22c7395879209cfb83d694
lto_type:
tag: v20220913150505-ded72a9921-ubuntu2204-x86_64-clang13
tag: v20220920000454-7f25c9789a-ubuntu2204-x86_64-clang13
- os_type: ubuntu22.04
architecture: x86_64
compiler_type: clang14
is_linuxbrew: false
sha: ded72a9921d08cdd9f802dbe3c9a0069da7402f0
sha: 7f25c9789abad31b4c22c7395879209cfb83d694
lto_type:
tag: v20220913150502-ded72a9921-ubuntu2204-x86_64-clang14
tag: v20220920000436-7f25c9789a-ubuntu2204-x86_64-clang14
- os_type: ubuntu22.04
architecture: x86_64
compiler_type: gcc11
is_linuxbrew: false
sha: ded72a9921d08cdd9f802dbe3c9a0069da7402f0
sha: 7f25c9789abad31b4c22c7395879209cfb83d694
lto_type:
tag: v20220913150504-ded72a9921-ubuntu2204-x86_64-gcc11
tag: v20220920000436-7f25c9789a-ubuntu2204-x86_64-gcc11
19 changes: 14 additions & 5 deletions cmake_modules/FindGMock.cmake → cmake_modules/FindGTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
#
# Author: Konstantin Lepa <konstantin.lepa@gmail.com>
#
# Find the Google Mock Framework, heavily cribbed from FindGTest.cmake.
# gmock ships a copy of gtest and bundles it in its libraries, so this also
# finds the gtest headers.
# Find the Google Test Framework, heavily cribbed from FindGTest.cmake.
#
# This module defines
# GMOCK_INCLUDE_DIR, where to find gmock include files, etc.
Expand Down Expand Up @@ -66,7 +64,18 @@ find_library(GMOCK_STATIC_LIBRARY libgmock.a
NO_CMAKE_SYSTEM_PATH
NO_SYSTEM_ENVIRONMENT_PATH)

find_library(GTEST_SHARED_LIBRARY gtest
DOC "Google's framework for writing C++ tests (gtest)"
NO_CMAKE_SYSTEM_PATH
NO_SYSTEM_ENVIRONMENT_PATH)

find_library(GTEST_STATIC_LIBRARY libgtest.a
DOC "Google's framework for writing C++ tests (gtest) static"
NO_CMAKE_SYSTEM_PATH
NO_SYSTEM_ENVIRONMENT_PATH)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GMOCK REQUIRED_VARS
GMOCK_SHARED_LIBRARY GMOCK_STATIC_LIBRARY GMOCK_INCLUDE_DIR GTEST_INCLUDE_DIR)
find_package_handle_standard_args(GTEST REQUIRED_VARS
GTEST_SHARED_LIBRARY GTEST_STATIC_LIBRARY
GMOCK_SHARED_LIBRARY GMOCK_STATIC_LIBRARY
GMOCK_INCLUDE_DIR GTEST_INCLUDE_DIR)
9 changes: 6 additions & 3 deletions cmake_modules/YugabyteFindThirdParty.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,15 @@ ADD_THIRDPARTY_LIB(gflags
SHARED_LIB "${GFLAGS_SHARED_LIB}")
list(APPEND YB_BASE_LIBS gflags)

## GMock
find_package(GMock REQUIRED)
include_directories(SYSTEM ${GMOCK_INCLUDE_DIR} ${GTEST_INCLUDE_DIR})
## GTest
find_package(GTest REQUIRED)
include_directories(SYSTEM ${GTEST_INCLUDE_DIR})
ADD_THIRDPARTY_LIB(gmock
STATIC_LIB ${GMOCK_STATIC_LIBRARY}
SHARED_LIB ${GMOCK_SHARED_LIBRARY})
ADD_THIRDPARTY_LIB(gtest
STATIC_LIB ${GTEST_STATIC_LIBRARY}
SHARED_LIB ${GTEST_SHARED_LIBRARY})

## Protobuf
add_custom_target(gen_proto)
Expand Down
2 changes: 2 additions & 0 deletions ent/src/yb/integration-tests/cdc_service-int-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1784,6 +1784,8 @@ class CDCServiceTestMinSpace : public CDCServiceTest {
}
};

INSTANTIATE_TEST_CASE_P(EnableReplicateIntents, CDCServiceTestMinSpace, ::testing::Bool());

TEST_P(CDCServiceTestMinSpace, TestLogRetentionByOpId_MinSpace) {
CreateCDCStream(cdc_proxy_, table_.table()->id(), &stream_id_);

Expand Down
2 changes: 1 addition & 1 deletion src/yb/client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ endif()
# and therefore don't need to worry about export strictness)
ADD_YB_LIBRARY(yb_client_test_util
SRCS client-test-util.cc
DEPS gmock yb_client)
DEPS gmock gtest yb_client)

ADD_YB_LIBRARY(ql-dml-test-base
SRCS ql-dml-test-base.cc txn-test-base.cc snapshot_test_util.cc
Expand Down
1 change: 1 addition & 0 deletions src/yb/client/ql-tablet-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <thread>

#include <boost/optional/optional.hpp>
#include <boost/optional/optional_io.hpp>

#include "yb/client/client-test-util.h"
#include "yb/client/error.h"
Expand Down
2 changes: 1 addition & 1 deletion src/yb/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#

set(YB_PCH_PREFIX common)
set(YB_PCH_DEP_LIBS gmock gutil opid_proto yb_test_util yb_util)
set(YB_PCH_DEP_LIBS gmock gtest gutil opid_proto yb_test_util yb_util)

YRPC_GENERATE(
COMMON_PROTO_SRCS COMMON_PROTO_HDRS COMMON_PROTO_TGTS
Expand Down
2 changes: 1 addition & 1 deletion src/yb/fs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# under the License.

set(YB_PCH_PREFIX fs)
set(YB_PCH_DEP_LIBS gmock gutil yb_test_util yb_util)
set(YB_PCH_DEP_LIBS gmock gtest gutil yb_test_util yb_util)

PROTOBUF_GENERATE_CPP(
FS_PROTO_SRCS FS_PROTO_HDRS FS_PROTO_TGTS
Expand Down
2 changes: 1 addition & 1 deletion src/yb/gutil/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
add_library(gutil_c STATIC dynamic_annotations.c utf/rune.c)

set(YB_PCH_PREFIX gutil)
set(YB_PCH_DEP_LIBS gmock)
set(YB_PCH_DEP_LIBS gmock gtest)

set(GUTIL_SRCS
bits.cc
Expand Down
2 changes: 1 addition & 1 deletion src/yb/master/sys_catalog-test_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ std::pair<std::string, std::string> AssertMetadataEqualsHelper(C* ti_a, C* ti_b)
#define ASSERT_METADATA_EQ(a, b) do { \
auto string_reps = AssertMetadataEqualsHelper((a), (b)); \
GTEST_ASSERT_( \
::testing::internal::EqHelper<GTEST_IS_NULL_LITERAL_(a)>::Compare \
::testing::internal::EqHelper::Compare \
(#a, #b, string_reps.first, string_reps.second), \
GTEST_FATAL_FAILURE_); \
} while (false)
Expand Down
2 changes: 1 addition & 1 deletion src/yb/rocksdb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ if (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "RELEASE")
endif()

add_library(rocksdb_test_util ${ROCKSDB_TEST_UTIL_SRCS})
target_link_libraries(rocksdb_test_util gmock rocksdb yb_rocksutil)
target_link_libraries(rocksdb_test_util gmock gtest rocksdb yb_rocksutil)

add_executable(db_bench tools/db_bench.cc tools/db_bench_tool.cc)
target_link_libraries(db_bench rocksdb)
Expand Down
Loading

0 comments on commit 8cce925

Please sign in to comment.