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
result = sentrycrashjson_addStringElement(context, cName, data.bytes, (int)data.length);
if (result == SentryCrashJSON_ERROR_INVALID_CHARACTER) {
codec.error = sentryErrorWithDomain(
@"SentryCrashJSONCodecObjC", 0, @"Invalid character in %@", object);
}
return result;
}
Looking at the stacktrace, it seems like we can't allocate enough memory to encode the NSString to NSData. As this code is called from the scope observer, this could happen if some of our users try to put a very large string to the scope. We could fix this by truncating long strings in the scope.
I also noticed that we could use dataUsingEncoding with setting allowLossyConversion:YES so the conversation looses some data such as ‘Á’ becomes ‘A’ instead of throwing the whole string away, but that isn't related to the crash.
The text was updated successfully, but these errors were encountered:
Description
The SDK sometimes crashes with. See also internal SDK crashes for reference. This is our most frequent SDK crash in our latest stable release 8.36.0.
The culprit is here
sentry-cocoa/Sources/SentryCrash/Recording/Tools/SentryCrashJSONCodecObjC.m
Lines 318 to 332 in eae2b59
Looking at the stacktrace, it seems like we can't allocate enough memory to encode the NSString to NSData. As this code is called from the scope observer, this could happen if some of our users try to put a very large string to the scope. We could fix this by truncating long strings in the scope.
I also noticed that we could use
dataUsingEncoding
with settingallowLossyConversion:YES
so the conversation looses some data such as ‘Á’ becomes ‘A’ instead of throwing the whole string away, but that isn't related to the crash.The text was updated successfully, but these errors were encountered: