Bug 269074 - csv importer tests crash
Summary: csv importer tests crash
Status: RESOLVED NOT A BUG
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: SVN
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-21 19:17 UTC by Thomas Baumgart
Modified: 2011-03-22 11:40 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Baumgart 2011-03-21 19:17:44 UTC
Version:           SVN trunk (using KDE 1.2) 
OS:                Linux

The symboltest test cases crash because KGlobal::locale() returns 0.

Reproducible: Always

Steps to Reproduce:
Run 'ctest -V -R symboltest'

Actual Results:  
Testprogram crashes

Expected Results:  
Don't crash :)

UpdateCTestConfiguration  from :/home/thb/devel/kmymoney4/build/kmymoney/plugins/csvimport/DartConfiguration.tcl
UpdateCTestConfiguration  from :/home/thb/devel/kmymoney4/build/kmymoney/plugins/csvimport/DartConfiguration.tcl
Test project /home/thb/devel/kmymoney4/build/kmymoney/plugins/csvimport
Constructing a list of tests
Done constructing a list of tests
Checking test dependency graph...
test 3
    Start 3: kmymoney-plugin-symboltest

3: Test command: /home/thb/devel/kmymoney4/build/kmymoney/plugins/csvimport/symboltest.shell
3: Test timeout computed to be: 9.99988e+06
3: ********* Start testing of SymbolTest *********
3: Config: Using QTest library 4.5.2, Qt 4.5.2
3: PASS   : SymbolTest::initTestCase()
3: Segmentation fault
1/1 Test #3: kmymoney-plugin-symboltest .......***Failed    0.02 sec

0% tests passed, 1 tests failed out of 1

Total Test time (real) =   0.02 sec

The following tests FAILED:
          3 - kmymoney-plugin-symboltest (Failed)
Errors while running CTest





(gdb) run
Starting program: /home/thb/devel/kmymoney4/build/kmymoney/plugins/csvimport/symboltest
[Thread debugging using libthread_db enabled]
********* Start testing of SymbolTest *********
Config: Using QTest library 4.5.2, Qt 4.5.2
PASS   : SymbolTest::initTestCase()

Program received signal SIGSEGV, Segmentation fault.
0x002cc4a9 in KLocale::decimalSymbol() const () from /usr/lib/libkdecore.so.5
(gdb) bt
#0  0x002cc4a9 in KLocale::decimalSymbol() const () from /usr/lib/libkdecore.so.5
#1  0x0804a3d4 in SymbolTest::init (this=0xbffff2b8)
    at /home/thb/devel/kmymoney4/kmymoney/plugins/csvimport/symboltest.cpp:38
#2  0x08049cb3 in SymbolTest::qt_metacall (this=0xbffff2b8, _c=QMetaObject::InvokeMetaMethod, _id=4,
    _a=0xbfffe7ac) at /home/thb/devel/kmymoney4/build/kmymoney/plugins/csvimport/moc_symboltest.cpp:90
#3  0x004e011d in QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const () from /usr/lib/libQtCore.so.4
#4  0x004e070f in QMetaObject::invokeMethod(QObject*, char const*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) ()
   from /usr/lib/libQtCore.so.4
#5  0x001350a4 in ?? () from /usr/lib/libQtTest.so.4
#6  0x00136168 in ?? () from /usr/lib/libQtTest.so.4
#7  0x0013655b in QTest::qExec(QObject*, int, char**) () from /usr/lib/libQtTest.so.4
#8  0x0804aaac in main (argc=1, argv=0xbffff3a4)
    at /home/thb/devel/kmymoney4/kmymoney/plugins/csvimport/symboltest.cpp:26
Comment 1 allan 2011-03-21 21:18:00 UTC
(In reply to comment #0)
> Version:           SVN trunk (using KDE 1.2) 
> OS:                Linux
> 
> The symboltest test cases crash because KGlobal::locale() returns 0.
> 
> Reproducible: Always
> 
> Steps to Reproduce:
> Run 'ctest -V -R symboltest'
> 
> Actual Results:  
> Testprogram crashes
> 
> Expected Results:  
> Don't crash :)
> 
> UpdateCTestConfiguration  from
> :/home/thb/devel/kmymoney4/build/kmymoney/plugins/csvimport/DartConfiguration.tcl
> UpdateCTestConfiguration  from
> :/home/thb/devel/kmymoney4/build/kmymoney/plugins/csvimport/DartConfiguration.tcl
> Test project /home/thb/devel/kmymoney4/build/kmymoney/plugins/csvimport
> Constructing a list of tests
> Done constructing a list of tests
> Checking test dependency graph...
> test 3
>     Start 3: kmymoney-plugin-symboltest
> 
> 3: Test command:
> /home/thb/devel/kmymoney4/build/kmymoney/plugins/csvimport/symboltest.shell
> 3: Test timeout computed to be: 9.99988e+06
> 3: ********* Start testing of SymbolTest *********
> 3: Config: Using QTest library 4.5.2, Qt 4.5.2
> 3: PASS   : SymbolTest::initTestCase()
> 3: Segmentation fault
> 1/1 Test #3: kmymoney-plugin-symboltest .......***Failed    0.02 sec
> 
> 0% tests passed, 1 tests failed out of 1
> 
> Total Test time (real) =   0.02 sec
> 
> The following tests FAILED:
>           3 - kmymoney-plugin-symboltest (Failed)
> Errors while running CTest
> 
> 
> 
> 
> 
> (gdb) run
> Starting program:
> /home/thb/devel/kmymoney4/build/kmymoney/plugins/csvimport/symboltest
> [Thread debugging using libthread_db enabled]
> ********* Start testing of SymbolTest *********
> Config: Using QTest library 4.5.2, Qt 4.5.2
> PASS   : SymbolTest::initTestCase()
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0x002cc4a9 in KLocale::decimalSymbol() const () from /usr/lib/libkdecore.so.5
> (gdb) bt
> #0  0x002cc4a9 in KLocale::decimalSymbol() const () from
> /usr/lib/libkdecore.so.5
> #1  0x0804a3d4 in SymbolTest::init (this=0xbffff2b8)
>     at /home/thb/devel/kmymoney4/kmymoney/plugins/csvimport/symboltest.cpp:38
> #2  0x08049cb3 in SymbolTest::qt_metacall (this=0xbffff2b8,
> _c=QMetaObject::InvokeMetaMethod, _id=4,
>     _a=0xbfffe7ac) at
> /home/thb/devel/kmymoney4/build/kmymoney/plugins/csvimport/moc_symboltest.cpp:90
> #3  0x004e011d in QMetaMethod::invoke(QObject*, Qt::ConnectionType,
> QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument,
> QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument,
> QGenericArgument, QGenericArgument, QGenericArgument) const () from
> /usr/lib/libQtCore.so.4
> #4  0x004e070f in QMetaObject::invokeMethod(QObject*, char const*,
> Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument,
> QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument,
> QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) ()
>    from /usr/lib/libQtCore.so.4
> #5  0x001350a4 in ?? () from /usr/lib/libQtTest.so.4
> #6  0x00136168 in ?? () from /usr/lib/libQtTest.so.4
> #7  0x0013655b in QTest::qExec(QObject*, int, char**) () from
> /usr/lib/libQtTest.so.4
> #8  0x0804aaac in main (argc=1, argv=0xbffff3a4)
>     at /home/thb/devel/kmymoney4/kmymoney/plugins/csvimport/symboltest.cpp:26

Hmmmm...  Works for me on openSuse - 


aga@eve2:~/CSV/kmymoney/build> ctest -V -R symboltest
UpdateCTestConfiguration  from :/home/aga/CSV/kmymoney/build/DartConfiguration.tcl
UpdateCTestConfiguration  from :/home/aga/CSV/kmymoney/build/DartConfiguration.tcl
Test project /home/aga/CSV/kmymoney/build
Constructing a list of tests
Done constructing a list of tests
Checking test dependency graph...
test 23
    Start 23: kmymoney-plugin-symboltest

23: Test command: /home/aga/CSV/kmymoney/build/kmymoney/plugins/csvimport/symboltest.shell
23: Test timeout computed to be: 9.99988e+06
23: ********* Start testing of SymbolTest *********
23: Config: Using QTest library 4.7.1, Qt 4.7.1
23: PASS   : SymbolTest::initTestCase()
23: PASS   : SymbolTest::testDefaultConstructor()
23: PASS   : SymbolTest::testConstructor()
23: PASS   : SymbolTest::testDecimalSymbolDot()
23: PASS   : SymbolTest::testDecimalSymbolComma()
23: PASS   : SymbolTest::testDecimalSymbolInvalid()
23: PASS   : SymbolTest::cleanupTestCase()
23: Totals: 7 passed, 0 failed, 0 skipped
23: ********* Finished testing of SymbolTest *********
1/1 Test #23: kmymoney-plugin-symboltest .......   Passed    0.04 sec

The following tests passed:
        kmymoney-plugin-symboltest

100% tests passed, 0 tests failed out of 1

I'd better look at Ubuntu, but what version of Ubuntu are you?

> Version: SVN trunk (using KDE 1.2)

??
Comment 2 Thomas Baumgart 2011-03-21 22:00:24 UTC
I did the above on openSUSE 11.4 and build things using RelWithDebInfo
Comment 3 allan 2011-03-21 23:25:06 UTC
(In reply to comment #2)
> I did the above on openSUSE 11.4 and build things using RelWithDebInfo

OK, but the email version I got shows -

" Platform: Ubuntu Packages
            ------
        OS/Version: Linux
            Status: NEW
          Severity: crash
          Priority: NOR
         Component: general
        AssignedTo: kmymoney-devel@kde.org
        ReportedBy: ipwizard@users.sourceforge.net


Version:           SVN trunk (using KDE 1.2) 
"

I'm openSuse 11.4 with RelWithDebInfo too.  I've just tried with German locale and it still works for me.

aga@eve2:~/bin/kmymoney> uname -a
Linux eve2 2.6.37.1-1.2-desktop #1 SMP PREEMPT 2011-02-21 10:34:10 +0100 x86_64 x86_64 x86_64 GNU/Linux

Are you 32 or 64 bit? (grasping at straws)
Comment 4 allan 2011-03-22 02:09:50 UTC
I use KGlobal::locale()->decimalSymbol() in several places in the plugin, partly why I implemented those unittests.  You may remember a week or two ago, I queried the support for no decimal places, and you responded that the qifimporter didn't support that?  Well, because the plugin can be used to produce qif files, I now test for absence of decimals, and if none found, add them with the locale decimal separator.

To help in closing in on the issue, am I right in thinking that you have run only the tests, and have not 'used' the plugin itself, so this is the only point where you encounter the problem?

I've made an assumption that the local decimal separator is pretty fundamental and is bound to be present, but it seems that perhaps that is not a good idea.

As I can't reproduce the problem here, might it help to test whether having a KGlobal::locale()->decimalSymbol().isEmpty() test?  Can you do that, or should I implement it anyway and produce a patch, which I have no means of testing?
Comment 5 Thomas Baumgart 2011-03-22 07:54:15 UTC
I am on pretty much the same machinery here:

Linux thb-nb 2.6.37.1-1.2-desktop #1 SMP PREEMPT 2011-02-21 10:34:10 +0100 x86_64 x86_64 x86_64 GNU/Linux

The problem is not that I don't have decimal but that KGlobal::locale() returns 0 and thus using it as a pointer in e.g. KGlobal::locale()->decimalSymbol() crashes.

Yes, I have only run the testcases as part of a general procedure here (which means run them now and then after an svn update).

I tried to encapsulate the parts that won't work in the ctor of the test class in a check that verifies the above mentioned pointer, but then I simply see a crash later on. I have to figure out why the pointer is 0 in my case and not in yours. Maybe some leftovers from upgrading. Next thing I will clean out the whole build.
Comment 6 Thomas Baumgart 2011-03-22 09:03:58 UTC
The clean rebuild solved the problem. Sorry for the noise.
Comment 7 allan 2011-03-22 11:40:15 UTC
(In reply to comment #6)
> The clean rebuild solved the problem. Sorry for the noise.

Whewwww..  That's a relief!