Bug 285849 - digikam crashes when resizing the crop area
Summary: digikam crashes when resizing the crop area
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-Editor-Crop (show other bugs)
Version: 2.1.1
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-05 19:16 UTC by Rudolf Leitgeb
Modified: 2021-12-29 13:53 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 7.5.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rudolf Leitgeb 2011-11-05 19:16:26 UTC
Application: digikam (2.1.1)
KDE Platform Version: 4.7.2 (4.7.2)
Qt Version: 4.7.4
Operating System: Linux 3.0.0-12-generic x86_64
Distribution: Ubuntu 11.10

-- Information about the crash:
- What I was doing when the application crashed:

1. pick image in digikam, hit F4 for editing
2. draw rectangle within image area for cropping
3. resize crop area by moving its vertical and/or horizontal boundary lines with the mouse

It is hard to reproduce and (fortunatelyfor me as user) happens only occasionally, but it's certainly annoying.

The crash can be reproduced some of the time.

-- Backtrace:
Application: digiKam (digikam), signal: Segmentation fault
[Current thread is 1 (Thread 0x7f54c0eaaa20 (LWP 24496))]

Thread 5 (Thread 0x7f549ff6e700 (LWP 24497)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162
#1  0x00007f54bb8271ab in wait (time=18446744073709551615, this=0x17d1be0) at thread/qwaitcondition_unix.cpp:88
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x17dd528, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:160
#3  0x00000000005c2e20 in Digikam::ScanController::run (this=0x18472e0) at /build/buildd/digikam-2.1.1/core/digikam/database/scancontroller.cpp:647
#4  0x00007f54bb826d05 in QThreadPrivate::start (arg=0x18472e0) at thread/qthread_unix.cpp:331
#5  0x00007f54b6564efc in start_thread (arg=0x7f549ff6e700) at pthread_create.c:304
#6  0x00007f54baac989d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#7  0x0000000000000000 in ?? ()

Thread 4 (Thread 0x7f549f76d700 (LWP 24498)):
#0  0x00007f54baabd773 in __GI___poll (fds=<optimized out>, nfds=<optimized out>, timeout=<optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00007f54b4641f68 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f54b4642429 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f54bb938f3e in QEventDispatcherGlib::processEvents (this=0x18288b0, flags=<optimized out>) at kernel/qeventdispatcher_glib.cpp:424
#4  0x00007f54bb90ccf2 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007f54bb90cef7 in QEventLoop::exec (this=0x7f549f76cb30, flags=...) at kernel/qeventloop.cpp:201
#6  0x00007f54bb82427f in QThread::exec (this=<optimized out>) at thread/qthread.cpp:498
#7  0x00007f54bb8efcbf in QInotifyFileSystemWatcherEngine::run (this=0x183e830) at io/qfilesystemwatcher_inotify.cpp:248
#8  0x00007f54bb826d05 in QThreadPrivate::start (arg=0x183e830) at thread/qthread_unix.cpp:331
#9  0x00007f54b6564efc in start_thread (arg=0x7f549f76d700) at pthread_create.c:304
#10 0x00007f54baac989d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#11 0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7f549ef6c700 (LWP 24507)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162
#1  0x00007f54bb8271ab in wait (time=18446744073709551615, this=0x20dc290) at thread/qwaitcondition_unix.cpp:88
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x20dbe18, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:160
#3  0x00007f54be76b737 in Digikam::ParkingThread::run (this=0x20dbe00) at /build/buildd/digikam-2.1.1/core/libs/threads/threadmanager.cpp:119
#4  0x00007f54bb826d05 in QThreadPrivate::start (arg=0x20dbe00) at thread/qthread_unix.cpp:331
#5  0x00007f54b6564efc in start_thread (arg=0x7f549ef6c700) at pthread_create.c:304
#6  0x00007f54baac989d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#7  0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7f5497fff700 (LWP 24508)):
#0  0x00007f54baabd773 in __GI___poll (fds=<optimized out>, nfds=<optimized out>, timeout=<optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00007f54b4641f68 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f54b4642429 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f54bb938f3e in QEventDispatcherGlib::processEvents (this=0x2266570, flags=<optimized out>) at kernel/qeventdispatcher_glib.cpp:424
#4  0x00007f54bb90ccf2 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007f54bb90cef7 in QEventLoop::exec (this=0x7f5497ffeb30, flags=...) at kernel/qeventloop.cpp:201
#6  0x00007f54bb82427f in QThread::exec (this=<optimized out>) at thread/qthread.cpp:498
#7  0x00007f54bb8efcbf in QInotifyFileSystemWatcherEngine::run (this=0x2265950) at io/qfilesystemwatcher_inotify.cpp:248
#8  0x00007f54bb826d05 in QThreadPrivate::start (arg=0x2265950) at thread/qthread_unix.cpp:331
#9  0x00007f54b6564efc in start_thread (arg=0x7f5497fff700) at pthread_create.c:304
#10 0x00007f54baac989d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#11 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f54c0eaaa20 (LWP 24496)):
[KCrash Handler]
#6  Digikam::ImageHistogram::calculateInThread (this=0x0) at /build/buildd/digikam-2.1.1/core/libs/dimg/filters/levels/imagehistogram.cpp:143
#7  0x00007f54be658566 in Digikam::HistogramWidget::updateSelectionData (this=<optimized out>, s_data=<optimized out>, s_w=<optimized out>, s_h=<optimized out>, i_sixteenBits=<optimized out>, showProgress=<optimized out>) at /build/buildd/digikam-2.1.1/core/libs/dimg/filters/levels/histogramwidget.cpp:260
#8  0x00007f54be806cd9 in Digikam::ImagePropertiesColorsTab::setSelection (this=0x3966290, selectionArea=<optimized out>) at /build/buildd/digikam-2.1.1/core/libs/imageproperties/imagepropertiescolorstab.cpp:543
#9  0x00007f54be7f76d7 in Digikam::ImagePropertiesSideBar::qt_metacall (this=0x38fb090, _c=QMetaObject::InvokeMetaMethod, _id=<optimized out>, _a=0x7fffa1c06cc0) at /build/buildd/digikam-2.1.1/obj-x86_64-linux-gnu/core/digikam/imagepropertiessidebar.moc:77
#10 0x000000000049c360 in Digikam::ImagePropertiesSideBarDB::qt_metacall (this=0x38fb090, _c=QMetaObject::InvokeMetaMethod, _id=<optimized out>, _a=0x7fffa1c06cc0) at /build/buildd/digikam-2.1.1/obj-x86_64-linux-gnu/core/digikam/imagepropertiessidebardb.moc:99
#11 0x00007f54bb920eba in QMetaObject::activate (sender=0x38c0900, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7fffa1c06cc0) at kernel/qobject.cpp:3278
#12 0x00007f54be8511e2 in Digikam::EditorWindow::signalSelectionChanged (this=<optimized out>, _t1=<optimized out>) at /build/buildd/digikam-2.1.1/obj-x86_64-linux-gnu/core/digikam/editorwindow.moc:269
#13 0x00007f54be864cce in Digikam::EditorWindow::slotSelected (this=0x38c0900, val=true) at /build/buildd/digikam-2.1.1/core/utilities/imageeditor/editor/editorwindow.cpp:1701
#14 0x00007f54be868ef5 in Digikam::EditorWindow::qt_metacall (this=0x38c0900, _c=QMetaObject::InvokeMetaMethod, _id=21, _a=0x7fffa1c06f30) at /build/buildd/digikam-2.1.1/obj-x86_64-linux-gnu/core/digikam/editorwindow.moc:213
#15 0x00000000004910a0 in Digikam::ImageWindow::qt_metacall (this=0x38c0900, _c=QMetaObject::InvokeMetaMethod, _id=<optimized out>, _a=0x7fffa1c06f30) at /build/buildd/digikam-2.1.1/obj-x86_64-linux-gnu/core/digikam/imagewindow.moc:132
#16 0x00007f54bb920eba in QMetaObject::activate (sender=0x38e76d0, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7fffa1c06f30) at kernel/qobject.cpp:3278
#17 0x00007f54be83fca2 in Digikam::Canvas::signalSelected (this=<optimized out>, _t1=true) at /build/buildd/digikam-2.1.1/obj-x86_64-linux-gnu/core/digikam/canvas.moc:224
#18 0x00007f54be844bf0 in Digikam::Canvas::contentsMouseReleaseEvent (this=0x38e76d0, e=0x7fffa1c06f90) at /build/buildd/digikam-2.1.1/core/utilities/imageeditor/canvas/canvas.cpp:1007
#19 0x00007f54bdcc07f6 in Q3ScrollView::viewportMouseReleaseEvent(QMouseEvent*) () from /usr/lib/x86_64-linux-gnu/libQt3Support.so.4
#20 0x00007f54bdcc0f37 in Q3ScrollView::eventFilter(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt3Support.so.4
#21 0x00007f54bb90dc88 in QCoreApplicationPrivate::sendThroughObjectEventFilters (this=<optimized out>, receiver=0x38e8170, event=0x7fffa1c074b0) at kernel/qcoreapplication.cpp:902
#22 0x00007f54bc30e3ef in notify_helper (e=0x7fffa1c074b0, receiver=0x38e8170, this=0x16a0070) at kernel/qapplication.cpp:4482
#23 QApplicationPrivate::notify_helper (this=0x16a0070, receiver=0x38e8170, e=0x7fffa1c074b0) at kernel/qapplication.cpp:4458
#24 0x00007f54bc313c6b in QApplication::notify (this=<optimized out>, receiver=0x38e8170, e=0x7fffa1c074b0) at kernel/qapplication.cpp:4047
#25 0x00007f54bd022126 in KApplication::notify (this=0x7fffa1c08220, receiver=0x38e8170, event=0x7fffa1c074b0) at ../../kdeui/kernel/kapplication.cpp:311
#26 0x00007f54bb90dafc in QCoreApplication::notifyInternal (this=0x7fffa1c08220, receiver=0x38e8170, event=0x7fffa1c074b0) at kernel/qcoreapplication.cpp:787
#27 0x00007f54bc30f3f2 in sendEvent (event=<optimized out>, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#28 QApplicationPrivate::sendMouseEvent (receiver=0x38e8170, event=0x7fffa1c074b0, alienWidget=0x38e8170, nativeWidget=0x38cb0b0, buttonDown=0x38e8170, lastMouseReceiver=..., spontaneous=true) at kernel/qapplication.cpp:3146
#29 0x00007f54bc38e945 in QETWidget::translateMouseEvent (this=0x38cb0b0, event=<optimized out>) at kernel/qapplication_x11.cpp:4568
#30 0x00007f54bc38d8be in QApplication::x11ProcessEvent (this=0x7fffa1c08220, event=0x7fffa1c07cd0) at kernel/qapplication_x11.cpp:3690
#31 0x00007f54bc3b6412 in x11EventSourceDispatch (s=0x169de50, callback=0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146
#32 0x00007f54b4641a5d in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#33 0x00007f54b4642258 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#34 0x00007f54b4642429 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#35 0x00007f54bb938ed6 in QEventDispatcherGlib::processEvents (this=0x1640270, flags=<optimized out>) at kernel/qeventdispatcher_glib.cpp:422
#36 0x00007f54bc3b607e in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=<optimized out>) at kernel/qguieventdispatcher_glib.cpp:204
#37 0x00007f54bb90ccf2 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#38 0x00007f54bb90cef7 in QEventLoop::exec (this=0x7fffa1c080a0, flags=...) at kernel/qeventloop.cpp:201
#39 0x00007f54bb911789 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1064
#40 0x00000000004893fd in main (argc=5, argv=<optimized out>) at /build/buildd/digikam-2.1.1/core/digikam/main/main.cpp:232

Reported using DrKonqi
Comment 1 caulier.gilles 2011-11-05 22:02:45 UTC
*** Bug 274555 has been marked as a duplicate of this bug. ***
Comment 2 caulier.gilles 2011-11-05 22:04:06 UTC

*** This bug has been marked as a duplicate of bug 274555 ***
Comment 3 Marcel Wiesweg 2011-11-19 11:12:47 UTC
This bug is being reported quite often. Unfortunately none of the developers can reproduce, so we need someone who can reproduce this bug and runs digikam under valgrind while crashing. This may give us more information.
Comment 4 Rudolf Leitgeb 2011-11-20 13:23:06 UTC
I am more than willing to experiment with this. To my knowledge valgrind allows quite fine grained control over what gets reported and what doesn't. Please let me/us know which options I should use with valgrind.
Comment 6 Rudolf Leitgeb 2011-11-21 07:57:19 UTC
Since the bug reported by me seems to be a NULL pointer dereference, valgrind may not be the tool of choice. Looking at the offending code in core/libs/dimg/filters/levels/histogramwidget.cpp you see some risky logic before finally  a pointer is dereferenced.

I replaced the original code:

                         currentHistogram()->calculateInThread();

with the snippet:


   ImageHistogram* Histogram = currentHistogram();
        if (Histogram == NULL) {
                qDebug("Triggered histogram crash!");
                qDebug("Dumping class state:");
                
                // Current selection information.
                HistogramPainter* histogramPainter;
                
                qDebug("sixteenBits: %1d", d->sixteenBits);
                qDebug("guideVisible: %1d", d->guideVisible);
                qDebug("statisticsVisible: %1d", d->statisticsVisible);
                qDebug("inSelected: %1d", d->inSelected);
                qDebug("selectMode: %1d", d->selectMode);
                qDebug("showProgress: %1d", d->showProgress);
                qDebug("renderingType: %d", d->renderingType);
                qDebug("range: %d", d->range);
                qDebug("state: %d", (int)(d->state));
                qDebug("channelType: %d", (int)(d->channelType));
                qDebug("scaleType: %d", (int)(d->scaleType));
                qDebug("imageHistogram: %p", d->imageHistogram);
                qDebug("selectionHistogram: %p", d->selectionHistogram);
                qDebug("xmin: %f", d->xmin);
                qDebug("xminOrg: %f", d->xminOrg);
                qDebug("xmax: %f", d->xmax);
                qDebug("animationState: %d", d->animationState);
                qDebug("animation: %p", d->animation);
                qDebug("histogramPainter: %p", d->histogramPainter);
                qDebug("arguments:");
                qDebug("i_idata: %p, i_w: %ud, i_h: %ud", i_data, i_w, i_h);
                qDebug("i_sixteenBits: %1d", i_sixteenBits);
                qDebug("s_idata: %p, s_w: %ud, s_h: %ud", s_data, s_w, s_h);
                qDebug("showProgress: %1d", showProgress);
        } else {
                currentHistogram()->calculateInThread();
        }


If the bug triggers, I'll (should) get a full dump of the status of the object. In a short editing session it has not triggered yet but I expect that to happen sooner or later. Please let me know in advance if you would like to see other variables or states in this dump, too.

Cheers,

Rudi
Comment 7 caulier.gilles 2011-11-21 08:09:17 UTC
Rudolf,

Thanks for your investigations.

Note : this file has been closed as duplicated of #274555. Please post your comment on this report...

Gilles Caulier
Comment 8 caulier.gilles 2021-12-29 13:53:31 UTC
Fixed with #274555