https://bugs.documentfoundation.org/show_bug.cgi?id=114843
Bug ID: 114843
Summary: Test runner crashes on exit when executing a
CppUnit::TestCase
Product: cppunit
Version: 1.13
Hardware: x86 (IA32)
OS: Linux (All)
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: General
Assignee: [email protected]
Reporter: [email protected]
Hello,
I am using libcppunit-dev version 1.13.2-2.1 on Ubuntu 16.04 Linux, 32 bit.
When running a CppUnit::TestCase, the application which runs the test crashes
on exit. Creating a very simple test runner:
#include <cstdlib>
#include <iostream>
#include <cppunit/ui/text/TextTestRunner.h>
#include <cppunit/TestResult.h>
#include <cppunit/TextOutputter.h>
#include <cppunit/TestResultCollector.h>
#include "SampleTestCase.h"
int main(int, char**)
{
SampleTestCase testCase("My test");
CppUnit::TestResultCollector collector;
CppUnit::TextOutputter outputter(&collector, std::cout);
CppUnit::TestResult testResult;
CppUnit::TextTestRunner runner;
std::cout << testCase.getName() << std::endl;
runner.addTest(&testCase);
return (runner.run() ? EXIT_SUCCESS : EXIT_FAILURE);
}
where SampleTestCase is a very simple class which always succeededs:
#include <cppunit/TestCase.h>
class SampleTestCase : public CppUnit::TestCase
{
public:
explicit SampleTestCase(const std::string& testName);
SampleTestCase(const SampleTestCase& src) = delete;
virtual ~SampleTestCase();
void runTest();
};
When running, a crash occurs eventually on destructing this test case:
My test
.
OK (1 tests)
=================================================================
==4128==ERROR: AddressSanitizer: new-delete-type-mismatch on 0xbfd58200 in
thread T0:
object passed to delete has wrong type:
size of the allocated type: 0 bytes;
size of the deallocated type: 32 bytes.
#0 0xb72158e4 in operator delete(void*, unsigned int)
(/usr/lib/i386-linux-gnu/libasan.so.2+0x988e4)
#1 0x8049ef4 in SampleTestCase::~SampleTestCase()
/home/sander/NetBeansProjects/Pilot/SampleTestCase.cc:38
#2 0xb7167b99 in CppUnit::TestSuite::deleteContents()
(/usr/lib/i386-linux-gnu/libcppunit-1.13.so.0+0x25b99)
#3 0xb7167be7 in CppUnit::TestSuite::~TestSuite()
(/usr/lib/i386-linux-gnu/libcppunit-1.13.so.0+0x25be7)
#4 0xb7167824 in CppUnit::TestRunner::WrappingSuite::~WrappingSuite()
(/usr/lib/i386-linux-gnu/libcppunit-1.13.so.0+0x25824)
#5 0xb71672ac in CppUnit::TestRunner::~TestRunner()
(/usr/lib/i386-linux-gnu/libcppunit-1.13.so.0+0x252ac)
#6 0xb7169593 in CppUnit::TextTestRunner::~TextTestRunner()
(/usr/lib/i386-linux-gnu/libcppunit-1.13.so.0+0x27593)
#7 0x804b32f in main /home/sander/NetBeansProjects/Pilot/main.cpp:19
#8 0xb6962636 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18636)
#9 0x8049a30
(/home/sander/NetBeansProjects/Pilot/dist/Debug/GNU-Linux/pilot+0x8049a30)
AddressSanitizer can not describe address in more detail (wild memory access
suspected).
SUMMARY: AddressSanitizer: new-delete-type-mismatch ??:0 operator delete(void*,
unsigned int)
==4128==HINT: if you don't care about these warnings you may set
ASAN_OPTIONS=new_delete_type_mismatch=0
==4128==ABORTING
--
You are receiving this mail because:
You are the assignee for the bug._______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs