problem with a unittest

Boudewijn Rempt boud at valdyas.org
Thu Sep 8 15:26:03 BST 2011


On Thursday 08 September 2011 Sep, Cyrille Berger Skott wrote:
> On Thursday 08 September 2011, Boudewijn Rempt wrote:
> > . I tried running it under gdb and got this:
> And did you try with valgrind ?

Yes -- and the output is quite weird:


boud at talnus:~/kde/build/calligra/words/part/tests> valgrind ./TestKoBookmark
==30852== Memcheck, a memory error detector
==30852== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==30852== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info
==30852== Command: ./TestKoBookmark
==30852== 
KGlobal::locale::Warning your global KLocale is being recreated with a valid main component instead of a fake component, this usually means you tried to call i18n related functions before your main component was created. You should not do that since it most likely will not work 
********* Start testing of TestKoBookmark *********
Config: Using QTest library 4.7.4, Qt 4.7.4
PASS   : TestKoBookmark::initTestCase()
PASS   : TestKoBookmark::testInsertion()
QDEBUG : TestKoBookmark::testRoundtrip() (Soprano::Redland::BackendPlugin) creating model of type "hashes" with options "hash-type='memory',contexts='yes'" 
QDEBUG : TestKoBookmark::testRoundtrip() qttest(30852)/kotext TextShapeFactory::newDocumentResourceManager: No KUndo2Stack found in the document resource manager, creating a new one 
QDEBUG : TestKoBookmark::testRoundtrip() (Soprano::Redland::BackendPlugin) creating model of type "hashes" with options "hash-type='memory',contexts='yes'" 
QDEBUG : TestKoBookmark::testRoundtrip() qttest(30852)/kotext TextShapeFactory::newDocumentResourceManager: No KUndo2Stack found in the document resource manager, creating a new one 
QSYSTEM: TestKoBookmark::testRoundtrip() qttest(30852): Cannot open  "/tmp/kde-boud/qttestRk2zYl/Europe/Berlin" 

QSYSTEM: TestKoBookmark::testRoundtrip() qttest(30852): Cannot open  "/tmp/kde-boud/qttestRk2zYl/Europe/Berlin" 

PASS   : TestKoBookmark::testRoundtrip()
PASS   : TestKoBookmark::cleanupTestCase()
Totals: 4 passed, 0 failed, 0 skipped
********* Finished testing of TestKoBookmark *********
==30852== Jump to the invalid address stated on the next line
==30852==    at 0x0: ???
==30852==    by 0xA62E3B2: QObject::~QObject() (qobject.cpp:861)
==30852==    by 0xA62E9A8: QObject::~QObject() (qobject.cpp:964)
==30852==    by 0xAB9E93F: QDBusAbstractInterfacePrivate::~QDBusAbstractInterfacePrivate() (qdbusabstractinterface_p.h:87)
==30852==    by 0xA62E7F2: QObject::~QObject() (qscopedpointer.h:62)
==30852==    by 0xAB80BC8: QDBusConnectionInterface::~QDBusConnectionInterface() (qdbusconnectioninterface.cpp:179)
==30852==    by 0xA629A53: QObjectPrivate::deleteChildren() (qobject.cpp:1955)
==30852==    by 0xA62E7A1: QObject::~QObject() (qobject.cpp:946)
==30852==    by 0xAB88ABA: QDBusConnectionPrivate::~QDBusConnectionPrivate() (qdbusintegrator.cpp:998)
==30852==    by 0xAB88DF8: QDBusConnectionPrivate::~QDBusConnectionPrivate() (qdbusintegrator.cpp:1016)
==30852==    by 0xAB803AF: QGlobalStaticDeleter<QDBusDefaultConnection>::~QGlobalStaticDeleter() (qdbusconnection.cpp:978)                                                                     
==30852==    by 0xB58B5A0: __run_exit_handlers (in /lib64/libc-2.11.3.so)                                                                                                                      
==30852==  Address 0x0 is not stack'd, malloc'd or (recently) free'd                                                                                                                           
==30852==                                                                                                                                                                                      
==30852==                                                                                                                                                                                      
==30852== Process terminating with default action of signal 11 (SIGSEGV)                                                                                                                       
==30852==  Bad permissions for mapped region at address 0x0                                                                                                                                    
==30852==    at 0x0: ???                                                                                                                                                                       
==30852==    by 0xA62E3B2: QObject::~QObject() (qobject.cpp:861)                                                                                                                               
==30852==    by 0xA62E9A8: QObject::~QObject() (qobject.cpp:964)                                                                                                                               
==30852==    by 0xAB9E93F: QDBusAbstractInterfacePrivate::~QDBusAbstractInterfacePrivate() (qdbusabstractinterface_p.h:87)                                                                     
==30852==    by 0xA62E7F2: QObject::~QObject() (qscopedpointer.h:62)                                                                                                                           
==30852==    by 0xAB80BC8: QDBusConnectionInterface::~QDBusConnectionInterface() (qdbusconnectioninterface.cpp:179)                                                                            
==30852==    by 0xA629A53: QObjectPrivate::deleteChildren() (qobject.cpp:1955)                                                                                                                 
==30852==    by 0xA62E7A1: QObject::~QObject() (qobject.cpp:946)                                                                                                                               
==30852==    by 0xAB88ABA: QDBusConnectionPrivate::~QDBusConnectionPrivate() (qdbusintegrator.cpp:998)
==30852==    by 0xAB88DF8: QDBusConnectionPrivate::~QDBusConnectionPrivate() (qdbusintegrator.cpp:1016)
==30852==    by 0xAB803AF: QGlobalStaticDeleter<QDBusDefaultConnection>::~QGlobalStaticDeleter() (qdbusconnection.cpp:978)
==30852==    by 0xB58B5A0: __run_exit_handlers (in /lib64/libc-2.11.3.so)
==30852== 
==30852== HEAP SUMMARY:
==30852==     in use at exit: 2,352,914 bytes in 21,995 blocks
==30852==   total heap usage: 271,524 allocs, 249,529 frees, 65,508,421 bytes allocated
==30852== 
==30852== LEAK SUMMARY:
==30852==    definitely lost: 17,020 bytes in 304 blocks
==30852==    indirectly lost: 605,621 bytes in 5,181 blocks
==30852==      possibly lost: 414,307 bytes in 5,133 blocks
==30852==    still reachable: 1,315,966 bytes in 11,377 blocks
==30852==         suppressed: 0 bytes in 0 blocks
==30852== Rerun with --leak-check=full to see details of leaked memory
==30852== 
==30852== For counts of detected and suppressed errors, rerun with: -v
==30852== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 4 from 4)
Segmentation fault

-- 
Boudewijn Rempt
http://www.valdyas.org, http://www.krita.org, http://www.boudewijnrempt.nl



More information about the calligra-devel mailing list