Bug 380832

Summary: tellico 3.0.2 crashes on save with or without images in data file
Product: [Applications] tellico Reporter: goupilcom <goupilcom>
Component: generalAssignee: Robby Stephenson <robby>
Status: RESOLVED FIXED    
Severity: crash    
Priority: NOR    
Version: 3.0.2   
Target Milestone: ---   
Platform: Debian unstable   
OS: Linux   
Latest Commit: Version Fixed In: 3.1
Attachments: The complete messages on console of Tellico 3.0.2 when it crash
The same operation with gdb tellico (+bt)

Description goupilcom@gmail.com 2017-06-04 17:23:14 UTC
I maintain a big database (http://www.lebottindesjeuxlinux.tuxfamily.org/) of 4843 records with images.
With 2.3.9 version of Tellico i can save records without problem.
With 3.0.2 version of Tellico, whenever i modified a record and try to save Tellico file : it crash.
When i downgrade to 2.3.9 version, and take the same database, it doesn't crash.

Maybe Tellico does not wait enough for the file to save on the disk?
(the database is big)

Other information : 
/usr/lib/i386-linux-gnu/libQt5XcbQpa.so.5 is not in Debian Sid repositories
is it important for Tellico ?


Crash report : 
"Exécutable : tellico PID : 14514 Signal : Aborted (6) Temps : 04/06/2017 19:11:23"

Application: Tellico (tellico), signal: Aborted
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0xae3a6b00 (LWP 14514))]

Thread 3 (Thread 0xad2f8b40 (LWP 14517)):
#0  0xb156aa68 in g_mutex_unlock () from /lib/i386-linux-gnu/libglib-2.0.so.0
#1  0xb15224a3 in g_main_context_acquire () from /lib/i386-linux-gnu/libglib-2.0.so.0
#2  0xb15235b8 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#3  0xb1523854 in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0
#4  0xb48844b4 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/i386-linux-gnu/sse2/libQt5Core.so.5
#5  0xb482883d in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/i386-linux-gnu/sse2/libQt5Core.so.5
#6  0xb4651e95 in QThread::exec() () from /usr/lib/i386-linux-gnu/sse2/libQt5Core.so.5
#7  0xb5da6fdc in ?? () from /usr/lib/i386-linux-gnu/libQt5DBus.so.5
#8  0xb465732a in ?? () from /usr/lib/i386-linux-gnu/sse2/libQt5Core.so.5
#9  0xb425827a in start_thread (arg=0xad2f8b40) at pthread_create.c:333
#10 0xb435bb56 in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:110

Thread 2 (Thread 0xae011b40 (LWP 14516)):
#0  0xb7730dad in __kernel_vsyscall ()
#1  0xb4351c5f in poll () at ../sysdeps/unix/syscall-template.S:84
#2  0xb19621dd in ?? () from /usr/lib/i386-linux-gnu/libxcb.so.1
#3  0xb1964553 in xcb_wait_for_event () from /usr/lib/i386-linux-gnu/libxcb.so.1
#4  0xae0b9853 in ?? () from /usr/lib/i386-linux-gnu/libQt5XcbQpa.so.5
#5  0xb465732a in ?? () from /usr/lib/i386-linux-gnu/sse2/libQt5Core.so.5
#6  0xb425827a in start_thread (arg=0xae011b40) at pthread_create.c:333
#7  0xb435bb56 in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:110

Thread 1 (Thread 0xae3a6b00 (LWP 14514)):
[KCrash Handler]
#7  0xb7730dad in __kernel_vsyscall ()
#8  0xb429fdc0 in __libc_signal_restore_set (set=0xbf8f6bc0) at ../sysdeps/unix/sysv/linux/nptl-signals.h:79
#9  __GI_raise (sig=6) at ../sysdeps/unix/sysv/linux/raise.c:48
#10 0xb42a1287 in __GI_abort () at abort.c:89
#11 0xb44be2ff in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/i386-linux-gnu/libstdc++.so.6
#12 0xb44bbea4 in ?? () from /usr/lib/i386-linux-gnu/libstdc++.so.6
#13 0xb44bbf1d in std::terminate() () from /usr/lib/i386-linux-gnu/libstdc++.so.6
#14 0xb44bc1d0 in __cxa_throw () from /usr/lib/i386-linux-gnu/libstdc++.so.6
#15 0xb4638166 in qBadAlloc() () from /usr/lib/i386-linux-gnu/sse2/libQt5Core.so.5
#16 0xb46cbad9 in QString::reallocData(unsigned int, bool) () from /usr/lib/i386-linux-gnu/sse2/libQt5Core.so.5
#17 0xb46cc46a in QString::append(QChar const*, int) () from /usr/lib/i386-linux-gnu/sse2/libQt5Core.so.5
#18 0xb4767603 in QTextStream::operator<<(QString const&) () from /usr/lib/i386-linux-gnu/sse2/libQt5Core.so.5
#19 0xb58937de in ?? () from /usr/lib/i386-linux-gnu/libQt5Xml.so.5
#20 0xb589eeff in ?? () from /usr/lib/i386-linux-gnu/libQt5Xml.so.5
#21 0xb589eeff in ?? () from /usr/lib/i386-linux-gnu/libQt5Xml.so.5
#22 0xb589eeff in ?? () from /usr/lib/i386-linux-gnu/libQt5Xml.so.5
#23 0xb589eeff in ?? () from /usr/lib/i386-linux-gnu/libQt5Xml.so.5
#24 0xb5899fc7 in ?? () from /usr/lib/i386-linux-gnu/libQt5Xml.so.5
#25 0xb589f438 in QDomDocument::toString(int) const () from /usr/lib/i386-linux-gnu/libQt5Xml.so.5
#26 0x802cc222 in ?? ()
#27 0x800f853c in ?? ()
#28 0x80141c63 in ?? ()
#29 0x8015ab01 in ?? ()
#30 0xb4858fdb in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/i386-linux-gnu/sse2/libQt5Core.so.5
#31 0xb485985d in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/i386-linux-gnu/sse2/libQt5Core.so.5
#32 0xb50f2eb9 in QAction::triggered(bool) () from /usr/lib/i386-linux-gnu/libQt5Widgets.so.5
#33 0xb50f5b91 in QAction::activate(QAction::ActionEvent) () from /usr/lib/i386-linux-gnu/libQt5Widgets.so.5
#34 0xb52d455b in QToolButton::nextCheckState() () from /usr/lib/i386-linux-gnu/libQt5Widgets.so.5
#35 0xb51f29e7 in ?? () from /usr/lib/i386-linux-gnu/libQt5Widgets.so.5
#36 0xb51f2c3f in QAbstractButton::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/i386-linux-gnu/libQt5Widgets.so.5
#37 0xb52d44e1 in QToolButton::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/i386-linux-gnu/libQt5Widgets.so.5
#38 0xb514758a in QWidget::event(QEvent*) () from /usr/lib/i386-linux-gnu/libQt5Widgets.so.5
#39 0xb51f40b8 in QAbstractButton::event(QEvent*) () from /usr/lib/i386-linux-gnu/libQt5Widgets.so.5
#40 0xb52d4635 in QToolButton::event(QEvent*) () from /usr/lib/i386-linux-gnu/libQt5Widgets.so.5
#41 0xb50fa17a in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/i386-linux-gnu/libQt5Widgets.so.5
#42 0xb5102efa in QApplication::notify(QObject*, QEvent*) () from /usr/lib/i386-linux-gnu/libQt5Widgets.so.5
#43 0xb482ac5d in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/i386-linux-gnu/sse2/libQt5Core.so.5
#44 0xb510151d in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () from /usr/lib/i386-linux-gnu/libQt5Widgets.so.5
#45 0xb5164d03 in ?? () from /usr/lib/i386-linux-gnu/libQt5Widgets.so.5
#46 0xb5167eba in ?? () from /usr/lib/i386-linux-gnu/libQt5Widgets.so.5
#47 0xb50fa17a in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/i386-linux-gnu/libQt5Widgets.so.5
#48 0xb510203c in QApplication::notify(QObject*, QEvent*) () from /usr/lib/i386-linux-gnu/libQt5Widgets.so.5
#49 0xb482ac5d in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/i386-linux-gnu/sse2/libQt5Core.so.5
#50 0xb4b6dc98 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () from /usr/lib/i386-linux-gnu/sse2/libQt5Gui.so.5
#51 0xb4b6fa49 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () from /usr/lib/i386-linux-gnu/sse2/libQt5Gui.so.5
#52 0xb4b4a58c in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/i386-linux-gnu/sse2/libQt5Gui.so.5
#53 0xae0f3bae in ?? () from /usr/lib/i386-linux-gnu/libQt5XcbQpa.so.5
#54 0xb15234e9 in g_main_context_dispatch () from /lib/i386-linux-gnu/libglib-2.0.so.0
#55 0xb1523789 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#56 0xb1523854 in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0
#57 0xb4884493 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/i386-linux-gnu/sse2/libQt5Core.so.5
#58 0xae0f3d81 in ?? () from /usr/lib/i386-linux-gnu/libQt5XcbQpa.so.5
#59 0xb482883d in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/i386-linux-gnu/sse2/libQt5Core.so.5
#60 0xb483199f in QCoreApplication::exec() () from /usr/lib/i386-linux-gnu/sse2/libQt5Core.so.5
#61 0xb4b64aa1 in QGuiApplication::exec() () from /usr/lib/i386-linux-gnu/sse2/libQt5Gui.so.5
#62 0xb50fa0d4 in QApplication::exec() () from /usr/lib/i386-linux-gnu/libQt5Widgets.so.5
#63 0x800b07e0 in ?? ()
#64 0xb428c276 in __libc_start_main (main=0x800afbb0, argc=4, argv=0xbf8f8384, init=0x803484d0 <__libc_csu_init>, fini=0x80348530 <__libc_csu_fini>, rtld_fini=0xb77418b0 <_dl_fini>, stack_end=0xbf8f837c) at ../csu/libc-start.c:291
#65 0x800b1d19 in _start ()
Comment 1 Robby Stephenson 2017-07-01 02:22:41 UTC
Thanks for the report.  I haven't been able to reproduce the crash myself yet, but the size of your database file does make it a good one to use for performance improvements, too.
Comment 2 Robby Stephenson 2017-07-02 22:37:53 UTC
Are you compiling from source? Your backtrace doesn't include any of Tellico's symbol which might be helpful. Using CMAKE_BUILD_TYPE=debugfull in your compile would do it - or maybe your distribution has debug package for Tellico? Thanks
Comment 3 Robby Stephenson 2017-07-03 01:19:57 UTC
Git commit 1a828b340ca72b18f04c05a95422f741fffe502a by Robby Stephenson.
Committed on 03/07/2017 at 00:56.
Pushed by rstephenson into branch 'master'.

Split very large XML files into chunks when writing to QTextStream

I could reproduce the crash in Bug 380832 when writing an XML file
aroud 500 MB. Splitting the writing into 100 MB chunks fixed my crash.
I don't know how to pick the best chunk size or how to properly catch
an out of memory (bad_alloc) exception which seems to happen.

I could reproduce the bug in Tellico 2.3.12, so that seems like a bit
different experience than the bug reporter.

Also, as a To DO item, Tellico should switch to using QXmlStreamWriter
instead of QDomDcument::toString() for these big files, especially.
FIXED-IN: 3.1

M  +1    -0    ChangeLog
M  +10   -3    src/core/filehandler.cpp

https://commits.kde.org/tellico/1a828b340ca72b18f04c05a95422f741fffe502a
Comment 4 goupilcom@gmail.com 2017-07-06 18:04:15 UTC
Created attachment 106470 [details]
The complete messages on console of Tellico 3.0.2 when it crash

The complete messages on console of Tellico 3.0.2 when it crash
Comment 5 goupilcom@gmail.com 2017-07-06 18:08:14 UTC
The messages on console when it crash with Tellico 3.0.2 compiled with the option $ make -j8 CMAKE_BUILD_TYPE=debugfull
Comment 6 goupilcom@gmail.com 2017-07-06 18:17:46 UTC
(In reply to Robby Stephenson from comment #2)
> Are you compiling from source? Your backtrace doesn't include any of
> Tellico's symbol which might be helpful. Using CMAKE_BUILD_TYPE=debugfull in
> your compile would do it - or maybe your distribution has debug package for
> Tellico? Thanks

I had compiling Tellico 3.0.2 another time with the option : CMAKE_BUILD_TYPE=debugfull

cmake . -DCMAKE_BUILD_TYPE=debugfull
make -j8

I have lauched Tellico : $ ./tellico
Then i have only modified a date (a year) on a record and saved the record (no crash) then i have saved the data base. As the last time, Tellico crash at 80%.
And i have joined the result on the attach file above
Comment 7 goupilcom@gmail.com 2017-07-06 18:20:52 UTC
(In reply to Robby Stephenson from comment #3)
> Git commit 1a828b340ca72b18f04c05a95422f741fffe502a by Robby Stephenson.
> Committed on 03/07/2017 at 00:56.
> Pushed by rstephenson into branch 'master'.
> 
> Split very large XML files into chunks when writing to QTextStream
> 
> I could reproduce the crash in Bug 380832 when writing an XML file
> aroud 500 MB. Splitting the writing into 100 MB chunks fixed my crash.
> I don't know how to pick the best chunk size or how to properly catch
> an out of memory (bad_alloc) exception which seems to happen.
> 
> I could reproduce the bug in Tellico 2.3.12, so that seems like a bit
> different experience than the bug reporter.
> 
> Also, as a To DO item, Tellico should switch to using QXmlStreamWriter
> instead of QDomDcument::toString() for these big files, especially.
> FIXED-IN: 3.1
> 
> M  +1    -0    ChangeLog
> M  +10   -3    src/core/filehandler.cpp
> 
> https://commits.kde.org/tellico/1a828b340ca72b18f04c05a95422f741fffe502a

Thank you very much
Comment 8 goupilcom@gmail.com 2017-07-06 18:43:14 UTC
Created attachment 106471 [details]
The same operation with gdb tellico (+bt)