You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The app continuously crashes when trying to cache room avatars on launch in the iOS 14.4 simulator on an M1 Mac.
To Reproduce
On an M1 Mac build and run in the app in an iOS 14.4 simulator
Log into an account that has previously joined a room with an avatar (e.g. #element-ios:matrix.org)
App crashes and continues to crash on every relaunch
Expected behavior
App does not crash.
Screenshots
Smartphone (please complete the following information):
Device: iPhone 12 Pro Max simulator on an M1 Mac mini
OS: iOS14.4
Version: current develop branch
Additional context
The crash occurs in MXTools when calling CFRelease on a NULL pointer (which is documented behavior).
The NULL pointer is returned from UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, mimeType, NULL) and calling that function is accompanied with an error logged in the console:
Due to a Simulator bug on the Apple M1, `UTTypeCreatePreferredIdentifierForTag` can
unexpectedly return `NULL`. This causes a crash because the return value is later
passed into `CFRelease` which explicitly disallows `NULL` arguments.
This commit fixes the issue by ensuring the return value is not `NULL` before
proceeding.
Fixes: element-hq/element-ios#4140
Signed-off-by: Johannes Marbach <[email protected]>
Johennes
added a commit
to Johennes/matrix-ios-sdk
that referenced
this issue
Mar 24, 2021
Due to a Simulator bug on the Apple M1, `UTTypeCreatePreferredIdentifierForTag` can
unexpectedly return `NULL`. This causes a crash because the return value is later
passed into `CFRelease` which explicitly disallows `NULL` arguments.
This commit fixes the issue by ensuring the return value is not `NULL` before
proceeding.
Fixes: element-hq/element-ios#4140
Signed-off-by: Johannes Marbach <[email protected]>
Describe the bug
The app continuously crashes when trying to cache room avatars on launch in the iOS 14.4 simulator on an M1 Mac.
To Reproduce
#element-ios:matrix.org
)Expected behavior
App does not crash.
Screenshots
Smartphone (please complete the following information):
develop
branchAdditional context
The crash occurs in MXTools when calling
CFRelease
on aNULL
pointer (which is documented behavior).The
NULL
pointer is returned fromUTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, mimeType, NULL)
and calling that function is accompanied with an error logged in the console:This might be a simulator bug on the M1 (see e.g. here). Nevertheless, the return value should be checked to avoid releasing a null pointer.
The text was updated successfully, but these errors were encountered: