-
Notifications
You must be signed in to change notification settings - Fork 10
BIT-7817: Skeleton crash reports for native crashes on API level 30 #934
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
base: main
Are you sure you want to change the base?
Changes from all commits
745a26b
db6248f
6dbdfa3
9f38096
c78817a
8443d2b
5844505
eb7c3b3
379b4e2
64ccb05
265375e
217848b
68afca6
b1075f5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -166,6 +166,7 @@ class IssueReporterProcessorTest { | |
| FAKE_TIME_STAMP, | ||
| "Input Dispatching Timed Out", | ||
| trace, | ||
| signalNumber = 0, | ||
| ) | ||
|
|
||
| verify(streamingReportProcessor).processAndPersistANR( | ||
|
|
@@ -190,6 +191,7 @@ class IssueReporterProcessorTest { | |
| FAKE_TIME_STAMP, | ||
| "Input Dispatching Timed Out", | ||
| buildTraceInputStringFromFile("app_exit_anr_deadlock_anr.txt"), | ||
| signalNumber = 0, | ||
| ) | ||
|
|
||
| verify(internalLogger).logInternalError( | ||
|
|
@@ -214,6 +216,7 @@ class IssueReporterProcessorTest { | |
| FAKE_TIME_STAMP, | ||
| "Input Dispatching Timed Out", | ||
| buildTraceInputStringFromFile("app_exit_anr_deadlock_anr.txt"), | ||
| signalNumber = 0, | ||
| ) | ||
|
|
||
| verify(internalLogger).logInternalError( | ||
|
|
@@ -237,6 +240,7 @@ class IssueReporterProcessorTest { | |
| FAKE_TIME_STAMP, | ||
| description, | ||
| traceInputStream, | ||
| signalNumber = 0, | ||
| ) | ||
|
|
||
| verify(issueReporterStorage).persistFatalIssue( | ||
|
|
@@ -275,6 +279,60 @@ class IssueReporterProcessorTest { | |
| assertThat(deviceMetrics?.cpuAbis(0)).isEqualTo("armeabi-v7a") | ||
| } | ||
|
|
||
| @Test | ||
| fun processAppExitReport_whenNativeCrashWithNullTrace_shouldCreateSkeletonNativeReport() { | ||
| val description = "Segmentation fault" | ||
|
|
||
| processor.processAppExitReport( | ||
| ReportType.NativeCrash, | ||
| FAKE_TIME_STAMP, | ||
| description, | ||
| traceInputStream = null, | ||
| signalNumber = 11, // SIGSEGV | ||
| ) | ||
|
Comment on lines
+286
to
+292
|
||
|
|
||
| verify(issueReporterStorage).persistFatalIssue( | ||
| eq(FAKE_TIME_STAMP), | ||
| issueReportCaptor.capture(), | ||
| reportTypeCaptor.capture(), | ||
| ) | ||
| val buffer = ByteBuffer.wrap(issueReportCaptor.firstValue) | ||
| val report = Report.getRootAsReport(buffer) | ||
| assertThat(report.errorsLength).isEqualTo(1) | ||
| assertThat(reportTypeCaptor.firstValue).isEqualTo(ReportType.NativeCrash) | ||
|
|
||
| val capturedError = report.errors(0)!! | ||
| assertThat(capturedError.name).isEqualTo("SIGSEGV") | ||
| assertThat(capturedError.reason).isEqualTo("Segmentation violation (invalid memory reference)") | ||
| assertThat(capturedError.stackTraceLength).isEqualTo(0) | ||
| assertThat(report.threadDetails?.threadsLength).isEqualTo(0) | ||
| assertThat(report.binaryImagesLength).isEqualTo(0) | ||
| } | ||
|
|
||
| @Test | ||
| fun processAppExitReport_whenNativeCrashWithNullTraceAndUnknownSignal_shouldFallBackToDescription() { | ||
| val description = "Segmentation fault" | ||
|
|
||
| processor.processAppExitReport( | ||
| ReportType.NativeCrash, | ||
| FAKE_TIME_STAMP, | ||
| description, | ||
| traceInputStream = null, | ||
| signalNumber = 0, | ||
| ) | ||
|
|
||
| verify(issueReporterStorage).persistFatalIssue( | ||
| eq(FAKE_TIME_STAMP), | ||
| issueReportCaptor.capture(), | ||
| reportTypeCaptor.capture(), | ||
| ) | ||
| val buffer = ByteBuffer.wrap(issueReportCaptor.firstValue) | ||
| val report = Report.getRootAsReport(buffer) | ||
| val capturedError = report.errors(0)!! | ||
| assertThat(capturedError.name).isEqualTo(description) | ||
| assertThat(capturedError.reason).isEqualTo("Native crash") | ||
| } | ||
|
|
||
| @Test | ||
| fun processAppExitReport_withInvalidReason_shouldNotInteractWithStorage() { | ||
| val description = null | ||
|
|
@@ -285,6 +343,7 @@ class IssueReporterProcessorTest { | |
| FAKE_TIME_STAMP, | ||
| description, | ||
| traceInputStream, | ||
| signalNumber = 0, | ||
| ) | ||
|
|
||
| verify(issueReporterStorage, never()) | ||
|
|
||
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.
Changelog entry says "Fatal Issue Reports are now being sent on API level 30", but the PR changes appear specific to native crashes where
ApplicationExitInfo.getTraceInputStream()is null (skeleton native-crash reports). Consider rewording to avoid implying all fatal issue reports were previously not sent on API 30, and to call out that these are native crash reports without tombstone/stack traces.