Bug 515904 - Kaidan 0.15.0 (Flatpak) crashes when receiving an incoming contact request (<presence type="subscribe"/>) from another XMPP client.
Summary: Kaidan 0.15.0 (Flatpak) crashes when receiving an incoming contact request (<...
Status: REPORTED
Alias: None
Product: kaidan
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Mint (Ubuntu based) Linux
: NOR crash
Target Milestone: ---
Assignee: melvo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-02-12 12:21 UTC by Ralf Peter
Modified: 2026-02-12 12:21 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Peter 2026-02-12 12:21:56 UTC
Steps to reproduce:

Create account on Kaidan (e.g. om@example.org)
From a different client (e.g. Dinox), add om@example.org as contact
Kaidan crashes immediately
Note: Sending contact requests from Kaidan to Dinox works fine. The crash only happens on incoming requests.

Probable cause:

In src/OmemoController.cpp, function initializeChat():
if (RosterModel::instance()->item(m_accountSettings->jid(), jid)->isReceivingPresence()) {
RosterModel::instance()->item(...) returns std::optional<RosterItem>.

When an incoming subscription request is received, RosterController::handleSubscriptionRequest() calls processSubscriptionRequestFromStranger() which calls addContact() — but this is asynchronous (roster IQ set + server response). Before the roster item exists, Kaidan appears to open the chat view, which triggers initializeChat(). At this point, item() returns std::nullopt, and dereferencing it with ->isReceivingPresence() causes undefined behavior / segfault.

Side effect: After the crash, Kaidan's OMEMO database appears to be corrupted — after restart, OMEMO encryption no longer works for any contact (not just the one that triggered the crash). Only unencrypted messages can be sent.
Otherwise, Omemo 2 works wonderfully between Kaidan and Dinox.

Environment:

Kaidan 0.15.0 (Flatpak, im.kaidan.kaidan)
Linux (Flatpak system install)
ejabberd server 26.1

Ralf Peter