Bug 427203 - Asan error on closing digikam
Summary: Asan error on closing digikam
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Thumbs-Engine (show other bugs)
Version: 7.2.0
Platform: Ubuntu Linux
: NOR minor
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-01 12:08 UTC by Marcel
Modified: 2022-01-09 21:28 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 7.5.0


Attachments
asan output (4.82 KB, text/plain)
2020-10-01 12:08 UTC, Marcel
Details
Seg fault on closing Digikam (2.98 KB, text/plain)
2020-10-02 10:15 UTC, Marcel
Details
asan output (3.02 KB, text/plain)
2020-10-02 19:25 UTC, Marcel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel 2020-10-01 12:08:04 UTC
Created attachment 132046 [details]
asan output

SUMMARY
After closing Digikam asan reports an error

STEPS TO REPRODUCE
1. Start Digikam
2. Wait until scan for new images is finished
3. Close Digikam
4. Asan reports an error

OBSERVED RESULT
See attached file asanOnCloseDigikam.txt

EXPECTED RESULT
Close without an error on asan

SOFTWARE/OS VERSIONS
Digikam: Commit 2fdab922ec229c29be1698e9dce59b80dd6cfda6
Linux/KDE Plasma: Kubuntu 20.04
(available in About System)
KDE Plasma Version: 5.18.5
KDE Frameworks Version: 5.68.0
Qt Version: 5.12.8

ADDITIONAL INFORMATION
Comment 1 Maik Qualmann 2020-10-01 20:39:16 UTC
Yes, I know this problem and it is older. The thumbnailer is still running, the cache is already being deleted...

Maik
Comment 2 Maik Qualmann 2020-10-02 06:02:26 UTC
Git commit 444c76f3b09b10af6c5b4d2a3f72073ff0cee6bf by Maik Qualmann.
Committed on 02/10/2020 at 06:01.
Pushed by mqualmann into branch 'master'.

this should fix the possible crash at the end of digiKam

M  +5    -5    core/libs/album/engine/albumthumbnailloader.cpp
M  +3    -0    core/libs/threadimageio/thumb/thumbnailloadthread.cpp

https://invent.kde.org/graphics/digikam/commit/444c76f3b09b10af6c5b4d2a3f72073ff0cee6bf
Comment 3 Marcel 2020-10-02 10:15:41 UTC
Created attachment 132067 [details]
Seg fault on closing Digikam

Thank you Maik for fixing this asan bug. I successfully tested it. Unfortunately on the closing the next error occurs. A sig fault. See bt_clowing_digikam.txt.

I guess it comes from the same thematic as Bug 426175. A virtual call is done in the destructor. Probably the mutex lock in ManagedLoadSaveThread::stopAllTasks() should be removed. What do you think?
Comment 4 Maik Qualmann 2020-10-02 17:01:33 UTC
Git commit b657d553192ef72e8202adbfd7c6e54d5c0b0b3e by Maik Qualmann.
Committed on 02/10/2020 at 17:00.
Pushed by mqualmann into branch 'master'.

check album icon threads for creation

M  +10   -4    core/libs/album/engine/albumthumbnailloader.cpp

https://invent.kde.org/graphics/digikam/commit/b657d553192ef72e8202adbfd7c6e54d5c0b0b3e
Comment 5 Marcel 2020-10-02 19:25:41 UTC
Created attachment 132075 [details]
asan output

I get a new error from asan on closing Digikam. This time I have no idea where it comes from.
Comment 6 caulier.gilles 2020-10-03 07:09:44 UTC
Marcel,

I suspect a i18n declaration problem, similar than one fixed with this PR :

https://invent.kde.org/graphics/digikam/-/merge_requests/36

But where in source code ?

Gilles
Comment 7 caulier.gilles 2022-01-09 03:48:31 UTC
Hi Marcel,

The problem still valid using current 7.5.0 pre-release bundle ?

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

Thanks in advance

Gilles Caulier
Comment 8 Marcel 2022-01-09 19:43:30 UTC
Hi Gilles

I checked it with the pre-release bundle `digiKam-7.5.0-20220109T135438-x86-64.appimage` and couldn't see the asan message any more. If I remember right this pre-release does not include the asan, so I compiled the sources from the hash `c44258326a5270ad2b68ba14830ba3350038b6d6` with asan enables to be sure the error is gone.  

I could not see that error ether but Digikam on the self build version Digikam did always crash on closing. 

Error:
```
digikam.general: scan mode: ScanDeferredFiles
digikam.general: total scan value :  74609
digikam.general: total scan value :  76233
digikam.database: items to tag ()
digikam.database: Complete scan took: 71299 msecs.
digikam.general: Event is dispatched to KDE desktop notifier
digikam.general: Cancel Main Thread
digikam.general: Cancel Main Thread
malloc_consolidate(): invalid chunk size
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = digikam path = /usr/bin pid = 270017
KCrash: Arguments: /usr/bin/digikam 
KCrash: Attempting to start /usr/lib/x86_64-linux-gnu/libexec/drkonqi from kdeinit
sock_file=/run/user/1000/kdeinit5__0

With 1000s of "[warn] epoll_wait: Bad file descriptor" following after a while
```

Should I open a new bug for this or is it something I do wrong?
Comment 9 caulier.gilles 2022-01-09 21:28:42 UTC
Hi Marcel,

Thanks to check for this file. Yes, please open a new file with a full gdb backtrace to locate where is the problem.

I close this file now.

Gilles