I've made a small test file that will let me reproduce the problem. Here is the code:
#ifndef UNIT_TESTING
#define UNIT_TESTING
#endif
#include "gtest/gtest.h"
class FooTest:public ::testing::TestWithParam<uint32_t>
{
};
INSTANTIATE_TEST_CASE_P(CharTypes, FooTest, ::testing::Range(1u, 3u));
TEST_P(FooTest, DoesBlah)
{
EXPECT_EQ(GetParam(), GetParam());
}
I don't have any variables, no statics, but it seg faults on exit. I'm not very experienced at debugging on Linux, but I rebuilt the test with symbols and loaded it up in ddd. I run through and see the following at the end:
Program received signal SIGSEGV, Segmentation fault.
0x08171f33 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string() ()
(gdb) break /opt/builds/b20d41c8bd14fb14/UnitTests/tests/perception/3DLaser/Linux/EncoderTests.cpp:8
Breakpoint 1 at 0x80b53c2: file /opt/builds/b20d41c8bd14fb14/UnitTests/tests/perception/3DLaser/Linux/EncoderTests.cpp, line 8.
The backtrace looks like this:
#0 0x08171f33 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string() ()
#1 0x081322c5 in void std::_Destroy<std::string>(std::string*) () at /usr/include/c++/4.8/bits/stl_construct.h:93
#2 0x0812ed88 in void std::_Destroy_aux<false>::__destroy<std::string*>(std::string*, std::string*) () at /usr/include/c++/4.8/bits/stl_construct.h:103
#3 0x08128843 in void std::_Destroy<std::string*>(std::string*, std::string*) () at /usr/include/c++/4.8/bits/stl_construct.h:126
#4 0x08120952 in void std::_Destroy<std::string*, std::string>(std::string*, std::string*, std::allocator<std::string>&) () at /usr/include/c++/4.8/bits/stl_construct.h:151
#5 0x08114712 in std::vector<std::string, std::allocator<std::string> >::~vector() () at /usr/include/c++/4.8/bits/stl_vector.h:415
#6 0xb7e52f51 in ?? () from /lib/i386-linux-gnu/libc.so.6
#7 0xb7e52fdd in exit () from /lib/i386-linux-gnu/libc.so.6
#8 0xb7e394db in __libc_start_main () from /lib/i386-linux-gnu/libc.so.6
#9 0x080b52d5 in _start ()
I trace through and can see it return from RUN_ALL_TESTS() with no problems that I can see. Any tips or pointers of where I might look to progress?