element-hq / element-hq/element-ios
Crash creating Crypto while enabling Crypto for Session
- Dominant language
- Swift
- Stars
- 1.8k
- Forks
- 544
- PR merge metrics
- PR metrics pending
Description
Team,
Would like to bring to your notice that we are facing a crash in Crypto creation while am trying to enable Crypto for a Session.This crash indicates a memory leak.
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
Research direction
The reported entry point is +createCryptoWithMatrixSession:, which creates MXCrypto and its store while enabling Crypto for a session. First check whether this path still exists and reproduce the supplied crash with the same session setup; done means the memory leak or crash is explained and the current behavior is verified or corrected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- objective-c, swift
- Domain
- mobile-dev, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100