google / googletest

GoogleTest - Google Testing and Mocking Framework
https://google.github.io/googletest/
BSD 3-Clause "New" or "Revised" License
34.96k stars 10.17k forks source link

GetThreadCountTest.ReturnsCorrectValue fails on risc-v64 #3756

Open StefanBruens opened 2 years ago

StefanBruens commented 2 years ago

Describe the bug

[ 7336s] [----------] 1 test from GetThreadCountTest
[ 7336s] [ RUN      ] GetThreadCountTest.ReturnsCorrectValue
[ 7336s] /home/abuild/rpmbuild/BUILD/googletest-release-1.11.0/googletest/test/googletest-port-test.cc:305: Failure
[ 7336s] Expected equality of these values:
[ 7336s]   starting_count + 1
[ 7336s]     Which is: 1
[ 7336s]   GetThreadCount()
[ 7336s]     Which is: 0
[ 7336s] [  FAILED  ] GetThreadCountTest.ReturnsCorrectValue (31 ms)
[ 7336s] [----------] 1 test from GetThreadCountTest (33 ms total)

Steps to reproduce the bug

/usr/bin/cmake /home/abuild/rpmbuild/BUILD/googletest-release-1.11.0/. '-GUnix Makefiles' -DCMAKE_INSTALL_PREFIX:PATH=/usr -DINCLUDE_INSTALL_DIR:PATH=/usr/include -DLIB_INSTALL_DIR:PATH=/usr/lib64 -DSYSCONF_INSTALL_DIR:PATH=/etc -DSHARE_INSTALL_PREFIX:PATH=/usr/share -DCMAKE_INSTALL_LIBDIR:PATH=lib64 -DCMAKE_INSTALL_LIBEXECDIR=/usr/libexec -DCMAKE_BUILD_TYPE=RelWithDebInfo '-DCMAKE_C_FLAGS=-O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -DNDEBUG' '-DCMAKE_CXX_FLAGS=-O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -DNDEBUG' '-DCMAKE_Fortran_FLAGS=-O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -DNDEBUG' '-DCMAKE_EXE_LINKER_FLAGS=-flto=auto -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now' '-DCMAKE_MODULE_LINKER_FLAGS=-flto=auto -Wl,--as-needed' '-DCMAKE_SHARED_LINKER_FLAGS=-flto=auto -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now' -DLIB_SUFFIX=64 -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_STATIC_LIBS:BOOL=OFF -DCMAKE_COLOR_MAKEFILE:BOOL=OFF -DCMAKE_INSTALL_DO_STRIP:BOOL=OFF -DCMAKE_MODULES_INSTALL_DIR=/usr/lib64/cmake/googletest -Dgtest_build_tests=ON -Dgmock_build_tests=ON

Does the bug persist in the most recent commit?

(unknown)

What operating system and version are you using?

openSUSE Tumbleweed 20220203

What compiler and version are you using?

gcc 11.2.1

What build system are you using?

cmake 3.22.2

Additional context

Kernel version 5.14.2

Maybe a kernel bug, see https://github.com/google/googletest/issues/949#issuecomment-266333662

https://build.opensuse.org/build/home:StefanBruens:branches:M17N/openSUSE_Factory_RISCV/riscv64/googletest/_log

derekmauro commented 2 years ago

We don't officially support risc-v64. Fortunately it looks like the only thing GetThreadCount() is used for is to warn that death tests should only be run in a single-threaded context.

https://github.com/google/googletest/blob/main/docs/advanced.md#death-tests-and-threads