matrix-org / matrix-org/matrix-ios-sdk

MXCrypto:Crash while creating Crypto

Open
#439 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Objective-C
Stars
484
Forks
225
PR merge metrics
No merged PRs in 30d

Description

Team,
We are facing a crash in Crypto creation while trying to enable Crypto for a Session.This crash indicates a memory leakage
Here am sharing the piece of code which is leading to crash.

(MXCrypto *)createCryptoWithMatrixSession:(MXSession *)mxSession
{
__block MXCrypto *crypto;
#ifdef MX_CRYPTO

dispatch_queue_t cryptoQueue = [MXCrypto dispatchQueueForUser:mxSession.matrixRestClient.credentials.userId];
dispatch_sync(cryptoQueue, ^{

MXCryptoStoreClass *cryptoStore = [MXCryptoStoreClass createStoreWithCredentials:mxSession.matrixRestClient.credentials];
crypto = [[MXCrypto alloc] initWithMatrixSession:mxSession cryptoQueue:cryptoQueue andStore:cryptoStore];

});
#endif

return crypto;
}

Can you give us an update if the issue was already fixed.

Regard's
Swapna

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the crash while enabling Crypto for a Session, then inspect the createCryptoWithMatrixSession: entry point and the shown MXCryptoStoreClass and MXCrypto initialization calls. Done means identifying the cause of the crash or reported memory leak and confirming that Crypto creation completes without it.

Written by the indexing model from the issue text.

Assessment

Tech stack
objective-c
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.