小编Eri*_*ton的帖子

主gtest之前的c ++ segfault

我在main之前得到了一个堆栈跟踪:

#include <gtest/gtest.h>

using namespace std;

int main(int argc, char **argv) {
  ::testing::InitGoogleTest(&argc, argv);
  return RUN_ALL_TESTS();
}
Run Code Online (Sandbox Code Playgroud)

堆栈跟踪:

程序收到信号SIGSEGV,分段故障。0x0000000000000000 in ?? ()

#0  0x0000000000000000 in ?? ()
#1  0x00000000004e0b51 in std::locale::_S_initialize() ()
#2  0x00000000004e0b93 in std::locale::locale() ()
#3  0x000000000050d524 in std::ios_base::Init::Init() ()
#4  0x0000000000401581 in __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535) at /usr/include/c++/4.9/iostream:74
#5  0x00000000004015b3 in _GLOBAL__sub_I_testsmain.cpp(void) () at ../../../bdf_cpp_tests/testsmain.cpp:18
#6  0x000000000053cdd7 in __libc_csu_init ()
#7  0x000000000053c3de in generic_start_main ()
#8  0x000000000053c62a in __libc_start_main ()
#9  0x00000000004013f9 in _start ()
Run Code Online (Sandbox Code Playgroud)

这是qmake 5.7和g ++ …

c++ googletest

4
推荐指数
1
解决办法
735
查看次数

标签 统计

c++ ×1

googletest ×1