Bug 420642 - Crash on face detection stop button
Summary: Crash on face detection stop button
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Faces-Detection (show other bugs)
Version: 7.0.0
Platform: macOS (DMG) macOS
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-26 22:44 UTC by Stefan
Modified: 2020-04-29 21:03 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 7.0.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan 2020-04-26 22:44:04 UTC
SUMMARY


STEPS TO REPRODUCE
1. start face detect
2. force stop by pushing the stop detection button

OBSERVED RESULT
crash

EXPECTED RESULT
no crash

SOFTWARE/OS VERSIONS
Windows: 
macOS: 10.14.5 (18F132)
Build date: Apr 19 2020 (target: Debug)
Rev.: 3f079531b1116827cec535fa8c0bbdc45e43766c
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Digikam::FaceDetector::~FaceDetector()
https://gist.github.com/0wnrepo/c54ea618cc14b5bae0ec9794d4bf9cc5
Comment 1 Stefan 2020-04-26 22:44:42 UTC
Thread 0:: CrBrowserMain  Dispatch queue: com.apple.main-thread
0   libsystem_malloc.dylib        	0x00007fff6ca96853 tiny_size + 185
1   libsystem_malloc.dylib        	0x00007fff6ca9673a szone_size + 45
2   libsystem_malloc.dylib        	0x00007fff6ca969a0 free + 107
3   libopencv_dnn.3.4.dylib       	0x0000000114523845 std::__1::__tree<std::__1::__value_type<cv::dnn::experimental_dnn_34_v15::LayerPin, cv::Mat>, std::__1::__map_value_compare<cv::dnn::experimental_dnn_34_v15::LayerPin, std::__1::__value_type<cv::dnn::experimental_dnn_34_v15::LayerPin, cv::Mat>, std::__1::less<cv::dnn::experimental_dnn_34_v15::LayerPin>, true>, std::__1::allocator<std::__1::__value_type<cv::dnn::experimental_dnn_34_v15::LayerPin, cv::Mat> > >::destroy(std::__1::__tree_node<std::__1::__value_type<cv::dnn::experimental_dnn_34_v15::LayerPin, cv::Mat>, void*>*) + 165
4   libopencv_dnn.3.4.dylib       	0x00000001145237be std::__1::__tree<std::__1::__value_type<cv::dnn::experimental_dnn_34_v15::LayerPin, cv::Mat>, std::__1::__map_value_compare<cv::dnn::experimental_dnn_34_v15::LayerPin, std::__1::__value_type<cv::dnn::experimental_dnn_34_v15::LayerPin, cv::Mat>, std::__1::less<cv::dnn::experimental_dnn_34_v15::LayerPin>, true>, std::__1::allocator<std::__1::__value_type<cv::dnn::experimental_dnn_34_v15::LayerPin, cv::Mat> > >::destroy(std::__1::__tree_node<std::__1::__value_type<cv::dnn::experimental_dnn_34_v15::LayerPin, cv::Mat>, void*>*) + 30
5   libopencv_dnn.3.4.dylib       	0x00000001145237be std::__1::__tree<std::__1::__value_type<cv::dnn::experimental_dnn_34_v15::LayerPin, cv::Mat>, std::__1::__map_value_compare<cv::dnn::experimental_dnn_34_v15::LayerPin, std::__1::__value_type<cv::dnn::experimental_dnn_34_v15::LayerPin, cv::Mat>, std::__1::less<cv::dnn::experimental_dnn_34_v15::LayerPin>, true>, std::__1::allocator<std::__1::__value_type<cv::dnn::experimental_dnn_34_v15::LayerPin, cv::Mat> > >::destroy(std::__1::__tree_node<std::__1::__value_type<cv::dnn::experimental_dnn_34_v15::LayerPin, cv::Mat>, void*>*) + 30
6   libopencv_dnn.3.4.dylib       	0x00000001145237be std::__1::__tree<std::__1::__value_type<cv::dnn::experimental_dnn_34_v15::LayerPin, cv::Mat>, std::__1::__map_value_compare<cv::dnn::experimental_dnn_34_v15::LayerPin, std::__1::__value_type<cv::dnn::experimental_dnn_34_v15::LayerPin, cv::Mat>, std::__1::less<cv::dnn::experimental_dnn_34_v15::LayerPin>, true>, std::__1::allocator<std::__1::__value_type<cv::dnn::experimental_dnn_34_v15::LayerPin, cv::Mat> > >::destroy(std::__1::__tree_node<std::__1::__value_type<cv::dnn::experimental_dnn_34_v15::LayerPin, cv::Mat>, void*>*) + 30
7   libopencv_dnn.3.4.dylib       	0x0000000114533b4c cv::dnn::experimental_dnn_34_v15::Net::Impl::~Impl() + 252
8   libopencv_dnn.3.4.dylib       	0x0000000114533a1b cv::detail::PtrOwnerImpl<cv::dnn::experimental_dnn_34_v15::Net::Impl, cv::DefaultDeleter<cv::dnn::experimental_dnn_34_v15::Net::Impl> >::deleteSelf() + 27
9   libopencv_dnn.3.4.dylib       	0x000000011450fecd cv::dnn::experimental_dnn_34_v15::Net::~Net() + 29
10  libdigikamcore.7.0.0.dylib    	0x0000000109775507 Digikam::DNNFaceDetectorBase::~DNNFaceDetectorBase() + 39
11  libdigikamcore.7.0.0.dylib    	0x0000000109769e55 Digikam::DNNFaceDetectorSSD::~DNNFaceDetectorSSD() + 21
12  libdigikamcore.7.0.0.dylib    	0x0000000109769e75 Digikam::DNNFaceDetectorSSD::~DNNFaceDetectorSSD() + 21
13  libdigikamcore.7.0.0.dylib    	0x0000000109769e99 Digikam::DNNFaceDetectorSSD::~DNNFaceDetectorSSD() + 25
14  libdigikamcore.7.0.0.dylib    	0x000000010976585f Digikam::OpenCVDNNFaceDetector::~OpenCVDNNFaceDetector() + 47
15  libdigikamcore.7.0.0.dylib    	0x0000000109765885 Digikam::OpenCVDNNFaceDetector::~OpenCVDNNFaceDetector() + 21
16  libdigikamcore.7.0.0.dylib    	0x0000000109738d4f Digikam::FaceDetector::Private::~Private() + 47
17  libdigikamcore.7.0.0.dylib    	0x0000000109738d15 Digikam::FaceDetector::Private::~Private() + 21
18  libdigikamcore.7.0.0.dylib    	0x0000000109738ce3 QExplicitlySharedDataPointer<Digikam::FaceDetector::Private>::~QExplicitlySharedDataPointer() + 83
19  libdigikamcore.7.0.0.dylib    	0x0000000109736db5 QExplicitlySharedDataPointer<Digikam::FaceDetector::Private>::~QExplicitlySharedDataPointer() + 21
20  libdigikamcore.7.0.0.dylib    	0x0000000109736d95 Digikam::FaceDetector::~FaceDetector() + 21
21  libdigikamcore.7.0.0.dylib    	0x0000000109736dd5 Digikam::FaceDetector::~FaceDetector() + 21
22  libdigikamgui.7.0.0.dylib     	0x0000000107bf6238 Digikam::DetectionWorker::~DetectionWorker() + 56
23  libdigikamgui.7.0.0.dylib     	0x0000000107bf6295 Digikam::DetectionWorker::~DetectionWorker() + 21
24  libdigikamgui.7.0.0.dylib     	0x0000000107bf62b9 Digikam::DetectionWorker::~DetectionWorker() + 25
25  libdigikamgui.7.0.0.dylib     	0x0000000107be8629 Digikam::ParallelPipes::~ParallelPipes() + 217
26  libdigikamgui.7.0.0.dylib     	0x0000000107be8805 Digikam::ParallelPipes::~ParallelPipes() + 21
27  libdigikamgui.7.0.0.dylib     	0x0000000107be8829 Digikam::ParallelPipes::~ParallelPipes() + 25
28  libdigikamgui.7.0.0.dylib     	0x0000000107bdfe78 Digikam::FacePipeline::~FacePipeline() + 200
29  libdigikamgui.7.0.0.dylib     	0x0000000107be0035 Digikam::FacePipeline::~FacePipeline() + 21
30  libdigikamgui.7.0.0.dylib     	0x0000000107a9bf33 Digikam::FacesDetector::Private::~Private() + 35
31  libdigikamgui.7.0.0.dylib     	0x0000000107a9a125 Digikam::FacesDetector::Private::~Private() + 21
32  libdigikamgui.7.0.0.dylib     	0x0000000107a9a0ed Digikam::FacesDetector::~FacesDetector() + 61
33  libdigikamgui.7.0.0.dylib     	0x0000000107a9a145 Digikam::FacesDetector::~FacesDetector() + 21
34  libdigikamgui.7.0.0.dylib     	0x0000000107a9a169 Digikam::FacesDetector::~FacesDetector() + 25
35  org.qt-project.QtCore         	0x000000010bfbcb43 QObject::event(QEvent*) + 751
36  org.qt-project.QtWidgets      	0x000000010b65aab6 QApplicationPrivate::notify_helper(QObject*, QEvent*) + 218
37  org.qt-project.QtWidgets      	0x000000010b65ba32 QApplication::notify(QObject*, QEvent*) + 718
38  org.qt-project.QtCore         	0x000000010bfa2774 QCoreApplication::notifyInternal2(QObject*, QEvent*) + 138
39  org.qt-project.QtCore         	0x000000010bfa321f QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) + 389
40  libqcocoa.dylib               	0x000000011f340adf 0x11f312000 + 191199
41  libqcocoa.dylib               	0x000000011f34108c 0x11f312000 + 192652
42  com.apple.CoreFoundation      	0x00007fff409d8083 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
43  com.apple.CoreFoundation      	0x00007fff409d8029 __CFRunLoopDoSource0 + 108
44  com.apple.CoreFoundation      	0x00007fff409bb9eb __CFRunLoopDoSources0 + 195
45  com.apple.CoreFoundation      	0x00007fff409bafb5 __CFRunLoopRun + 1189
46  com.apple.CoreFoundation      	0x00007fff409ba8be CFRunLoopRunSpecific + 455
47  com.apple.HIToolbox           	0x00007fff3fca696b RunCurrentEventLoopInMode + 292
48  com.apple.HIToolbox           	0x00007fff3fca65ad ReceiveNextEventCommon + 355
49  com.apple.HIToolbox           	0x00007fff3fca6436 _BlockUntilNextEventMatchingListInModeWithFilter + 64
50  com.apple.AppKit              	0x00007fff3e040987 _DPSNextEvent + 965
51  com.apple.AppKit              	0x00007fff3e03f71f -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1361
52  com.apple.AppKit              	0x00007fff3e03983c -[NSApplication run] + 699
53  libqcocoa.dylib               	0x000000011f340332 0x11f312000 + 189234
54  org.qt-project.QtCore         	0x000000010bfa0517 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 267
55  libdigikamgui.7.0.0.dylib     	0x0000000107830628 Digikam::ScanController::completeCollectionScanCore(bool, bool) + 168
56  libdigikamgui.7.0.0.dylib     	0x000000010783068a Digikam::ScanController::completeCollectionScanInBackground(bool) + 42
57  libdigikamgui.7.0.0.dylib     	0x0000000107a9635c Digikam::NewItemsFinder::slotStart() + 412
58  libdigikamgui.7.0.0.dylib     	0x0000000107a84863 Digikam::NewItemsFinder::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) + 99
59  org.qt-project.QtCore         	0x000000010bfbcb0c QObject::event(QEvent*) + 696
60  org.qt-project.QtWidgets      	0x000000010b65aab6 QApplicationPrivate::notify_helper(QObject*, QEvent*) + 218
61  org.qt-project.QtWidgets      	0x000000010b65ba32 QApplication::notify(QObject*, QEvent*) + 718
62  org.qt-project.QtCore         	0x000000010bfa2774 QCoreApplication::notifyInternal2(QObject*, QEvent*) + 138
63  org.qt-project.QtCore         	0x000000010bfa321f QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) + 389
64  libqcocoa.dylib               	0x000000011f340adf 0x11f312000 + 191199
65  libqcocoa.dylib               	0x000000011f34108c 0x11f312000 + 192652
66  com.apple.CoreFoundation      	0x00007fff409d8083 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
67  com.apple.CoreFoundation      	0x00007fff409d8029 __CFRunLoopDoSource0 + 108
68  com.apple.CoreFoundation      	0x00007fff409bb9eb __CFRunLoopDoSources0 + 195
69  com.apple.CoreFoundation      	0x00007fff409bafb5 __CFRunLoopRun + 1189
70  com.apple.CoreFoundation      	0x00007fff409ba8be CFRunLoopRunSpecific + 455
71  com.apple.HIToolbox           	0x00007fff3fca696b RunCurrentEventLoopInMode + 292
72  com.apple.HIToolbox           	0x00007fff3fca66a5 ReceiveNextEventCommon + 603
73  com.apple.HIToolbox           	0x00007fff3fca6436 _BlockUntilNextEventMatchingListInModeWithFilter + 64
74  com.apple.AppKit              	0x00007fff3e040987 _DPSNextEvent + 965
75  com.apple.AppKit              	0x00007fff3e03f71f -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1361
76  com.apple.AppKit              	0x00007fff3e03983c -[NSApplication run] + 699
77  libqcocoa.dylib               	0x000000011f340332 0x11f312000 + 189234
78  org.qt-project.QtCore         	0x000000010bfa0517 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 267
79  org.qt-project.QtCore         	0x000000010bfa2bc3 QCoreApplication::exec() + 123
80  digikam                       	0x00000001076aa5a5 main + 11877
81  libdyld.dylib                 	0x00007fff6c8e93d5 start + 1
Comment 2 caulier.gilles 2020-04-27 02:23:27 UTC
It crash when the reference engine is deleted :

https://invent.kde.org/kde/digikam/-/blob/master/core/libs/facesengine/detection/opencv-dnn/opencvdnnfacedetector.cpp#L73

The reason is not clear for me


Gilles Caulier
Comment 3 Maik Qualmann 2020-04-29 21:03:50 UTC
Git commit e6ec2a675690855aa875863f419911ad88045854 by Maik Qualmann.
Committed on 29/04/2020 at 20:59.
Pushed by mqualmann into branch 'master'.

fix possible face detection crash on stop
We do not wait for the worker objects because
the status of the "started" flag is wrong.
FIXED-IN: 7.0.0

M  +2    -1    NEWS
M  +4    -2    core/utilities/facemanagement/threads/facepipeline_p.cpp
M  +1    -0    core/utilities/facemanagement/threads/facepipeline_p.h

https://invent.kde.org/kde/digikam/commit/e6ec2a675690855aa875863f419911ad88045854