https://bugs.kde.org/show_bug.cgi?id=520106
--- Comment #4 from [email protected] --- Updated Crash Analysis Application: digiKam 9.1.0 (ARM64) OS: macOS 26.5 (25F71) Crash Type: EXC_BAD_ACCESS (SIGSEGV) – Null pointer dereference (KERN_INVALID_ADDRESS at 0x0000000000000000) Thread: Main thread (com.apple.main-thread) 📍 Exact Crash Location Function: QAbstractItemModel::beginInsertRows (QtCore) Context: Triggered by Digikam::AlbumManager::scanPAlbums() → insertPAlbum() → slotAlbumAboutToBeAdded() Root Cause: Likely a NULL pointer in a PAlbum (album pointer) or memory corruption during album insertion. 🧩 Key Observations 1. Stack Trace Consistency The crash occurs in the same call chain as in digiKam 9.0.0: plaintext Copy 0 QtCore 0x10706f4d0 // Crash here (invalid memory access) 1 QtCore 0x10705ae7c QAbstractItemModel::rowsAboutToBeInserted(...) + 24 2 QtCore 0x10703430c QAbstractItemModel::beginInsertRows(...) + 40 3 libdigikamgui.9.1.0.dylib 0x1051af2b4 Digikam::AbstractAlbumModel::slotAlbumAboutToBeAdded(...) + 216 4 libdigikamgui.9.1.0.dylib 0x105242398 Digikam::AlbumManager::signalAlbumAboutToBeAdded(...) + 64 5 libdigikamgui.9.1.0.dylib 0x1052688dc Digikam::AlbumManager::insertPAlbum(...) + 124 6 libdigikamgui.9.1.0.dylib 0x105267ce8 Digikam::AlbumManager::scanPAlbums() + 2840 → The crash happens when AbstractAlbumModel tries to emit the rowsAboutToBeInserted signal, but: Either the parent index (QModelIndex) is invalid (e.g., points to a deleted album). Or the model is in a corrupted state (e.g., a NULL PAlbum* in the internal list). 2. Suspicious Threads (Potential Conflicts) Thread Role Risk Thread 6 Digikam::ScanController ⚠️ High: Accesses AlbumManager in parallel. May modify the album list while the main thread emits notifications. Threads 11-13 AIToolsloader, AIToolsclassifier, AIToolswriter ⚠️ Medium: Use shared queues (SharedQueue), but no direct link to albums. Thread 17 ExifToolThread ✅ Low: Handles metadata, not albums. Thread 28 BuildTrashCountersJob ✅ Low: Counts files in the trash. → Most likely culprit: ScanController (Thread 6). It calls AlbumManager::scanPAlbums() in the background, but the rowsAboutToBeInserted notification is emitted from the main thread. If ScanController modifies the album structure while the main thread iterates over it, this can corrupt the model. 3. Memory Corruption Evidence esr: 0x92000006 (Data Abort) byte read Translation fault: The CPU attempted to read an invalid address (0x0000000000000000). This typically happens when: A pointer is NULL (e.g., an uninitialized PAlbum*). An object was deleted but its pointer is still used (use-after-free). A data structure is corrupted (e.g., a QList<PAlbum*> contains an invalid pointer). x9: 0x0000000000000000 (ARM register): Register x9 contains NULL at the time of the crash. → A function argument is NULL (e.g., an Album* or QModelIndex). 📌 Summary of Findings The crash is consistent across digiKam 9.0.0 (Qt 6.10) and 9.1.0 (Qt 6.11). → Not a Qt 6.10-specific bug. The issue is structural in album management, likely due to: A NULL PAlbum pointer passed to insertPAlbum(). Memory corruption in AbstractAlbumModel. A race condition between ScanController (Thread 6) and the main thread. The root cause is in AlbumManager::scanPAlbums(), which triggers a model notification (rowsAboutToBeInserted) with invalid data. No direct link to AI Tools or ExifTool threads, but ScanController is the most likely source of the conflict. -- You are receiving this mail because: You are watching all bug changes.
