On Mittwoch, 4. Dezember 2024 09:55:39 Mitteleuropäische Normalzeit Tomaz 
Canabrava wrote:
> Hello all, I have a quite annoying kmail crash, tried to debug but the
> codebase didn't help much.
> The crash happens in `kidentitymanager`, but I believe the culprit is in
> kmail itself.
> on KMail's `identitynpage.cpp`, method `slotRemoveIdentity` there are only
> two relevant calls:
> 
> mIPage.mIdentityList->identityTreeModel()->removeIdentities(listIdentityName
> s); save();
> 
> That in turn calls kidentitymanager's KIdentityManager::commit(),
> the commit call fails here, on the iterator access.
> 
>     for (QList<Identity>::ConstIterator it =
> d->shadowIdentities.constBegin();
>            it != d->shadowIdentities.constEnd();
>            ++it)
>  {
>         const int index = seenUOIDs.indexOf((*it).uoid());
> 
> The crash is deep down inside QHash so for me this feels like memory
> corruption:

Given that iterators are involved I suspect that shadowIdentities is modified 
while it is being iterated over which invalidates the iterator it. There are 
some signals emitted in this loop so that there's is a lot of potential for 
additional calls to KIdentityManager by connected slots including reentrancy 
of KIdentityManager::commit().

Regards,
Ingo

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to