Skip to content
This repository has been archived by the owner on Oct 5, 2023. It is now read-only.

cpp unit tests crash on Serialization.Simple #66

Open
jbeich opened this issue Jan 12, 2017 · 0 comments
Open

cpp unit tests crash on Serialization.Simple #66

jbeich opened this issue Jan 12, 2017 · 0 comments

Comments

@jbeich
Copy link

jbeich commented Jan 12, 2017

$ pkg info -x icu 'g.*test'
icu-58.2,1
googletest-1.8.0.11

$ c++ -v
FreeBSD clang version 4.0.0 (trunk 291476) (based on LLVM 4.0.0svn)
Target: x86_64-unknown-freebsd12.0
Thread model: posix
InstalledDir: /usr/bin
Found CUDA installation: /usr/local/cuda, version 7.5

$ cmake /path/to/sfntly/cpp
$ gmake
$ lldb ./bin/unit_test
(lldb) r
Process 50032 launching
Process 50032 launched: 'objdir/bin/unit_test' (x86_64)
Running main() from gtest_main.cc
[==========] Running 177 tests from 20 test cases.
[----------] Global test environment set-up.
[----------] 1 test from TestUtils
[ RUN      ] TestUtils.All
[       OK ] TestUtils.All (0 ms)
[----------] 1 test from TestUtils (0 ms total)

[----------] 1 test from SmartPointer
[ RUN      ] SmartPointer.All
[       OK ] SmartPointer.All (0 ms)
[----------] 1 test from SmartPointer (0 ms total)

[----------] 2 tests from Serialization
[ RUN      ] Serialization.Simple
Process 50032 stopped
* thread #1, stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
    frame #0: unit_test`sfntly::TestSerialization(void) at serialization_test.cc:70
   67     for (size_t i = 0; i < SAMPLE_TTF_KNOWN_TAGS; ++i) {
   68         TablePtr original_table = original->GetTable(TTF_KNOWN_TAGS[i]);
   69         TablePtr serialized_table = serialized->GetTable(TTF_KNOWN_TAGS[i]);
-> 70       EXPECT_EQ(original_table->CalculatedChecksum(),
   71                 serialized_table->CalculatedChecksum());
   72       EXPECT_EQ(original_table->DataLength(), serialized_table->DataLength());
   73

(lldb) bt
* thread #1, stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
  * frame #0: unit_test`sfntly::TestSerialization(void) at serialization_test.cc:70
    frame #1: unit_test`Serialization_Simple_Test::TestBody(this=0x000000080282f9f0) at serialization_test.cc:146
    frame #2: libgtest.so.0`void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(object=0x000000080282f9f0, method=21 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00, location="the test body")(void), char const*) at gtest.cc:2402
    frame #3: libgtest.so.0`void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(object=0x000000080282f9f0, method=21 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00, location="the test body")(void), char const*) at gtest.cc:2438
    frame #4: libgtest.so.0`testing::Test::Run(this=0x000000080282f9f0) at gtest.cc:2474
    frame #5: libgtest.so.0`testing::TestInfo::Run(this=0x0000000802838380) at gtest.cc:2656
    frame #6: libgtest.so.0`testing::TestCase::Run(this=0x0000000802838460) at gtest.cc:2774
    frame #7: libgtest.so.0`testing::internal::UnitTestImpl::RunAllTests(this=0x0000000802828000) at gtest.cc:4649
    frame #8: libgtest.so.0`bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(object=0x0000000802828000, method=e0 e4 e8 00 08 00 00 00 00 00 00 00 00 00 00 00, location="auxiliary test code (environments or event listeners)")(void), char const*) at gtest.cc:2402
    frame #9: libgtest.so.0`bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(object=0x0000000802828000, method=e0 e4 e8 00 08 00 00 00 00 00 00 00 00 00 00 00, location="auxiliary test code (environments or event listeners)")(void), char const*) at gtest.cc:2438
    frame #10: libgtest.so.0`testing::UnitTest::Run(this=0x0000000801102b08) at gtest.cc:4257
    frame #11: libgtest_main.so.0`RUN_ALL_TESTS(void) at gtest.h:2233
    frame #12: libgtest_main.so.0`main(argc=1, argv=0x00007fffffffe480) at gtest_main.cc:37
    frame #13: unit_test`_start(ap=<unavailable>, cleanup=<unavailable>) at crt1.c:72

(lldb) p original_table
(sfntly::TablePtr) $0 = {
  p_ = 0x0000000000000000
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant