Bug 244420

Summary: Kexi mdb import crashes when transferring data to target
Product: [Applications] KEXI Reporter: Steve Dowe <sd>
Component: Migration/Import/ExportAssignee: Jarosław Staniek <staniek>
Status: CLOSED FIXED    
Severity: crash CC: sd
Priority: NOR    
Version: 2.2.0 (KOffice 2.2.0)   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:

Description Steve Dowe 2010-07-12 18:51:52 UTC
Application: kexi (2.2.0 (KOffice 2.2.0))
KDE Platform Version: 4.4.4 (KDE 4.4.4)
Qt Version: 4.6.2
Operating System: Linux 2.6.33.6-147.fc13.x86_64 x86_64
Distribution: "Fedora release 13 (Goddard)"

-- Information about the crash:
Following the import wizard through each step, and selecting either MySQL or local file storage as the destination, I select "Structure and Data" and begin to import the database.

There are 3 tables in this mdb database. I believe it is created in Access 2007 and saved in Access 2000 format. 

The progress bar of the import dialog gets up to 6% every time and then the application crashes.

The crash can be reproduced every time.

 -- Backtrace:
Application: Kexi (kexi), signal: Aborted
82	T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS)
[KCrash Handler]
#5  0x00000032472329a5 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#6  0x0000003247234185 in abort () at abort.c:92
#7  0x000000324726fe0b in __libc_message (do_abort=2, fmt=0x3247343ab8 "*** glibc detected *** %s: %s: 0x%s ***\n") at ../sysdeps/unix/sysv/linux/libc_fatal.c:186
#8  0x0000003247275726 in malloc_printerr (action=3, str=0x3247343d88 "free(): invalid next size (normal)", ptr=<value optimized out>) at malloc.c:6283
#9  0x00007f6df44f1b0e in mdb_xfer_bound_data (mdb=<value optimized out>, start=<value optimized out>, col=0x306bbc0, len=<value optimized out>)
    at /usr/src/debug/koffice-2.2.0/kexi/migration/mdb/src/mdbtools/libmdb/data.c:234
#10 0x00007f6df44f1dc8 in _mdb_attempt_bind (table=0x306e430, row=<value optimized out>) at /usr/src/debug/koffice-2.2.0/kexi/migration/mdb/src/mdbtools/libmdb/data.c:314
#11 mdb_read_row (table=0x306e430, row=<value optimized out>) at /usr/src/debug/koffice-2.2.0/kexi/migration/mdb/src/mdbtools/libmdb/data.c:292
#12 0x00007f6df44f1f07 in mdb_fetch_row (table=0x306e430) at /usr/src/debug/koffice-2.2.0/kexi/migration/mdb/src/mdbtools/libmdb/data.c:410
#13 0x00007f6df44ee0e4 in KexiMigration::MDBMigrate::drv_copyTable (this=0x2ec05a0, srcTable=<value optimized out>, destConn=0x30517b0, dstTable=0x3048430)
    at /usr/src/debug/koffice-2.2.0/kexi/migration/mdb/src/keximdb/mdbmigrate.cpp:283
#14 0x00007f6df6a6cb82 in KexiMigration::KexiMigrate::performImport (this=0x2ec05a0, result=<value optimized out>) at /usr/src/debug/koffice-2.2.0/kexi/migration/keximigrate.cpp:378
#15 0x00007f6df6a767ab in KexiMigration::ImportWizard::import (this=0x2a236d0) at /usr/src/debug/koffice-2.2.0/kexi/migration/importwizard.cpp:810
#16 0x00007f6df6a76e84 in KexiMigration::ImportWizard::next (this=0x2a236d0) at /usr/src/debug/koffice-2.2.0/kexi/migration/importwizard.cpp:895
#17 0x0000003c2d376031 in KAssistantDialog::qt_metacall (this=0x2a236d0, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=<value optimized out>)
    at /usr/src/debug/kdelibs-4.4.4/x86_64-redhat-linux-gnu/kdeui/kassistantdialog.moc:76
#18 0x00007f6df6a78010 in KexiMigration::ImportWizard::qt_metacall (this=0x2a236d0, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fffefdca7f0)
    at /usr/src/debug/koffice-2.2.0/x86_64-redhat-linux-gnu/kexi/migration/importwizard.moc:78
#19 0x0000003c2ad6a81f in QMetaObject::activate (sender=0x2a236d0, m=<value optimized out>, local_signal_index=<value optimized out>, argv=0x0) at kernel/qobject.cpp:3293
#20 0x0000003c2d386cf0 in KDialog::slotButtonClicked (this=0x2a236d0, button=8192) at /usr/src/debug/kdelibs-4.4.4/kdeui/dialogs/kdialog.cpp:875
#21 0x0000003c2d388ac2 in KDialog::qt_metacall (this=0x2a236d0, _c=QMetaObject::InvokeMetaMethod, _id=33, _a=0x7fffefdcaa30)
    at /usr/src/debug/kdelibs-4.4.4/x86_64-redhat-linux-gnu/kdeui/kdialog.moc:190
#22 0x0000003c2d43ab40 in KPageDialog::qt_metacall (this=0x2a236d0, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fffefdcaa30)
    at /usr/src/debug/kdelibs-4.4.4/x86_64-redhat-linux-gnu/kdeui/kpagedialog.moc:70
#23 0x0000003c2d375fc8 in KAssistantDialog::qt_metacall (this=0x2a236d0, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=<value optimized out>)
    at /usr/src/debug/kdelibs-4.4.4/x86_64-redhat-linux-gnu/kdeui/kassistantdialog.moc:70
#24 0x00007f6df6a78010 in KexiMigration::ImportWizard::qt_metacall (this=0x2a236d0, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fffefdcaa30)
    at /usr/src/debug/koffice-2.2.0/x86_64-redhat-linux-gnu/kexi/migration/importwizard.moc:78
#25 0x0000003c2ad6a81f in QMetaObject::activate (sender=0x2a23968, m=<value optimized out>, local_signal_index=<value optimized out>, argv=0x7fffefdcaa30) at kernel/qobject.cpp:3293
#26 0x0000003c2ad6deae in QSignalMapper::mapped (this=<value optimized out>, _t1=8192) at .moc/release-shared/moc_qsignalmapper.cpp:101
#27 0x0000003c2ad6df50 in QSignalMapper::map (this=0x2a23968, sender=0x2a34680) at kernel/qsignalmapper.cpp:266
#28 0x0000003c2ad6f220 in QSignalMapper::qt_metacall (this=0x2a23968, _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0x7fffefdcabc0) at .moc/release-shared/moc_qsignalmapper.cpp:87
#29 0x0000003c2ad6a81f in QMetaObject::activate (sender=0x2a34680, m=<value optimized out>, local_signal_index=<value optimized out>, argv=0x7fffefdcabc0) at kernel/qobject.cpp:3293
#30 0x0000003c2cbdf8b2 in QAbstractButton::clicked (this=<value optimized out>, _t1=false) at .moc/release-shared/moc_qabstractbutton.cpp:206
#31 0x0000003c2c92f06b in QAbstractButtonPrivate::emitClicked (this=<value optimized out>) at widgets/qabstractbutton.cpp:546
#32 0x0000003c2c9303eb in QAbstractButtonPrivate::click (this=0x2a346c0) at widgets/qabstractbutton.cpp:539
#33 0x0000003c2c93065c in QAbstractButton::mouseReleaseEvent (this=0x2a34680, e=0x7fffefdcb510) at widgets/qabstractbutton.cpp:1121
#34 0x0000003c2c5f5b6a in QWidget::event (this=0x2a34680, event=0x7fffefdcb510) at kernel/qwidget.cpp:7998
#35 0x0000003c2c5aa9cc in QApplicationPrivate::notify_helper (this=0x1dfc410, receiver=0x2a34680, e=0x7fffefdcb510) at kernel/qapplication.cpp:4304
#36 0x0000003c2c5b115d in QApplication::notify (this=<value optimized out>, receiver=0x2a34680, e=0x7fffefdcb510) at kernel/qapplication.cpp:3869
#37 0x0000003c2d406e86 in KApplication::notify (this=0x1df8660, receiver=0x2a34680, event=0x7fffefdcb510) at /usr/src/debug/kdelibs-4.4.4/kdeui/kernel/kapplication.cpp:302
#38 0x0000003c2ad57cdc in QCoreApplication::notifyInternal (this=0x1df8660, receiver=0x2a34680, event=0x7fffefdcb510) at kernel/qcoreapplication.cpp:704
#39 0x0000003c2c5b034e in sendEvent (receiver=0x2a34680, event=0x7fffefdcb510, alienWidget=0x2a34680, nativeWidget=0x2a23530, buttonDown=0x3c2d02b2a8, lastMouseReceiver=..., spontaneous=true)
    at ../../src/corelib/kernel/qcoreapplication.h:215
#40 QApplicationPrivate::sendMouseEvent (receiver=0x2a34680, event=0x7fffefdcb510, alienWidget=0x2a34680, nativeWidget=0x2a23530, buttonDown=0x3c2d02b2a8, lastMouseReceiver=..., spontaneous=true)
    at kernel/qapplication.cpp:2969
#41 0x0000003c2c622475 in QETWidget::translateMouseEvent (this=0x2a23530, event=<value optimized out>) at kernel/qapplication_x11.cpp:4373
#42 0x0000003c2c620dec in QApplication::x11ProcessEvent (this=0x1df8660, event=0x7fffefdcbe30) at kernel/qapplication_x11.cpp:3506
#43 0x0000003c2c649dc2 in x11EventSourceDispatch (s=0x1dff7d0, callback=0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146
#44 0x0000003248a3bd02 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#45 0x0000003248a3fae8 in ?? () from /lib64/libglib-2.0.so.0
#46 0x0000003248a3fc9c in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#47 0x0000003c2ad7d603 in QEventDispatcherGlib::processEvents (this=0x1dd6700, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:412
#48 0x0000003c2c649a8e in QGuiEventDispatcherGlib::processEvents (this=<value optimized out>, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:204
#49 0x0000003c2ad56722 in QEventLoop::processEvents (this=<value optimized out>, flags=...) at kernel/qeventloop.cpp:149
#50 0x0000003c2ad569ec in QEventLoop::exec (this=0x7fffefdcc160, flags=...) at kernel/qeventloop.cpp:201
#51 0x0000003c2ca2b3fe in QDialog::exec (this=0x2a236d0) at dialogs/qdialog.cpp:546
#52 0x00000033b143c1b8 in KexiMainWindow::showProjectMigrationWizard (this=0x2902f50, mimeType=<value optimized out>, databaseName=..., cdata=0x0)
    at /usr/src/debug/koffice-2.2.0/kexi/main/KexiMainWindow.cpp:4797
#53 0x00000033b144004c in KexiMainWindow::startup (this=0x2902f50) at /usr/src/debug/koffice-2.2.0/kexi/main/KexiMainWindow.cpp:1509
#54 0x00000033b144b87a in KexiMainWindow::create (argc=<value optimized out>, argv=0x7fffefdcc588, aboutdata=<value optimized out>) at /usr/src/debug/koffice-2.2.0/kexi/main/KexiMainWindow.cpp:285
#55 0x0000000000400938 in main (argc=<value optimized out>, argv=<value optimized out>) at /usr/src/debug/koffice-2.2.0/kexi/main.cpp:30

Reported using DrKonqi
Comment 1 Jarosław Staniek 2010-07-12 21:19:30 UTC
Hi, thanks for reporting!

Small test database that causes the crash would help a lot. 
Bug https://bugs.kde.org/show_bug.cgi?id=240343 may be similar. 

I somewhat think we have a problem with 64bit machines.
If you can, please try to import the same file on a 32bit machine using Kexi 2.2.0.
Comment 2 Steve Dowe 2010-07-14 12:10:04 UTC
Thanks for your quick response! :)

Yes, I think Bug #240343 may be similar.  I obtained an i686 version of the KDE spin of Fedora 13, installed as a VM.

Again, ran through the same procedure and it occurs at exactly the same moment as it does on the x86_64 version.

The database I'm trying to import is commercially sensitive, but I will provide some information by email to you.

Many thanks.
Comment 3 Jarosław Staniek 2010-07-19 00:01:43 UTC
SVN commit 1151354 by staniek:

Migration
*support multipage (large up to 65535 bytes) memo values
BUG:244420



 M  +8 -0      keximdb/mdbmigrate.cpp  
 M  +19 -2     mdbtools/libmdb/data.c  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1151354
Comment 4 Jarosław Staniek 2010-07-19 00:10:51 UTC
Steve, 
Big thanks for your test data. There appears to be pilsarticles.HTMLText memo field that contains more than 16KB of data. 
The above fix adds support for <=64KB of data per value. 
You can use the source from KDE SVN or apply these patches to your code:

http://websvn.kde.org/trunk/koffice/kexi/migration/mdb/src/keximdb/mdbmigrate.cpp?r1=1089606&r2=1151354&pathrev=1151354&view=patch

http://websvn.kde.org/trunk/koffice/kexi/migration/mdb/src/mdbtools/libmdb/data.c?r1=1021308&r2=1151354&pathrev=1151354&view=patch

PS: I noticed that the display routines of table view is not optimized for such large text values. Optimizing this remains as a TODO.
Comment 5 Jarosław Staniek 2010-09-08 10:50:42 UTC
SVN commit 1172932 by staniek:

Migration
*backport of r1151354 (trunk): support multipage (large up to 65535 bytes) memo values for MS Access files

CCBUG:244420



 M  +8 -0      keximdb/mdbmigrate.cpp  
 M  +19 -2     mdbtools/libmdb/data.c  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1172932