samedi 29 août 2015

Strange Segfault on Ubuntu 15.04

I'm in a Comp Sci class and my teacher uses a testing framework to grade our homeworks. I can build my assignments, but when I attempt to run, I get a segmentation fault. In LLDB, I get this backtrace:

* thread #1: tid = 11993, 0x00007ffff796e990 libstdc++.so.6`std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string(), name = 'cpp_refresher', stop reason = invalid address (fault address: 0x10)
  * frame #0: 0x00007ffff796e990 libstdc++.so.6`std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()
    frame #1: 0x000000000042229c cpp_refresher`MemoryAllocation::~MemoryAllocation() + 28
    frame #2: 0x0000000000422555 cpp_refresher`void std::_Destroy<MemoryAllocation>(MemoryAllocation*) + 21
    frame #3: 0x000000000042251f cpp_refresher`void std::_Destroy_aux<false>::__destroy<MemoryAllocation*>(MemoryAllocation*, MemoryAllocation*) + 47
    frame #4: 0x00000000004224dd cpp_refresher`void std::_Destroy<MemoryAllocation*>(MemoryAllocation*, MemoryAllocation*) + 29
    frame #5: 0x0000000000422321 cpp_refresher`void std::_Destroy<MemoryAllocation*, MemoryAllocation>(MemoryAllocation*, MemoryAllocation*, std::allocator<MemoryAllocation>&) + 33
    frame #6: 0x0000000000421847 cpp_refresher`std::vector<MemoryAllocation, std::allocator<MemoryAllocation> >::~vector() + 55
    frame #7: 0x00000000004217a5 cpp_refresher`UTTest::~UTTest() + 37
    frame #8: 0x0000000000422f49 cpp_refresher`UTTestRunner::RunSuite(std::string, std::function<void (UTTestRunner*)>) + 249
    frame #9: 0x000000000041e716 cpp_refresher`main + 118
    frame #10: 0x00007ffff6fe4a40 libc.so.6`__libc_start_main + 240
    frame #11: 0x000000000041bc09 cpp_refresher`_start + 41

Based on this, I think that the testing framework is causing the standard C++ libraries to segfault when it attempts to destroy a string. The interesting this is that this only occurs on Ubuntu 15.04. I can run this script on Ubuntu 14.04 and it runs perfectly.

Any ideas why this is happening only in Ubuntu 15.04?

Aucun commentaire:

Enregistrer un commentaire