Bug 304329 - Kexi crashes on importing CSV files with Mac line endings
Summary: Kexi crashes on importing CSV files with Mac line endings
Status: CLOSED FIXED
Alias: None
Product: KEXI
Classification: Applications
Component: Migration/Import/Export (show other bugs)
Version: 2.4.0
Platform: Ubuntu Linux
: NOR crash
Target Milestone: 2.5
Assignee: Jarosław Staniek
URL:
Keywords:
: 258343 (view as bug list)
Depends on:
Blocks: 304405
  Show dependency treegraph
 
Reported: 2012-07-31 12:56 UTC by mc
Modified: 2012-08-11 11:17 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.5.1
Sentry Crash Report:


Attachments
New crash information added by DrKonqi (8.23 KB, text/plain)
2012-07-31 13:00 UTC, mc
Details
This is the data set that I was trying to import (172.84 KB, text/plain)
2012-07-31 13:02 UTC, mc
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mc 2012-07-31 12:56:56 UTC
Application: kexi (2.4.0 (Calligra 2.4.0))
KDE Platform Version: 4.8.4 (4.8.4)
Qt Version: 4.8.1
Operating System: Linux 3.2.0-27-generic x86_64
Distribution: Ubuntu 12.04 LTS

-- Information about the crash:
trying to import data via external data menu. It was a tab delimited data set. I am running Ubuntu Precise with Cinnamon window manager.

-- Backtrace:
Application: Kexi (kexi), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f3435657780 (LWP 31443))]

Thread 3 (Thread 0x7f341ba95700 (LWP 31447)):
#0  0x00007f34305d605d in __pthread_mutex_unlock_usercnt (mutex=<optimized out>, decr=<optimized out>) at pthread_mutex_unlock.c:52
#1  __pthread_mutex_unlock (mutex=0x7f341400c2a0) at pthread_mutex_unlock.c:290
#2  0x00007f34301415d1 in g_mutex_unlock () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f343010602a in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007f343010649a in g_main_loop_run () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007f342383f406 in ?? () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#6  0x00007f34301279e5 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#7  0x00007f34305d2e9a in start_thread (arg=0x7f341ba95700) at pthread_create.c:308
#8  0x00007f34335724bd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#9  0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7f341c296700 (LWP 32381)):
#0  0x00007f3433566b03 in __GI___poll (fds=<optimized out>, nfds=<optimized out>, timeout=<optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00007f3430106036 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f3430106164 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f34339e7426 in QEventDispatcherGlib::processEvents (this=0x7f3414001360, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#4  0x00007f34339b6c82 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007f34339b6ed7 in QEventLoop::exec (this=0x7f341c295dd0, flags=...) at kernel/qeventloop.cpp:204
#6  0x00007f34338b5fa7 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:501
#7  0x00007f34339969ff in QInotifyFileSystemWatcherEngine::run (this=0x2ce2c60) at io/qfilesystemwatcher_inotify.cpp:248
#8  0x00007f34338b8fcb in QThreadPrivate::start (arg=0x2ce2c60) at thread/qthread_unix.cpp:298
#9  0x00007f34305d2e9a in start_thread (arg=0x7f341c296700) at pthread_create.c:308
#10 0x00007f34335724bd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#11 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f3435657780 (LWP 31443)):
[KCrash Handler]
#6  isEmpty (this=0x9b5959592a000000) at /usr/include/qt4/QtCore/qlist.h:99
#7  isEmpty (this=0x9b5959592a000000) at /usr/include/qt4/QtCore/qlist.h:152
#8  KexiCSVImportDialog::detectTypeAndUniqueness (this=0x2c9d810, row=<optimized out>, col=1024, text=...) at /build/buildd/calligra-2.4.0/kexi/plugins/importexport/csv/kexicsvimportdialog.cpp:1054
#9  0x00007f33f891954e in KexiCSVImportDialog::setText (this=0x2c9d810, row=2, col=1025, text=..., inGUI=<optimized out>) at /build/buildd/calligra-2.4.0/kexi/plugins/importexport/csv/kexicsvimportdialog.cpp:1253
#10 0x00007f33f891ab69 in KexiCSVImportDialog::loadRows (this=0x2c9d810, field=..., row=@0x7fff7bc37080: 1, column=@0x7fff7bc37084: 1025, maxColumn=@0x7fff7bc37088: 0, inGUI=true) at /build/buildd/calligra-2.4.0/kexi/plugins/importexport/csv/kexicsvimportdialog.cpp:854
#11 0x00007f33f891c200 in KexiCSVImportDialog::fillTable (this=0x2c9d810) at /build/buildd/calligra-2.4.0/kexi/plugins/importexport/csv/kexicsvimportdialog.cpp:510
#12 0x00007f33f891c8bf in KexiCSVImportDialog::initLater (this=0x2c9d810) at /build/buildd/calligra-2.4.0/kexi/plugins/importexport/csv/kexicsvimportdialog.cpp:431
#13 0x00007f33f891ecea in KexiCSVImportDialog::KexiCSVImportDialog (this=0x2c9d810, mode=<optimized out>, parent=<optimized out>) at /build/buildd/calligra-2.4.0/kexi/plugins/importexport/csv/kexicsvimportdialog.cpp:414
#14 0x00007f33f891712b in KexiCSVImportExportPart::createWidget (this=0x2e37260, widgetClass=<optimized out>, parent=0x2767ad0, objName=0x7f343524d69d "csv_importexport", args=0x7fff7bc37cb0) at /build/buildd/calligra-2.4.0/kexi/plugins/importexport/csv/kexicsv_importexportpart.cpp:45
#15 0x00007f3434f02bab in KexiInternalPart::createModalDialogInstance (partName=0x7f343524d69d "csv_importexport", dialogClass=0x7f343524d689 "KexiCSVImportDialog", msgHdr=<optimized out>, objName=<optimized out>, args=0x7fff7bc37cb0) at /build/buildd/calligra-2.4.0/kexi/core/kexiinternalpart.cpp:169
#16 0x00007f343519f8c2 in KexiMainWindow::slotProjectImportDataTable (this=0x2767ad0) at /build/buildd/calligra-2.4.0/kexi/main/KexiMainWindow.cpp:4041
#17 0x00007f34351a47c5 in qt_static_metacall (_a=0x7fff7bc37ef0, _id=<optimized out>, _o=0x2767ad0, _c=<optimized out>) at /build/buildd/calligra-2.4.0/obj-x86_64-linux-gnu/kexi/main/KexiMainWindow.moc:484
#18 KexiMainWindow::qt_static_metacall (_o=0x2767ad0, _c=<optimized out>, _id=<optimized out>, _a=0x7fff7bc37ef0) at /build/buildd/calligra-2.4.0/obj-x86_64-linux-gnu/kexi/main/KexiMainWindow.moc:370
#19 0x00007f34339cc281 in QMetaObject::activate (sender=0x27a8cd0, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7fff7bc37ef0) at kernel/qobject.cpp:3547
#20 0x00007f34343ac132 in QAction::triggered (this=<optimized out>, _t1=false) at .moc/release-shared/moc_qaction.cpp:277
#21 0x00007f34343ac31f in QAction::activate (this=0x27a8cd0, event=<optimized out>) at kernel/qaction.cpp:1257
#22 0x00007f3434781d4a in QAbstractButtonPrivate::click (this=0x2886cd0) at widgets/qabstractbutton.cpp:530
#23 0x00007f3434781ffc in QAbstractButton::mouseReleaseEvent (this=0x2804f10, e=0x7fff7bc387d0) at widgets/qabstractbutton.cpp:1123
#24 0x00007f343483f5da in QToolButton::mouseReleaseEvent (this=<optimized out>, e=<optimized out>) at widgets/qtoolbutton.cpp:718
#25 0x00007f3434403144 in QWidget::event (this=0x2804f10, event=0x7fff7bc387d0) at kernel/qwidget.cpp:8362
#26 0x00007f34343b2894 in notify_helper (e=0x7fff7bc387d0, receiver=0x2804f10, this=0x24efb00) at kernel/qapplication.cpp:4559
#27 QApplicationPrivate::notify_helper (this=0x24efb00, receiver=0x2804f10, e=0x7fff7bc387d0) at kernel/qapplication.cpp:4531
#28 0x00007f34343b80bf in QApplication::notify (this=<optimized out>, receiver=0x2804f10, e=0x7fff7bc387d0) at kernel/qapplication.cpp:4102
#29 0x00007f34314659e6 in KApplication::notify (this=0x24e1950, receiver=0x2804f10, event=0x7fff7bc387d0) at ../../kdeui/kernel/kapplication.cpp:311
#30 0x00007f34339b7e9c in QCoreApplication::notifyInternal (this=0x24e1950, receiver=0x2804f10, event=0x7fff7bc387d0) at kernel/qcoreapplication.cpp:876
#31 0x00007f34343b3862 in sendEvent (event=<optimized out>, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#32 QApplicationPrivate::sendMouseEvent (receiver=0x2804f10, event=0x7fff7bc387d0, alienWidget=0x2804f10, nativeWidget=0x27bcde0, buttonDown=0x2804f10, lastMouseReceiver=..., spontaneous=true) at kernel/qapplication.cpp:3170
#33 0x00007f3434432bf5 in QETWidget::translateMouseEvent (this=0x27bcde0, event=<optimized out>) at kernel/qapplication_x11.cpp:4617
#34 0x00007f3434431bae in QApplication::x11ProcessEvent (this=0x24e1950, event=0x7fff7bc390a0) at kernel/qapplication_x11.cpp:3732
#35 0x00007f343445b0d2 in x11EventSourceDispatch (s=0x24f1700, callback=0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146
#36 0x00007f3430105d53 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#37 0x00007f34301060a0 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#38 0x00007f3430106164 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#39 0x00007f34339e73bf in QEventDispatcherGlib::processEvents (this=0x2479ad0, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#40 0x00007f343445ad5e in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#41 0x00007f34339b6c82 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#42 0x00007f34339b6ed7 in QEventLoop::exec (this=0x7fff7bc39440, flags=...) at kernel/qeventloop.cpp:204
#43 0x00007f34339bbf67 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1148
#44 0x0000000000400891 in main (argc=<optimized out>, argv=0x7fff7bc39588) at /build/buildd/calligra-2.4.0/kexi/main.cpp:36

This bug may be a duplicate of or related to bug 258343.

Possible duplicates by query: bug 258343.

Reported using DrKonqi
Comment 1 mc 2012-07-31 13:00:23 UTC
Created attachment 72850 [details]
New crash information added by DrKonqi

kexi (2.4.0 (Calligra 2.4.0)) on KDE Platform 4.8.4 (4.8.4) using Qt 4.8.1

- What I was doing when the application crashed: Importing tab delimited data--and another note, I am using a postgres backend.

-- Backtrace (Reduced):
#6  isEmpty (this=0x9b5959592a000000) at /usr/include/qt4/QtCore/qlist.h:99
#7  isEmpty (this=0x9b5959592a000000) at /usr/include/qt4/QtCore/qlist.h:152
#8  KexiCSVImportDialog::detectTypeAndUniqueness (this=0xfea510, row=<optimized out>, col=1024, text=...) at /build/buildd/calligra-2.4.0/kexi/plugins/importexport/csv/kexicsvimportdialog.cpp:1054
#9  0x00007fa5198f754e in KexiCSVImportDialog::setText (this=0xfea510, row=2, col=1025, text=..., inGUI=<optimized out>) at /build/buildd/calligra-2.4.0/kexi/plugins/importexport/csv/kexicsvimportdialog.cpp:1253
#10 0x00007fa5198f8b69 in KexiCSVImportDialog::loadRows (this=0xfea510, field=..., row=@0x7fffae614660: 1, column=@0x7fffae614664: 1025, maxColumn=@0x7fffae614668: 0, inGUI=true) at /build/buildd/calligra-2.4.0/kexi/plugins/importexport/csv/kexicsvimportdialog.cpp:854
Comment 2 mc 2012-07-31 13:02:43 UTC
Created attachment 72851 [details]
This is the data set that I was trying to import
Comment 3 Jarosław Staniek 2012-07-31 21:00:21 UTC
Thank you for the test data. It should speed up the fix :)
Comment 4 Adam Pigg 2012-07-31 21:03:55 UTC
I guess it shouldnt crash, but the data is tab delimited, and the importer is for CSV data.
Comment 5 Jarosław Staniek 2012-07-31 21:13:31 UTC
Confirmed the crash.

@Adam CSV supports any well defined delimiter, tab is typical one
Comment 6 mc 2012-07-31 21:15:23 UTC
Well, it gives a choice for csv or txt in the file chooser, and the
delimiter is not clearly stated. In the table importer, changing the file
extension to tsv crashes Kexi as well, and yet it is listed as 'supported'.

On Tue, Jul 31, 2012 at 2:03 PM, Adam Pigg <adam@piggz.co.uk> wrote:

> https://bugs.kde.org/show_bug.cgi?id=304329
>
> Adam Pigg <adam@piggz.co.uk> changed:
>
>            What    |Removed                     |Added
>
> ----------------------------------------------------------------------------
>                  CC|                            |adam@piggz.co.uk
>
> --- Comment #4 from Adam Pigg <adam@piggz.co.uk> ---
> I guess it shouldnt crash, but the data is tab delimited, and the importer
> is
> for CSV data.
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.
> You reported the bug.
>
Comment 7 Adam Pigg 2012-07-31 21:17:27 UTC
@jaroslaw Ah, ok, i thought it was CSV only....
Comment 8 Jarosław Staniek 2012-07-31 21:33:20 UTC
@Adam: CSV isn't the CSV you have in mind :) More strictly, please look:

""CSV" is not a single, well-defined format (although see RFC 4180 for one definition that is commonly used)"

http://en.wikipedia.org/wiki/Comma-separated_values
Comment 9 Jarosław Staniek 2012-08-01 22:55:50 UTC
@mc: Changed the summary to "Kexi crashes on importing CSV files with Mac line endings". Yes this is real reason. 

Current workaround before this bug gets fixed: 

OPTION 1: using Kate: 
open the file in Kate, select Tools->End of Line->UNIX, save the file.

OPTION 2: using command line: 
recode macintosh/CR..UTF-8 {filename}
Comment 10 Jarosław Staniek 2012-08-01 23:06:05 UTC
*** Bug 258343 has been marked as a duplicate of this bug. ***
Comment 11 Jarosław Staniek 2012-08-10 20:39:52 UTC
Git commit 79d3d721fcdf74df70450c4930ade8885410c057 by Jaroslaw Staniek.
Committed on 03/08/2012 at 00:49.
Pushed by staniek into branch 'calligra/2.5'.

Fix crash on importing CSV files with Mac line endings
REVIEW:105843
FIXED-IN:2.5.1

M  +20   -11   kexi/plugins/importexport/csv/kexicsvimportdialog.cpp

http://commits.kde.org/calligra/79d3d721fcdf74df70450c4930ade8885410c057
Comment 12 Jarosław Staniek 2012-08-10 20:51:34 UTC
Git commit 560ee6e7db8cb68c39c2ca4182899ab0792b0566 by Jaroslaw Staniek.
Committed on 03/08/2012 at 00:49.
Pushed by staniek into branch 'master'.

Fix crash on importing CSV files with Mac line endings
REVIEW:105843

M  +20   -11   kexi/plugins/importexport/csv/kexicsvimportdialog.cpp

http://commits.kde.org/calligra/560ee6e7db8cb68c39c2ca4182899ab0792b0566