Bug 513740

Summary: Crash while "Refresh" of album
Product: [Applications] digikam Reporter: Martin Bachmann <bachmann1martin>
Component: Albums-EngineAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: caulier.gilles, elijaharagonmorgan
Priority: NOR    
Version First Reported In: 8.8.0   
Target Milestone: ---   
Platform: macOS (DMG)   
OS: macOS   
Latest Commit: Version Fixed/Implemented In: 9.0.0
Sentry Crash Report:

Description Martin Bachmann 2025-12-23 12:21:49 UTC
STEPS TO REPRODUCE
1. I've a clean setup and added a single Album on a external drive
2. Right click on the Album and press Refresh.
3. Scan takes some time but crashes every time 

OBSERVED RESULT
Aplication crashes

EXPECTED RESULT
Scan for files finishes

SOFTWARE/OS VERSIONS
macOS: intel, Sequoia 15.7.2 (24G325)

ADDITIONAL INFORMATION
Below you find the traceback:
```
lldb /Applications/digiKam.org/digikam.app/Contents/MacOS/digikam
(lldb) target create "/Applications/digiKam.org/digikam.app/Contents/MacOS/digikam"
Current executable set to '/Applications/digiKam.org/digikam.app/Contents/MacOS/digikam' (x86_64).
(lldb) r
Process 32470 launched: '/Applications/digiKam.org/digikam.app/Contents/MacOS/digikam' (x86_64)
2025-12-23 12:08:08.547960+0100 digikam[32470:1594760] [StateRestoration] WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES.
2025-12-23 12:08:21.226124+0100 digikam[32470:1594760] [qt.qpa.fonts] Populating font family aliases took 198 ms. Replace uses of missing font family ".SF NS Text" with one that exists to avoid this cost.
2025-12-23 12:08:27.666274+0100 digikam[32470:1594760] [kf.xmlgui] Unhandled container to remove :  Digikam::DigikamApp
2025-12-23 12:08:39.846719+0100 digikam[32470:1594760] [kf.windowsystem] Could not find any platform plugin
2025-12-23 12:08:47.410741+0100 digikam[32470:1595735] [ffmpeg] [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc971e23800] st: 0 edit list: 1 Missing key frame while searching for timestamp: 244
2025-12-23 12:08:47.410772+0100 digikam[32470:1595735] [ffmpeg] [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc971e23800] st: 0 edit list 1 Cannot find an index entry before timestamp: 244.
2025-12-23 12:08:49.490535+0100 digikam[32470:1594760] [Window] Warning: -[NSWindow makeKeyWindow] called on <QNSPanel: 0x7fc9798b70e0> windowNumber=26cb which returned NO from -[NSWindow canBecomeKeyWindow].
2025-12-23 12:08:49.493080+0100 digikam[32470:1594760] [Window] Warning: -[NSWindow makeKeyWindow] called on <QNSPanel: 0x7fc9798b70e0> windowNumber=26cb which returned NO from -[NSWindow canBecomeKeyWindow].
2025-12-23 12:08:51.513393+0100 digikam[32470:1595735] [ffmpeg] [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc971e24040] st: 0 edit list: 1 Missing key frame while searching for timestamp: 96
2025-12-23 12:08:51.513424+0100 digikam[32470:1595735] [ffmpeg] [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc971e24040] st: 0 edit list 1 Cannot find an index entry before timestamp: 96.
2025-12-23 12:08:51.668645+0100 digikam[32470:1595733] [ffmpeg] [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc971e2d000] st: 0 edit list: 1 Missing key frame while searching for timestamp: 283
2025-12-23 12:08:51.668675+0100 digikam[32470:1595733] [ffmpeg] [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc971e2d000] st: 0 edit list 1 Cannot find an index entry before timestamp: 283.
2025-12-23 12:08:52.101137+0100 digikam[32470:1595793] [ffmpeg] [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc9798b8e00] All samples in data stream index:id [3:4] have zero duration, stream set to be discarded by default. Override using AVStream->discard or -discard for ffmpeg command.
2025-12-23 12:08:53.468332+0100 digikam[32470:1595735] [ffmpeg] [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc97ad16d80] st: 0 edit list: 1 Missing key frame while searching for timestamp: 197
2025-12-23 12:08:53.468388+0100 digikam[32470:1595735] [ffmpeg] [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc97ad16d80] st: 0 edit list 1 Cannot find an index entry before timestamp: 197.
2025-12-23 12:08:54.887090+0100 digikam[32470:1595733] [ffmpeg] [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc9950323c0] All samples in data stream index:id [3:4] have zero duration, stream set to be discarded by default. Override using AVStream->discard or -discard for ffmpeg command.
2025-12-23 12:08:55.666194+0100 digikam[32470:1595735] [ffmpeg] [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc991e63580] st: 0 edit list: 1 Missing key frame while searching for timestamp: 257
2025-12-23 12:08:55.666256+0100 digikam[32470:1595735] [ffmpeg] [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc991e63580] st: 0 edit list 1 Cannot find an index entry before timestamp: 257.
2025-12-23 12:08:56.164158+0100 digikam[32470:1595793] [ffmpeg] [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc9798b5ac0] st: 0 edit list: 1 Missing key frame while searching for timestamp: 247
2025-12-23 12:08:56.164191+0100 digikam[32470:1595793] [ffmpeg] [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc9798b5ac0] st: 0 edit list 1 Cannot find an index entry before timestamp: 247.
2025-12-23 12:08:57.648866+0100 digikam[32470:1595735] [ffmpeg] [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc995163500] st: 0 edit list: 1 Missing key frame while searching for timestamp: 142
2025-12-23 12:08:57.648900+0100 digikam[32470:1595735] [ffmpeg] [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc995163500] st: 0 edit list 1 Cannot find an index entry before timestamp: 142.
2025-12-23 12:08:58.392421+0100 digikam[32470:1595800] [ffmpeg] [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc9753b7900] All samples in data stream index:id [3:4] have zero duration, stream set to be discarded by default. Override using AVStream->discard or -discard for ffmpeg command.
Process 32470 stopped
* thread #1, name = 'CrBrowserMain', queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0x100000019)
    frame #0: 0x0000000102ad49b0 QtCore`___lldb_unnamed_symbol9082 + 16
QtCore`___lldb_unnamed_symbol9082:
->  0x102ad49b0 <+16>: lock   
    0x102ad49b1 <+17>: cmpxchgq %rcx, (%rdi)
    0x102ad49b5 <+21>: jne    0x102ad49b9               ; <+25>
    0x102ad49b7 <+23>: popq   %rbp
Target 0: (digikam) stopped.
(lldb) bt
* thread #1, name = 'CrBrowserMain', queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0x100000019)
  * frame #0: 0x0000000102ad49b0 QtCore`___lldb_unnamed_symbol9082 + 16
    frame #1: 0x0000000102a3d789 QtCore`___lldb_unnamed_symbol7446 + 69
    frame #2: 0x0000000102a3e346 QtCore`___lldb_unnamed_symbol7465 + 34
    frame #3: 0x0000000100c419c4 libdigikamgui.8.8.0.dylib`___lldb_unnamed_symbol22928 + 68
    frame #4: 0x0000000100c4196d libdigikamgui.8.8.0.dylib`___lldb_unnamed_symbol22927 + 93
    frame #5: 0x0000000100c3dcbd libdigikamgui.8.8.0.dylib`___lldb_unnamed_symbol22900 + 29
    frame #6: 0x0000000100c3e004 libdigikamgui.8.8.0.dylib`Digikam::Album::childAtRow(int) const + 36
    frame #7: 0x0000000100c249b7 libdigikamgui.8.8.0.dylib`Digikam::AbstractAlbumModel::index(int, int, QModelIndex const&) const + 119
    frame #8: 0x0000000100c79d67 libdigikamgui.8.8.0.dylib`___lldb_unnamed_symbol24484 + 119
    frame #9: 0x0000000102b752bc QtCore`___lldb_unnamed_symbol12223 + 1016
    frame #10: 0x0000000102b28061 QtCore`QAbstractItemModel::rowsInserted(QModelIndex const&, int, int, QAbstractItemModel::QPrivateSignal) + 77
    frame #11: 0x0000000102b27fbc QtCore`QAbstractItemModel::endInsertRows() + 70
    frame #12: 0x0000000102b3d163 QtCore`___lldb_unnamed_symbol11195 + 335
    frame #13: 0x0000000102b3d547 QtCore`___lldb_unnamed_symbol11197 + 869
    frame #14: 0x0000000102b3f3e7 QtCore`___lldb_unnamed_symbol11230 + 73
    frame #15: 0x0000000102b752bc QtCore`___lldb_unnamed_symbol12223 + 1016
    frame #16: 0x0000000102b28061 QtCore`QAbstractItemModel::rowsInserted(QModelIndex const&, int, int, QAbstractItemModel::QPrivateSignal) + 77
    frame #17: 0x0000000102b27fbc QtCore`QAbstractItemModel::endInsertRows() + 70
    frame #18: 0x0000000100c23cb6 libdigikamgui.8.8.0.dylib`Digikam::AbstractAlbumModel::slotAlbumAdded(Digikam::Album*) + 86
    frame #19: 0x0000000100c26f86 libdigikamgui.8.8.0.dylib`___lldb_unnamed_symbol22210 + 134
    frame #20: 0x0000000100c26ecd libdigikamgui.8.8.0.dylib`___lldb_unnamed_symbol22208 + 77
    frame #21: 0x0000000100c26e02 libdigikamgui.8.8.0.dylib`___lldb_unnamed_symbol22206 + 146
    frame #22: 0x0000000102b75239 QtCore`___lldb_unnamed_symbol12223 + 885
    frame #23: 0x0000000100c93df4 libdigikamgui.8.8.0.dylib`Digikam::AlbumManager::signalAlbumAdded(Digikam::Album*) + 84
    frame #24: 0x0000000100ca4d9e libdigikamgui.8.8.0.dylib`Digikam::AlbumManager::insertPAlbum(Digikam::PAlbum*, Digikam::PAlbum*) + 302
    frame #25: 0x0000000100ca3f86 libdigikamgui.8.8.0.dylib`Digikam::AlbumManager::scanPAlbums() + 3542
    frame #26: 0x0000000100c950e1 libdigikamgui.8.8.0.dylib`___lldb_unnamed_symbol25227 + 929
    frame #27: 0x0000000102b752bc QtCore`___lldb_unnamed_symbol12223 + 1016
    frame #28: 0x0000000102b7b756 QtCore`QTimer::timeout(QTimer::QPrivateSignal) + 52
    frame #29: 0x0000000102b706f8 QtCore`QObject::event(QEvent*) + 90
    frame #30: 0x0000000102204b32 QtWidgets`QApplicationPrivate::notify_helper(QObject*, QEvent*) + 212
    frame #31: 0x000000010220596c QtWidgets`QApplication::notify(QObject*, QEvent*) + 476
    frame #32: 0x0000000102b56632 QtCore`QCoreApplication::notifyInternal2(QObject*, QEvent*) + 138
    frame #33: 0x0000000102b94643 QtCore`QTimerInfoList::activateTimers() + 439
    frame #34: 0x0000000119ac46db libqcocoa.dylib`___lldb_unnamed_symbol2897 + 19
    frame #35: 0x0000000119ac46ba libqcocoa.dylib`___lldb_unnamed_symbol2896 + 14
    frame #36: 0x00007ff813a4ca40 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    frame #37: 0x00007ff813a4c9e2 CoreFoundation`__CFRunLoopDoSource0 + 157
    frame #38: 0x00007ff813a4c79d CoreFoundation`__CFRunLoopDoSources0 + 203
    frame #39: 0x00007ff813a4b406 CoreFoundation`__CFRunLoopRun + 973
    frame #40: 0x00007ff813a4aa02 CoreFoundation`CFRunLoopRunSpecific + 536
    frame #41: 0x00007ff81f53a0d4 HIToolbox`RunCurrentEventLoopInMode + 281
    frame #42: 0x00007ff81f53cf97 HIToolbox`ReceiveNextEventCommon + 499
    frame #43: 0x00007ff81f6c619a HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 63
    frame #44: 0x00007ff8174acdc1 AppKit`_DPSNextEvent + 912
    frame #45: 0x00007ff817f3b097 AppKit`-[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1263
    frame #46: 0x00007ff81749dea9 AppKit`-[NSApplication run] + 610
    frame #47: 0x0000000119ac4e9f libqcocoa.dylib`___lldb_unnamed_symbol2907 + 1299
    frame #48: 0x0000000102b544cd QtCore`QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 279
    frame #49: 0x0000000102b56a93 QtCore`QCoreApplication::exec() + 123
    frame #50: 0x000000010000b8e4 digikam`___lldb_unnamed_symbol154 + 12388
    frame #51: 0x00007ff8135bd530 dyld`start + 3056
```
Comment 1 caulier.gilles 2025-12-23 12:30:58 UTC
It sounds like it crash in the album model with an invalid index... It's difficult to see where exactly.

Can you try to reproduce the crash with the 8.9.0 pre-release, fully reuild from scratch here :

https://files.kde.org/digikam/
Comment 2 elijaharagonmorgan 2025-12-24 10:38:59 UTC
Cannot reproduce, clean setup.
Arch Linux rolling, KDE 6.5.4.
album searches fine
Comment 3 Martin Bachmann 2025-12-24 10:47:06 UTC
(In reply to caulier.gilles from comment #1)
> It sounds like it crash in the album model with an invalid index... It's
> difficult to see where exactly.
> 
> Can you try to reproduce the crash with the 8.9.0 pre-release, fully reuild
> from scratch here :
> 
> https://files.kde.org/digikam/

I've tried, but i'm still on intel silicon. the pre release seems to be only available for apple silicon (ARM).
I've also tried to compile digikam by my self to debug the issue but also struggled because the bootstrap.homebrew is also only for apple silicon.
Comment 4 caulier.gilles 2025-12-24 10:54:21 UTC
Mac Intel version pre-release are there : https://files.kde.org/digikam/legacy/
Comment 5 Martin Bachmann 2025-12-24 11:02:30 UTC
(In reply to caulier.gilles from comment #4)
> Mac Intel version pre-release are there :
> https://files.kde.org/digikam/legacy/

Cool thank you... i'll try it out..
Comment 6 Martin Bachmann 2025-12-24 13:02:59 UTC
Okay... I've installed 8.9 and everything works fine so far... Thank you for your support.