Bug 309267

Summary: Importing an libreoffice calc file (*.ods) file leads to a crash
Product: [Applications] KEXI Reporter: Raymond Wooninck <tittiatcoke>
Component: Migration/Import/ExportAssignee: Jarosław Staniek <staniek>
Status: CLOSED FIXED    
Severity: crash    
Priority: NOR    
Version: 2.9 Alpha   
Target Milestone: 2.8.4   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: 2.8.4
Sentry Crash Report:
Attachments: The ODS file that causes the crash
A new crash

Description Raymond Wooninck 2012-10-30 20:19:26 UTC
Application: kexi (2.6 Alpha)
KDE Platform Version: 4.9.80 "release 34" (Compiled from sources)
Qt Version: 4.8.3
Operating System: Linux 3.6.0-1-desktop x86_64
Distribution: "openSUSE 12.3 Milestone 0 (x86_64)"

-- Information about the crash:
I created a database and wanted to create a table from an Excel sheet. The Import from File dialog offers to import an ods file, which I created with libreoffice. Upon loading the file, kexi crashes

The crash can be reproduced every time.

-- Backtrace:
Application: Kexi (kexi), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f06f3492780 (LWP 13897))]

Thread 2 (Thread 0x7f06d641e700 (LWP 13965)):
#0  0x00007f06f13d2fad in poll () from /lib64/libc.so.6
#1  0x00007f06ee1daaf4 in ?? () from /usr/lib64/libglib-2.0.so.0
#2  0x00007f06ee1dac14 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007f06f1847ce6 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
#4  0x00007f06f181884f in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
#5  0x00007f06f1818ad8 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
#6  0x00007f06f171afe0 in QThread::exec() () from /usr/lib64/libQtCore.so.4
#7  0x00007f06f17f8fef in ?? () from /usr/lib64/libQtCore.so.4
#8  0x00007f06f171dfbc in ?? () from /usr/lib64/libQtCore.so.4
#9  0x00007f06ee490e0f in start_thread () from /lib64/libpthread.so.0
#10 0x00007f06f13db13d in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7f06f3492780 (LWP 13897)):
[KCrash Handler]
#5  0x00007f06e95ada00 in KParts::ReadWritePart::isReadWrite() const () from /usr/lib64/libkparts.so.4
#6  0x00007f06d4904a0a in KoDocument::setAutoSave (this=0x1b039a0, delay=<optimized out>) at /usr/src/debug/calligra-2.5.60git.1351432373/libs/main/KoDocument.cpp:508
#7  0x00007f06d4908be3 in KoDocument::KoDocument (this=0x1b039a0, parent=0x0, undoStack=0x1e356a0) at /usr/src/debug/calligra-2.5.60git.1351432373/libs/main/KoDocument.cpp:199
#8  0x00007f06d4d6b6d7 in Calligra::Sheets::DocBase::DocBase (this=0x1b039a0, part=0x0) at /usr/src/debug/calligra-2.5.60git.1351432373/sheets/DocBase.cpp:66
#9  0x00007f06d51a0475 in Calligra::Sheets::Doc::Doc (this=0x1b039a0, part=<optimized out>) at /usr/src/debug/calligra-2.5.60git.1351432373/sheets/part/Doc.cpp:150
#10 0x00007f06d54800b7 in KexiMigration::SpreadsheetMigrate::drv_connect (this=0x1e35500) at /usr/src/debug/calligra-2.5.60git.1351432373/plugins/kexi/spreadsheet/spreadsheetmigrate.cpp:53
#11 0x00007f06d5768175 in KexiMigration::ImportTableWizard::arriveTableSelectPage (this=0x1c71c70) at /usr/src/debug/calligra-2.5.60git.1351432373/kexi/migration/importtablewizard.cpp:337
#12 0x00007f06f183038f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/libQtCore.so.4
#13 0x00007f06ef12553c in KPageDialog::currentPageChanged(KPageWidgetItem*, KPageWidgetItem*) () from /usr/lib64/libkdeui.so.5
#14 0x00007f06f183038f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/libQtCore.so.4
#15 0x00007f06ef12a0ac in KPageWidget::currentPageChanged(KPageWidgetItem*, KPageWidgetItem*) () from /usr/lib64/libkdeui.so.5
#16 0x00007f06f183038f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/libQtCore.so.4
#17 0x00007f06ef126937 in KPageView::currentPageChanged(QModelIndex const&, QModelIndex const&) () from /usr/lib64/libkdeui.so.5
#18 0x00007f06ef126e6f in ?? () from /usr/lib64/libkdeui.so.5
#19 0x00007f06f183038f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/libQtCore.so.4
#20 0x00007f06f27717c7 in QItemSelectionModel::selectionChanged(QItemSelection const&, QItemSelection const&) () from /usr/lib64/libQtGui.so.4
#21 0x00007f06f277693d in QItemSelectionModel::emitSelectionChanged(QItemSelection const&, QItemSelection const&) () from /usr/lib64/libQtGui.so.4
#22 0x00007f06f277762c in QItemSelectionModel::select(QItemSelection const&, QFlags<QItemSelectionModel::SelectionFlag>) () from /usr/lib64/libQtGui.so.4
#23 0x00007f06f27732db in QItemSelectionModel::select(QModelIndex const&, QFlags<QItemSelectionModel::SelectionFlag>) () from /usr/lib64/libQtGui.so.4
#24 0x00007f06f2771a11 in QItemSelectionModel::setCurrentIndex(QModelIndex const&, QFlags<QItemSelectionModel::SelectionFlag>) () from /usr/lib64/libQtGui.so.4
#25 0x00007f06ef126796 in KPageView::setCurrentPage(QModelIndex const&) () from /usr/lib64/libkdeui.so.5
#26 0x00007f06ef12a00d in KPageWidget::setCurrentPage(KPageWidgetItem*) () from /usr/lib64/libkdeui.so.5
#27 0x00007f06ef04914c in KAssistantDialog::next() () from /usr/lib64/libkdeui.so.5
#28 0x00007f06d5768ab4 in KexiMigration::ImportTableWizard::next (this=0x1c71c70) at /usr/src/debug/calligra-2.5.60git.1351432373/kexi/migration/importtablewizard.cpp:102
#29 0x00007f06f183038f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/libQtCore.so.4
#30 0x00007f06ef059728 in KDialog::slotButtonClicked(int) () from /usr/lib64/libkdeui.so.5
#31 0x00007f06ef059c44 in ?? () from /usr/lib64/libkdeui.so.5
#32 0x00007f06f183038f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/libQtCore.so.4
#33 0x00007f06f1834ece in QSignalMapper::mapped(int) () from /usr/lib64/libQtCore.so.4
#34 0x00007f06f18350d5 in QSignalMapper::map(QObject*) () from /usr/lib64/libQtCore.so.4
#35 0x00007f06f183038f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/libQtCore.so.4
#36 0x00007f06f287caa2 in QAbstractButton::clicked(bool) () from /usr/lib64/libQtGui.so.4
#37 0x00007f06f25d184e in ?? () from /usr/lib64/libQtGui.so.4
#38 0x00007f06f25d2080 in ?? () from /usr/lib64/libQtGui.so.4
#39 0x00007f06f25d22ec in QAbstractButton::mouseReleaseEvent(QMouseEvent*) () from /usr/lib64/libQtGui.so.4
#40 0x00007f06f2267ef0 in QWidget::event(QEvent*) () from /usr/lib64/libQtGui.so.4
#41 0x00007f06f221876c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/libQtGui.so.4
#42 0x00007f06f221d44b in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/libQtGui.so.4
#43 0x00007f06ef0f8876 in KApplication::notify(QObject*, QEvent*) () from /usr/lib64/libkdeui.so.5
#44 0x00007f06f1819afe in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/libQtCore.so.4
#45 0x00007f06f22195ab in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () from /usr/lib64/libQtGui.so.4
#46 0x00007f06f2293d34 in ?? () from /usr/lib64/libQtGui.so.4
#47 0x00007f06f2292ac1 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib64/libQtGui.so.4
#48 0x00007f06f22b8e02 in ?? () from /usr/lib64/libQtGui.so.4
#49 0x00007f06ee1da825 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#50 0x00007f06ee1dab58 in ?? () from /usr/lib64/libglib-2.0.so.0
#51 0x00007f06ee1dac14 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#52 0x00007f06f1847cc6 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
#53 0x00007f06f22b8a7e in ?? () from /usr/lib64/libQtGui.so.4
#54 0x00007f06f181884f in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
#55 0x00007f06f1818ad8 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
#56 0x00007f06f26cbed8 in QDialog::exec() () from /usr/lib64/libQtGui.so.4
#57 0x00007f06f2fd4bfe in KexiMainWindow::slotToolsImportTables (this=<optimized out>) at /usr/src/debug/calligra-2.5.60git.1351432373/kexi/main/KexiMainWindow.cpp:3917
#58 0x00007f06f2fe81fa in qt_static_metacall (_a=<optimized out>, _id=<optimized out>, _o=<optimized out>, _c=<optimized out>) at /usr/src/debug/calligra-2.5.60git.1351432373/build/kexi/main/KexiMainWindow.moc:516
#59 KexiMainWindow::qt_static_metacall (_o=0x16eb0a0, _c=<optimized out>, _id=<optimized out>, _a=0x7fff915648b0) at /usr/src/debug/calligra-2.5.60git.1351432373/build/kexi/main/KexiMainWindow.moc:377
#60 0x00007f06f183038f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/libQtCore.so.4
#61 0x00007f06f2212562 in QAction::triggered(bool) () from /usr/lib64/libQtGui.so.4
#62 0x00007f06f2212750 in QAction::activate(QAction::ActionEvent) () from /usr/lib64/libQtGui.so.4
#63 0x00007f06f25d203f in ?? () from /usr/lib64/libQtGui.so.4
#64 0x00007f06f25d22ec in QAbstractButton::mouseReleaseEvent(QMouseEvent*) () from /usr/lib64/libQtGui.so.4
#65 0x00007f06f268c42a in QToolButton::mouseReleaseEvent(QMouseEvent*) () from /usr/lib64/libQtGui.so.4
#66 0x00007f06f2267ef0 in QWidget::event(QEvent*) () from /usr/lib64/libQtGui.so.4
#67 0x00007f06f221876c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/libQtGui.so.4
#68 0x00007f06f221d44b in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/libQtGui.so.4
#69 0x00007f06ef0f8876 in KApplication::notify(QObject*, QEvent*) () from /usr/lib64/libkdeui.so.5
#70 0x00007f06f1819afe in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/libQtCore.so.4
#71 0x00007f06f22195ab in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () from /usr/lib64/libQtGui.so.4
#72 0x00007f06f2293d34 in ?? () from /usr/lib64/libQtGui.so.4
#73 0x00007f06f2292ac1 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib64/libQtGui.so.4
#74 0x00007f06f22b8e02 in ?? () from /usr/lib64/libQtGui.so.4
#75 0x00007f06ee1da825 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#76 0x00007f06ee1dab58 in ?? () from /usr/lib64/libglib-2.0.so.0
#77 0x00007f06ee1dac14 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#78 0x00007f06f1847cc6 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
#79 0x00007f06f22b8a7e in ?? () from /usr/lib64/libQtGui.so.4
#80 0x00007f06f181884f in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
#81 0x00007f06f1818ad8 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
#82 0x00007f06f181d778 in QCoreApplication::exec() () from /usr/lib64/libQtCore.so.4
#83 0x0000000000400941 in main (argc=<optimized out>, argv=0x7fff91565dd8) at /usr/src/debug/calligra-2.5.60git.1351432373/kexi/main.cpp:36

Reported using DrKonqi
Comment 1 Jarosław Staniek 2012-10-30 20:25:03 UTC
Hi, thanks for the report. May I ask for sample .ods file that crashes Kexi?
Comment 2 Raymond Wooninck 2012-10-30 20:27:01 UTC
Created attachment 74887 [details]
The ODS file that causes the crash

This is the spreadsheet that I tried to import.
Comment 3 Jarosław Staniek 2014-06-27 20:13:06 UTC
Different crash for the same document happens in Pre-Alpha 2.9. See the attachment 1 [details].
Comment 4 Jarosław Staniek 2014-06-27 20:14:15 UTC
Created attachment 87436 [details]
A new crash
Comment 5 Jarosław Staniek 2014-06-29 21:32:23 UTC
Git commit 8251542da9e8d07ed8456efce688a2c02afcaca6 by Jaroslaw Staniek.
Committed on 27/06/2014 at 22:01.
Pushed by staniek into branch 'master'.

Fix crash and import failures for ODS import to Kexi

1. Copying contents of table(s) always fails; as it's unimplemented, now at least silently succeeds.
2. Sheets can now contain column names that cannot be identifiers. Sample document: https://bugs.kde.org/show_bug.cgi?id=309267#attach_74887).
3. Sheet can contain non-unique column names. If a column is duplicated, add _N to it, where N is subsequent integer, increased from 1 until the name become unique.
Related: bug 336814

REVIEW:118983

M  +53   -19   plugins/kexi/spreadsheet/spreadsheetmigrate.cpp
M  +4    -1    plugins/kexi/spreadsheet/spreadsheetmigrate.h

http://commits.kde.org/calligra/8251542da9e8d07ed8456efce688a2c02afcaca6
Comment 6 Jarosław Staniek 2014-06-29 21:36:33 UTC
Git commit 7f7a2482671e33dd0757784461d231d1228275a2 by Jaroslaw Staniek.
Committed on 27/06/2014 at 22:01.
Pushed by staniek into branch 'calligra/2.8'.

Fix crash and import failures for ODS import to Kexi

1. Copying contents of table(s) always fails; as it's unimplemented, now at least silently succeeds.
2. Sheets can now contain column names that cannot be identifiers. Sample document: https://bugs.kde.org/show_bug.cgi?id=309267#attach_74887).
3. Sheet can contain non-unique column names. If a column is duplicated, add _N to it, where N is subsequent integer, increased from 1 until the name become unique.
Related: bug 336814

REVIEW:118983

M  +53   -19   plugins/kexi/spreadsheet/spreadsheetmigrate.cpp
M  +4    -1    plugins/kexi/spreadsheet/spreadsheetmigrate.h

http://commits.kde.org/calligra/7f7a2482671e33dd0757784461d231d1228275a2