Bug 391060 - crashes on undo of very large tif
Summary: crashes on undo of very large tif
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: ImageEditor-Undo (show other bugs)
Version: 5.2.0
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2018-02-25 19:30 UTC by rens
Modified: 2018-04-28 22:36 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 6.0.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rens 2018-02-25 19:30:32 UTC
Application: showfoto (5.2.0)

Qt Version: 5.6.1
Frameworks Version: 5.26.0
Operating System: Linux 4.4.92-18.36-default x86_64
Distribution: "openSUSE Leap 42.2"

-- Information about the crash:
750 mbyte tif 
cropped a part of it. saved it under different name. all ok.
then tried to undo crop (in order to crop another part and save that....)
showfoto crashed.

The crash can be reproduced every time.

-- Backtrace:
Application: Showfoto (showfoto), signal: Aborted
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7fb2f7dbb9c0 (LWP 8242))]

Thread 5 (Thread 0x7fb2affff700 (LWP 8273)):
#0  0x00007fb2f34cc0bf in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007fb2f431565b in QWaitCondition::wait(QMutex*, unsigned long) () at /usr/lib64/libQt5Core.so.5
#2  0x00007fb2f5403211 in  () at /usr/lib64/libQt5Widgets.so.5
#3  0x00007fb2f43149e9 in  () at /usr/lib64/libQt5Core.so.5
#4  0x00007fb2f34c7744 in start_thread () at /lib64/libpthread.so.0
#5  0x00007fb2f3a0baad in clone () at /lib64/libc.so.6

Thread 4 (Thread 0x7fb2be031700 (LWP 8245)):
#0  0x00007fb2f34cc0bf in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007fb2f431565b in QWaitCondition::wait(QMutex*, unsigned long) () at /usr/lib64/libQt5Core.so.5
#2  0x00007fb2f71d33c9 in  () at /usr/lib64/libdigikamcore.so.5.2.0
#3  0x00007fb2f43149e9 in  () at /usr/lib64/libQt5Core.so.5
#4  0x00007fb2f34c7744 in start_thread () at /lib64/libpthread.so.0
#5  0x00007fb2f3a0baad in clone () at /lib64/libc.so.6

Thread 3 (Thread 0x7fb2c6e70700 (LWP 8244)):
#0  0x00007fb2f39ff28d in read () at /lib64/libc.so.6
#1  0x00007fb2eaf5e670 in  () at /usr/lib64/libglib-2.0.so.0
#2  0x00007fb2eaf1de49 in g_main_context_check () at /usr/lib64/libglib-2.0.so.0
#3  0x00007fb2eaf1e2a8 in  () at /usr/lib64/libglib-2.0.so.0
#4  0x00007fb2eaf1e42c in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0
#5  0x00007fb2f452733b in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5
#6  0x00007fb2f44d4feb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5
#7  0x00007fb2f430ff1a in QThread::exec() () at /usr/lib64/libQt5Core.so.5
#8  0x00007fb2f5903295 in  () at /usr/lib64/libQt5DBus.so.5
#9  0x00007fb2f43149e9 in  () at /usr/lib64/libQt5Core.so.5
#10 0x00007fb2f34c7744 in start_thread () at /lib64/libpthread.so.0
#11 0x00007fb2f3a0baad in clone () at /lib64/libc.so.6

Thread 2 (Thread 0x7fb2ceb30700 (LWP 8243)):
#0  0x00007fb2f3a0320d in poll () at /lib64/libc.so.6
#1  0x00007fb2e56d43e2 in  () at /usr/lib64/libxcb.so.1
#2  0x00007fb2e56d5fcf in xcb_wait_for_event () at /usr/lib64/libxcb.so.1
#3  0x00007fb2d0612839 in  () at /usr/lib64/libQt5XcbQpa.so.5
#4  0x00007fb2f43149e9 in  () at /usr/lib64/libQt5Core.so.5
#5  0x00007fb2f34c7744 in start_thread () at /lib64/libpthread.so.0
#6  0x00007fb2f3a0baad in clone () at /lib64/libc.so.6

Thread 1 (Thread 0x7fb2f7dbb9c0 (LWP 8242)):
[KCrash Handler]
#6  0x00007fb2f39568d7 in raise () at /lib64/libc.so.6
#7  0x00007fb2f3957caa in abort () at /lib64/libc.so.6
#8  0x00007fb2f3f7472d in __gnu_cxx::__verbose_terminate_handler() () at /usr/lib64/libstdc++.so.6
#9  0x00007fb2f3f72706 in  () at /usr/lib64/libstdc++.so.6
#10 0x00007fb2f3f72751 in  () at /usr/lib64/libstdc++.so.6
#11 0x00007fb2f3f72968 in  () at /usr/lib64/libstdc++.so.6
#12 0x00007fb2f42fbaa2 in  () at /usr/lib64/libQt5Core.so.5
#13 0x00007fb2f4317b15 in QByteArray::reallocData(unsigned int, QFlags<QArrayData::AllocationOption>) () at /usr/lib64/libQt5Core.so.5
#14 0x00007fb2f4317cdf in QByteArray::resize(int) () at /usr/lib64/libQt5Core.so.5
#15 0x00007fb2f431a1dc in operator>>(QDataStream&, QByteArray&) () at /usr/lib64/libQt5Core.so.5
#16 0x00007fb2f73343cb in Digikam::UndoCache::getData(int) const () at /usr/lib64/libdigikamcore.so.5.2.0
#17 0x00007fb2f7334f65 in Digikam::UndoManager::restoreSnapshot(int, Digikam::UndoMetadataContainer const&) () at /usr/lib64/libdigikamcore.so.5.2.0
#18 0x00007fb2f7336265 in Digikam::UndoManager::undoStep(bool, bool, bool) () at /usr/lib64/libdigikamcore.so.5.2.0
#19 0x00007fb2f7336513 in Digikam::UndoManager::undo() () at /usr/lib64/libdigikamcore.so.5.2.0
#20 0x00007fb2f7338c62 in Digikam::EditorCore::undo() () at /usr/lib64/libdigikamcore.so.5.2.0
#21 0x00007fb2f7388a25 in Digikam::Canvas::slotUndo(int) () at /usr/lib64/libdigikamcore.so.5.2.0
#22 0x00007fb2f4500bc1 in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib64/libQt5Core.so.5
#23 0x00007fb2f450be9e in QSignalMapper::mapped(int) () at /usr/lib64/libQt5Core.so.5
#24 0x00007fb2f450ca3f in QSignalMapper::map(QObject*) () at /usr/lib64/libQt5Core.so.5
#25 0x00007fb2f4500bc1 in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib64/libQt5Core.so.5
#26 0x00007fb2f51d4892 in QAction::triggered(bool) () at /usr/lib64/libQt5Widgets.so.5
#27 0x00007fb2f51d742d in QAction::activate(QAction::ActionEvent) () at /usr/lib64/libQt5Widgets.so.5
#28 0x00007fb2f5352582 in  () at /usr/lib64/libQt5Widgets.so.5
#29 0x00007fb2f5357730 in  () at /usr/lib64/libQt5Widgets.so.5
#30 0x00007fb2f535b27b in QMenu::mouseReleaseEvent(QMouseEvent*) () at /usr/lib64/libQt5Widgets.so.5
#31 0x00007fb2f521fc9a in QWidget::event(QEvent*) () at /usr/lib64/libQt5Widgets.so.5
#32 0x00007fb2f535bbbb in QMenu::event(QEvent*) () at /usr/lib64/libQt5Widgets.so.5
#33 0x00007fb2f51dde3c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib64/libQt5Widgets.so.5
#34 0x00007fb2f51e2d14 in QApplication::notify(QObject*, QEvent*) () at /usr/lib64/libQt5Widgets.so.5
#35 0x00007fb2f44d6fd5 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib64/libQt5Core.so.5
#36 0x00007fb2f51e1a10 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () at /usr/lib64/libQt5Widgets.so.5
#37 0x00007fb2f5238eb4 in  () at /usr/lib64/libQt5Widgets.so.5
#38 0x00007fb2f523aeb3 in  () at /usr/lib64/libQt5Widgets.so.5
#39 0x00007fb2f51dde3c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib64/libQt5Widgets.so.5
#40 0x00007fb2f51e249a in QApplication::notify(QObject*, QEvent*) () at /usr/lib64/libQt5Widgets.so.5
#41 0x00007fb2f44d6fd5 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib64/libQt5Core.so.5
#42 0x00007fb2f4a2a68b in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () at /usr/lib64/libQt5Gui.so.5
#43 0x00007fb2f4a2be05 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () at /usr/lib64/libQt5Gui.so.5
#44 0x00007fb2f4a0deeb in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Gui.so.5
#45 0x00007fb2d063fbc0 in  () at /usr/lib64/libQt5XcbQpa.so.5
#46 0x00007fb2eaf1e134 in g_main_context_dispatch () at /usr/lib64/libglib-2.0.so.0
#47 0x00007fb2eaf1e388 in  () at /usr/lib64/libglib-2.0.so.0
#48 0x00007fb2eaf1e42c in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0
#49 0x00007fb2f452731c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5
#50 0x00007fb2f44d4feb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5
#51 0x00007fb2f44dced6 in QCoreApplication::exec() () at /usr/lib64/libQt5Core.so.5
#52 0x0000000000433568 in  ()
#53 0x00007fb2f39426e5 in __libc_start_main () at /lib64/libc.so.6
#54 0x0000000000433ed9 in _start ()

Reported using DrKonqi
Comment 1 Maik Qualmann 2018-02-25 20:22:50 UTC
It crashes in QByteArray. The maximum size for a QByteArray is 2GB. I have created a test image with 1.5GB and could not reproduce the problem. How much memory do you have in your computer?

Please try with the digiKam-5.9.0 pre-release AppImage:

https://files.kde.org/digikam/

Maik
Comment 2 rens 2018-02-27 23:32:23 UTC
I do not know about what happens under the hood.
750 mbyte is on disk. and it is a compressed TIFF. no idea how big it is in real memory.
Comment 3 Maik Qualmann 2018-04-28 22:36:03 UTC
Git commit 3a8b71fa6224a172f4ba7f54ee64362d171d3480 by Maik Qualmann.
Committed on 28/04/2018 at 22:33.
Pushed by mqualmann into branch 'master'.

replace QByteArray with DImg buffer to write undo files larger than 2gb
FIXED-IN: 6.0.0

M  +2    -1    NEWS
M  +13   -6    core/utilities/imageeditor/core/undocache.cpp

https://commits.kde.org/digikam/3a8b71fa6224a172f4ba7f54ee64362d171d3480