Bug 480373 - Systematic IOT Crash at startup when scanning for new elements
Summary: Systematic IOT Crash at startup when scanning for new elements
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Database-Scan (show other bugs)
Version: 8.2.0
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-26 21:20 UTC by act.kde
Modified: 2024-02-06 20:01 UTC (History)
1 user (show)

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


Attachments
Bug report files (65.45 KB, application/zip)
2024-01-26 21:20 UTC, act.kde
Details
GDB Trace of segfault (1.32 MB, text/plain)
2024-02-05 20:00 UTC, act.kde
Details

Note You need to log in before you can comment on or make changes to this bug.
Description act.kde 2024-01-26 21:20:40 UTC
Created attachment 165257 [details]
Bug report files

SUMMARY:
Digikam crash with an IOT instruction / coredump on an assert at startup during the scan for new elements.


STEPS TO REPRODUCE
1.  Starting digikam
2.  Crash after few second scanning for new elements


OBSERVED RESULT
The application crash (i.e. close abruptly without any message) 

When run in terminal the following information is printed:
ASSERT: "size == 0 || offset < 0 || size_t(offset) >= sizeof(QArrayData)" in file /usr/include/qt/QtCore/qarraydata.h, line 59
[1]    83062 IOT instruction (core dumped)  digikam


SOFTWARE/OS VERSIONS
Linux: Archlinux @ 26.01.2024
See package_list.txt in attachment for all software with version installed

ADDITIONAL INFORMATION :

gdb_backtrace.txt : log + backtrace with gdb with catch throw
crashlog.txt : full log during a crash

I can provide a coredump file or my database on request.

Thanks
Comment 1 Maik Qualmann 2024-01-26 22:38:04 UTC
Git commit 2fcf896234e692ead19a3bb14aab8f16c2e621d3 by Maik Qualmann.
Committed on 26/01/2024 at 22:36.
Pushed by mqualmann into branch 'master'.

switch to QMutex to protect album child cache
and protect the correct parent child cache.
Related: bug 480357
FIXED-IN: 8.3.0

M  +1    -1    NEWS
M  +15   -11   core/libs/album/engine/album.cpp
M  +2    -2    core/libs/album/engine/album.h

https://invent.kde.org/graphics/digikam/-/commit/2fcf896234e692ead19a3bb14aab8f16c2e621d3
Comment 2 Maik Qualmann 2024-01-27 11:42:22 UTC
Git commit d92bb3d84dc8634a7c5634e2626fee6f932c7e4d by Maik Qualmann.
Committed on 27/01/2024 at 11:41.
Pushed by mqualmann into branch 'master'.

revert to QReadWriteLocker and protect the right parent child cache
Related: bug 480357

M  +11   -15   core/libs/album/engine/album.cpp
M  +2    -2    core/libs/album/engine/album.h

https://invent.kde.org/graphics/digikam/-/commit/d92bb3d84dc8634a7c5634e2626fee6f932c7e4d
Comment 3 act.kde 2024-01-31 19:17:07 UTC
Hi Maik,

Thanks the quick answer, I retested with latest version from git ( commit "fix broken compilation if no media player support" - 7ecafac90a84305cc3734e7064688fbfd722e2bf ), and the issue is still present. At first look look to be exact same place,  and exact same thing.

If needed I can provide a new GDB BT.

Ben
Comment 4 Maik Qualmann 2024-01-31 19:32:30 UTC
Git commit 7a53abab0659a35ee136a49b6975cdb6e5a136a2 by Maik Qualmann.
Committed on 31/01/2024 at 19:31.
Pushed by mqualmann into branch 'master'.

try a recursive read write lock

M  +1    -0    core/libs/album/engine/album.cpp

https://invent.kde.org/graphics/digikam/-/commit/7a53abab0659a35ee136a49b6975cdb6e5a136a2
Comment 5 Maik Qualmann 2024-01-31 19:34:33 UTC
Please try to test the latest change as soon as possible.

Maik
Comment 6 Maik Qualmann 2024-01-31 20:18:06 UTC
Git commit 62ce5a695917834a13db503aea4c4d2cac1ffe9d by Maik Qualmann.
Committed on 31/01/2024 at 20:17.
Pushed by mqualmann into branch 'master'.

change from QVector to QList, in Qt6 it's the same

M  +1    -2    core/libs/album/engine/album.h

https://invent.kde.org/graphics/digikam/-/commit/62ce5a695917834a13db503aea4c4d2cac1ffe9d
Comment 7 act.kde 2024-02-05 20:00:06 UTC
Created attachment 165578 [details]
GDB Trace of segfault

Hi Maik,

I tried the latest fix ( master at 4bd5e03d ), I got a few segmentation fault across the first runs. But after 4-6 run the issue did not appear anymore.
Nevertheless I was able to have a GDB trace of the segfault (added in attachment).

I hope it helps.

If the issue reappear later I will keep you informed.

By the way thank you very much for your work on this wonderful project 
Ben
Comment 8 Maik Qualmann 2024-02-06 19:59:57 UTC
Git commit 9171ecaf5a036c6c54de4bd9bcddd0e961da0f80 by Maik Qualmann.
Committed on 06/02/2024 at 19:59.
Pushed by mqualmann into branch 'master'.

check if album in deletion and delete child albums under lock

M  +17   -16   core/libs/album/engine/album.cpp
M  +1    -0    core/libs/album/engine/album.h

https://invent.kde.org/graphics/digikam/-/commit/9171ecaf5a036c6c54de4bd9bcddd0e961da0f80
Comment 9 Maik Qualmann 2024-02-06 20:01:01 UTC
I'm closing the bug, if you still reproduce it, reopen it.

Maik