-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RUMM-1883 Report binary image with no UUID #724
Conversation
a63ce49
to
d635cdf
Compare
@@ -150,7 +150,7 @@ internal struct DDCrashReportExporter { | |||
|
|||
return DDCrashReport.BinaryImage( | |||
libraryName: image.imageName, | |||
uuid: image.uuid, | |||
uuid: image.uuid ?? unavailable, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is still relevant to report binary images with no UUID, like we do for missing architecture. Without uuid nor arch, symbolication won't be possible, but this will give more info to the crash report and help us identify missing data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double checking - this will be possible to differentiate one ???
from another ???
by exploring the content of binary_images[]
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. We shouldn't even get ???
in stack frames for known library from PLCR as it already checks for name nullability (as long as the name is UTF8).
And we will now be able to identify binary_images
with no uuid, they were filtered out before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👌!
return nil | ||
} | ||
|
||
self.uuid = imageUUID | ||
self.uuid = imageInfo.imageUUID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's safe, but wanted to double check if this won't crash if imageUUID
is nil
? In PLCR it is defined as implicitly unwrapped String
:
/**
* 128-bit object UUID (matches Mach-O DWARF dSYM files). May be nil if unavailable.
*/
@property(nonatomic, readonly, strong) NSString *imageUUID;
Hence, previous code was checking imageInfo.hasImageUUID
before evaluating it.
/**
* YES if this image has an associated UUID.
*/
@property(nonatomic, readonly) BOOL hasImageUUID;
The problem with implicit unwrapping is common to many PLCR
types/fields and is solved by our CrashReport
(swift). This test should already cover it:
dd-sdk-ios/Tests/DatadogCrashReportingTests/PLCrashReporterIntegration/CrashReportTests.swift
Line 65 in 3b43f91
func testGivenPLCrashReportWithSomeInconsistentValues_whenInitializing_itReturnsValue() throws { |
but for the sake of sanity, let's double check if it does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without NS_ASSUME_NONNULL_*
region or _Nonnull
objc annotation, the property is implicitly unwrapped optional, so this won't crash as uuid
is now optional. The previous check was not necessary since the guard let
was already evaluating nullability.
But I can checks in test tho 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's actually already covered in test :)
var mockImageUUID: String! = nil |
What and why?
Stack frames in crash report could be reported as
???
if PLCR could not find the image or if the image's UUID is missing. To identify the root cause, we should keep reporting binary images without UUID.How?
StackFrame.libraryName
even for binary image with no UUIDuuid
inBinaryImageInfo
Review checklist