Bug 323090 - KMymoney crashes when importing CSV files
Summary: KMymoney crashes when importing CSV files
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-01 21:03 UTC by Karen Andrews
Modified: 2013-08-04 12:36 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
bk_downloadjuly19.csv (4.90 KB, text/csv)
2013-08-02 20:05 UTC, Karen Andrews
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Karen Andrews 2013-08-01 21:03:33 UTC
When importing CSV files, one must specify comma separated and then specify what data is in which collumn.  It crashes at the collumn sellection

Reproducible: Always

Steps to Reproduce:
1.import csv file
2.select comma separated
3.select data specific to a collumn
Actual Results:  
KMymoney is no longer running and there is a bug report screen 

Expected Results:  
imported the csv file
Comment 1 allan 2013-08-01 22:19:08 UTC
On Thu, 01 Aug 2013 21:03:33 +0000
Karen Andrews <andrews.k@charter.net> wrote:

> https://bugs.kde.org/show_bug.cgi?id=323090
> 
>             Bug ID: 323090
>            Summary: KMymoney crashes when importing CSV files
>     Classification: Unclassified
>            Product: kmymoney4
>            Version: git master
>           Platform: Ubuntu Packages
>                 OS: Linux
>             Status: UNCONFIRMED
>           Severity: grave
>           Priority: NOR
>          Component: general
>           Assignee: kmymoney-devel@kde.org
>           Reporter: andrews.k@charter.net
> 
> When importing CSV files, one must specify comma separated and then
> specify what data is in which collumn.  It crashes at the collumn
> sellection
> 
> Reproducible: Always
> 
> Steps to Reproduce:
> 1.import csv file
> 2.select comma separated
> 3.select data specific to a collumn
> Actual Results:  
> KMymoney is no longer running and there is a bug report screen 
> 
> Expected Results:  
> imported the csv file
> 

Can you run KMM from a terminal so that a backtrace is produced on
crashing.

Would it be possible to attach your csv file, just a few transactions
if it's a large file, with any sensitive data disguised.  If it's not
obvious, which columns/fields are you selecting?

Allan
Comment 2 Jekyll Wu 2013-08-02 03:28:29 UTC
> KMymoney is no longer running and there is a bug report screen 

Then please provide the backtrace, which you can obtain in the second tab of that bug report screen (also known as Dr.Konqi).
Comment 3 Karen Andrews 2013-08-02 19:57:28 UTC
Application: KMyMoney (kmymoney), signal: Segmentation fault

Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".

[Current thread is 1 (Thread 0xb3d19740 (LWP 4570))]


Thread 4 (Thread 0xb1c87b40 (LWP 4573)):

#0 0xb47143f0 in g_mutex_unlock () from /lib/i386-linux-gnu/libglib-2.0.so.0

#1 0xb46d4b2b in g_main_context_check () from 
/lib/i386-linux-gnu/libglib-2.0.so.0

#2 0xb46d5042 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0

#3 0xb46d556b in g_main_loop_run () from 
/lib/i386-linux-gnu/libglib-2.0.so.0

#4 0xb1c8c134 in ?? () from 
/usr/lib/i386-linux-gnu/gio/modules/libdconfsettings.so

#5 0xb46f86b3 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0

#6 0xb6884d4c in start_thread () from /lib/i386-linux-gnu/libpthread.so.0

#7 0xb5267dde in clone () from /lib/i386-linux-gnu/libc.so.6


Thread 3 (Thread 0xb12ffb40 (LWP 4574)):

#0 0xb77aa424 in __kernel_vsyscall ()

#1 0xb5259690 in poll () from /lib/i386-linux-gnu/libc.so.6

#2 0xb46e2a7b in g_poll () from /lib/i386-linux-gnu/libglib-2.0.so.0

#3 0xb46d50ae in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0

#4 0xb46d556b in g_main_loop_run () from 
/lib/i386-linux-gnu/libglib-2.0.so.0

#5 0xb25191ba in ?? () from /usr/lib/i386-linux-gnu/libgio-2.0.so.0

#6 0xb46f86b3 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0

#7 0xb6884d4c in start_thread () from /lib/i386-linux-gnu/libpthread.so.0

#8 0xb5267dde in clone () from /lib/i386-linux-gnu/libc.so.6


Thread 2 (Thread 0xb08ffb40 (LWP 4601)):

#0 0xb6886dc4 in pthread_mutex_lock () from 
/lib/i386-linux-gnu/libpthread.so.0

#1 0xb47143d0 in g_mutex_lock () from /lib/i386-linux-gnu/libglib-2.0.so.0

#2 0xb46d46b6 in g_main_context_prepare () from 
/lib/i386-linux-gnu/libglib-2.0.so.0

#3 0xb46d4faf in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0

#4 0xb46d5201 in g_main_context_iteration () from 
/lib/i386-linux-gnu/libglib-2.0.so.0

#5 0xb61558e7 in QEventDispatcherGlib::processEvents (this=0xa5b77f0, 
flags=...) at kernel/qeventdispatcher_glib.cpp:426

#6 0xb612150d in QEventLoop::processEvents (this=0xb08ff240, flags=...) 
at kernel/qeventloop.cpp:149

#7 0xb61217a9 in QEventLoop::exec (this=0xb08ff240, flags=...) at 
kernel/qeventloop.cpp:204

#8 0xb600a94c in QThread::exec (this=0x8a9b2c8) at thread/qthread.cpp:501

#9 0xb60feb5d in QInotifyFileSystemWatcherEngine::run (this=0x8a9b2c8) 
at io/qfilesystemwatcher_inotify.cpp:248

#10 0xb600dde0 in QThreadPrivate::start (arg=0x8a9b2c8) at 
thread/qthread_unix.cpp:298

#11 0xb6884d4c in start_thread () from /lib/i386-linux-gnu/libpthread.so.0

#12 0xb5267dde in clone () from /lib/i386-linux-gnu/libc.so.6


Thread 1 (Thread 0xb3d19740 (LWP 4570)):

[KCrash Handler]

#7 0xb60597cc in QString::operator== (this=0x8d2e388, other=...) at 
tools/qstring.cpp:2192

#8 0xad737cf2 in CsvImporterDlg::validateColumn (this=0x8d2e170, 
col=@0xbff7b704: 2, type=...) at 
/build/buildd/kmymoney-4.6.1/kmymoney/plugins/csvimport/csvimporterdlg.cpp:259

#9 0xad7383c9 in CsvImporterDlg::dateColumnSelected (this=0x8d2e170, 
col=2) at 
/build/buildd/kmymoney-4.6.1/kmymoney/plugins/csvimport/csvimporterdlg.cpp:375

#10 0xad731be9 in qt_static_metacall (_a=0xbff7b7e8, _id=4, 
_o=0x8d2e170, _c=<optimized out>) at 
/build/buildd/kmymoney-4.6.1/obj-i686-linux-gnu/kmymoney/plugins/csvimport/moc_csvimporterdlg.cpp:85

#11 CsvImporterDlg::qt_static_metacall (_o=0x8d2e170, 
_c=QMetaObject::InvokeMetaMethod, _id=4, _a=0xbff7b7e8) at 
/build/buildd/kmymoney-4.6.1/obj-i686-linux-gnu/kmymoney/plugins/csvimport/moc_csvimporterdlg.cpp:75

#12 0xb61396b1 in QMetaObject::activate (sender=0xa47f0e8, m=0xb5f09c04, 
local_signal_index=5, argv=0xbff7b7e8) at kernel/qobject.cpp:3547

#13 0xb59d6a45 in QComboBox::currentIndexChanged (this=0xa47f0e8, _t1=2) 
at .moc/release-shared/moc_qcombobox.cpp:316

#14 0xb59d6adf in QComboBoxPrivate::_q_emitCurrentIndexChanged 
(this=0xa47f5c8, index=...) at widgets/qcombobox.cpp:1278

#15 0xb59d6dcb in QComboBoxPrivate::setCurrentIndex (this=0xa47f5c8, 
mi=...) at widgets/qcombobox.cpp:2046

#16 0xb59d7cbe in QComboBoxPrivate::_q_itemSelected (this=0xa47f5c8, 
item=...) at widgets/qcombobox.cpp:1247

#17 0xb61396b1 in QMetaObject::activate (sender=0xa4744e8, m=0xb5f18f94, 
local_signal_index=0, argv=0xbff7b9f8) at kernel/qobject.cpp:3547

#18 0xb5cc6025 in QComboBoxPrivateContainer::itemSelected 
(this=0xa4744e8, _t1=...) at .moc/release-shared/moc_qcombobox_p.cpp:253

#19 0xb59d0f8f in QComboBoxPrivateContainer::eventFilter 
(this=0xa4744e8, o=0x989b558, e=0xbff7bab4) at widgets/qcombobox.cpp:691

#20 0xb6122b16 in QCoreApplicationPrivate::sendThroughObjectEventFilters 
(this=0x8990398, receiver=0x989b558, event=0xbff7bfa4) at 
kernel/qcoreapplication.cpp:986

#21 0xb558cea2 in notify_helper (e=0xbff7bfa4, receiver=0x989b558, 
this=0x8990398) at kernel/qapplication.cpp:4555

#22 QApplicationPrivate::notify_helper (this=0x8990398, 
receiver=0x989b558, e=0xbff7bfa4) at kernel/qapplication.cpp:4531

#23 0xb5593024 in QApplication::notify (this=0x8990398, 
receiver=0x989b558, e=0xbff7bfa4) at kernel/qapplication.cpp:4102

#24 0xb6c59e01 in KApplication::notify(QObject*, QEvent*) () from 
/usr/lib/libkdeui.so.5

#25 0xb612297e in QCoreApplication::notifyInternal (this=0x89883d0, 
receiver=0x989b558, event=0xbff7bfa4) at kernel/qcoreapplication.cpp:876

#26 0xb558de95 in sendEvent (event=<optimized out>, receiver=<optimized 
out>) at 
../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231

#27 QApplicationPrivate::sendMouseEvent (receiver=0x989b558, 
event=0xbff7bfa4, alienWidget=0x989b558, nativeWidget=0xa4744e8, 
buttonDown=0xb5f21cf4, lastMouseReceiver=..., spontaneous=true) at 
kernel/qapplication.cpp:3170

#28 0xb561a7d2 in QETWidget::translateMouseEvent (this=0xa4744e8, 
event=0xbff7c45c) at kernel/qapplication_x11.cpp:4551

#29 0xb5618c0d in QApplication::x11ProcessEvent (this=0x89883d0, 
event=0xbff7c45c) at kernel/qapplication_x11.cpp:3732

#30 0xb5645eac in x11EventSourceDispatch (s=0x8991480, callback=0, 
user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146

#31 0xb46d4d86 in g_main_context_dispatch () from 
/lib/i386-linux-gnu/libglib-2.0.so.0

#32 0xb46d5125 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0

#33 0xb46d5201 in g_main_context_iteration () from 
/lib/i386-linux-gnu/libglib-2.0.so.0

#34 0xb6155887 in QEventDispatcherGlib::processEvents (this=0x8968ea0, 
flags=...) at kernel/qeventdispatcher_glib.cpp:424

#35 0xb5645aaa in QGuiEventDispatcherGlib::processEvents 
(this=0x8968ea0, flags=...) at kernel/qguieventdispatcher_glib.cpp:204

#36 0xb612150d in QEventLoop::processEvents (this=0xbff7c754, flags=...) 
at kernel/qeventloop.cpp:149

#37 0xb61217a9 in QEventLoop::exec (this=0xbff7c754, flags=...) at 
kernel/qeventloop.cpp:204

#38 0xb6126eba in QCoreApplication::exec () at 
kernel/qcoreapplication.cpp:1148

#39 0xb558aa74 in QApplication::exec () at kernel/qapplication.cpp:3820

#40 0x0808a493 in runKMyMoney (splash=0xbff7c8a8, a=<optimized out>) at 
/build/buildd/kmymoney-4.6.1/kmymoney/main.cpp:282

#41 0x080889db in main (argc=152488832, argv=0xb6134acc) at 
/build/buildd/kmymoney-4.6.1/kmymoney/main.cpp:181


On 08/01/2013 05:19 PM, allan wrote:
> https://bugs.kde.org/show_bug.cgi?id=323090
>
> --- Comment #1 from allan <agander93@gmail.com> ---
> On Thu, 01 Aug 2013 21:03:33 +0000
> Karen Andrews <andrews.k@charter.net> wrote:
>
>> https://bugs.kde.org/show_bug.cgi?id=323090
>>
>>              Bug ID: 323090
>>             Summary: KMymoney crashes when importing CSV files
>>      Classification: Unclassified
>>             Product: kmymoney4
>>             Version: git master
>>            Platform: Ubuntu Packages
>>                  OS: Linux
>>              Status: UNCONFIRMED
>>            Severity: grave
>>            Priority: NOR
>>           Component: general
>>            Assignee: kmymoney-devel@kde.org
>>            Reporter: andrews.k@charter.net
>>
>> When importing CSV files, one must specify comma separated and then
>> specify what data is in which collumn.  It crashes at the collumn
>> sellection
>>
>> Reproducible: Always
>>
>> Steps to Reproduce:
>> 1.import csv file
>> 2.select comma separated
>> 3.select data specific to a collumn
>> Actual Results:
>> KMymoney is no longer running and there is a bug report screen
>>
>> Expected Results:
>> imported the csv file
>>
> Can you run KMM from a terminal so that a backtrace is produced on
> crashing.
>
> Would it be possible to attach your csv file, just a few transactions
> if it's a large file, with any sensitive data disguised.  If it's not
> obvious, which columns/fields are you selecting?
>
> Allan
>
Comment 4 Karen Andrews 2013-08-02 20:05:52 UTC
Created attachment 81536 [details]
bk_downloadjuly19.csv

On 08/01/2013 05:19 PM, allan wrote:
> https://bugs.kde.org/show_bug.cgi?id=323090
>
> --- Comment #1 from allan <agander93@gmail.com> ---
> On Thu, 01 Aug 2013 21:03:33 +0000
> Karen Andrews <andrews.k@charter.net> wrote:
>
>> https://bugs.kde.org/show_bug.cgi?id=323090
>>
>>              Bug ID: 323090
>>             Summary: KMymoney crashes when importing CSV files
>>      Classification: Unclassified
>>             Product: kmymoney4
>>             Version: git master
>>            Platform: Ubuntu Packages
>>                  OS: Linux
>>              Status: UNCONFIRMED
>>            Severity: grave
>>            Priority: NOR
>>           Component: general
>>            Assignee: kmymoney-devel@kde.org
>>            Reporter: andrews.k@charter.net
>>
>> When importing CSV files, one must specify comma separated and then
>> specify what data is in which collumn.  It crashes at the collumn
>> sellection
>>
>> Reproducible: Always
>>
>> Steps to Reproduce:
>> 1.import csv file
>> 2.select comma separated
>> 3.select data specific to a collumn
>> Actual Results:
>> KMymoney is no longer running and there is a bug report screen
>>
>> Expected Results:
>> imported the csv file
>>
> Can you run KMM from a terminal so that a backtrace is produced on
> crashing.
>
> Would it be possible to attach your csv file, just a few transactions
> if it's a large file, with any sensitive data disguised.  If it's not
> obvious, which columns/fields are you selecting?
>
> Allan
>
Comment 5 allan 2013-08-02 22:32:05 UTC
420 columns?  That is definitely the record, by a long way.

Looking a bit more closely, I see a date column in every sixth column.  There is obviously a problem with line termination.  Is this file as you received it, if so, what produced it?  If not, has it been edited since?  I suspect not, as I'm sure you would have noticed, although I did suggest editing to disguise the data.

Other programs manage to cope with the terminations, so I'll have to check what's going on, and why just your file causes grief.
Comment 6 allan 2013-08-02 22:53:23 UTC
As a temporary work-around, if you read the file into the editor Kate and then save it, that fixes the line ending problem.  Don't use gedit as it doesn't fix things.
Comment 7 Jack 2013-08-03 01:55:40 UTC
Just clicking on the attachment and opening in LibreOffice gives seven columns with date in third, name (including address) in fifth, and amount in seventh.  Columns 1, 2, 4, and 6 are empty.  Looking in emacs - it looks like the line ending is a bare ^M.  Does this file come from a Mac by any chance?
Comment 8 Karen Andrews 2013-08-03 14:01:12 UTC
The file came from our credit card website and was downloaded to a PC 
running Ubuntu 12.04.


On 08/02/2013 08:55 PM, Jack wrote:
> https://bugs.kde.org/show_bug.cgi?id=323090
>
> Jack <ostroffjh@users.sourceforge.net> changed:
>
>             What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                   CC|                            |ostroffjh@users.sourceforge
>                     |                            |.net
>
> --- Comment #7 from Jack <ostroffjh@users.sourceforge.net> ---
> Just clicking on the attachment and opening in LibreOffice gives seven columns
> with date in third, name (including address) in fifth, and amount in seventh.
> Columns 1, 2, 4, and 6 are empty.  Looking in emacs - it looks like the line
> ending is a bare ^M.  Does this file come from a Mac by any chance?
>
Comment 9 Karen Andrews 2013-08-03 14:06:29 UTC
DIdn't understand why this opened as 420 columns for you.  I see Jack 
has gotten it to open in rows.  I tried to send just  a few rows, but 
did not find a quick way to edit so sent as is.


On 08/02/2013 05:32 PM, allan wrote:
> https://bugs.kde.org/show_bug.cgi?id=323090
>
> allan <agander93@gmail.com> changed:
>
>             What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                   CC|                            |agander93@gmail.com
>
> --- Comment #5 from allan <agander93@gmail.com> ---
> 420 columns?  That is definitely the record, by a long way.
>
> Looking a bit more closely, I see a date column in every sixth column.  There
> is obviously a problem with line termination.  Is this file as you received it,
> if so, what produced it?  If not, has it been edited since?  I suspect not, as
> I'm sure you would have noticed, although I did suggest editing to disguise the
> data.
>
> Other programs manage to cope with the terminations, so I'll have to check
> what's going on, and why just your file causes grief.
>
Comment 10 allan 2013-08-03 15:37:05 UTC
(In reply to comment #9)
> DIdn't understand why this opened as 420 columns for you.  I see Jack 
> has gotten it to open in rows.  I tried to send just  a few rows, but 
> did not find a quick way to edit so sent as is.
> 

OK.  Let's go back to the beginning.

1) Is the file you sent to the bug report the same as the one received?
2) When you tried to do the csv import you had a problem.
3) When you loaded that file into the plugin, you should have seen the data.
4) How many columns are displayed?
5) How many rows are displayed?
Comment 11 allan 2013-08-04 12:36:29 UTC
Git commit 0304cfbf94ae620b02017dbba88db7385690eca0 by Allan Anderson.
Committed on 04/08/2013 at 12:32.
Pushed by allananderson into branch 'master'.

M  +1    -2    kmymoney/plugins/csvimport/csvdialog.cpp
M  +9    -3    kmymoney/plugins/csvimport/csvutil.cpp
M  +1    -2    kmymoney/plugins/csvimport/investprocessing.cpp

http://commits.kde.org/kmymoney/0304cfbf94ae620b02017dbba88db7385690eca0