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
Fix deserialization of custom stackframe fields in cached error reports #576
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ialising stacktraces
…directly if passed in
kattrali
previously requested changes
Aug 30, 2019
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've gotten to the start of Stacktrace.java
so far but need to break up my review a bit. This is what I have so far.
bugsnag-android-core/src/androidTest/java/com/bugsnag/android/StacktraceTest.java
Show resolved
Hide resolved
bugsnag-android-core/src/main/java/com/bugsnag/android/BugsnagException.java
Outdated
Show resolved
Hide resolved
bugsnag-android-core/src/main/java/com/bugsnag/android/ErrorReader.java
Outdated
Show resolved
Hide resolved
bugsnag-android-core/src/main/java/com/bugsnag/android/ErrorReader.java
Outdated
Show resolved
Hide resolved
bugsnag-android-core/src/main/java/com/bugsnag/android/Exceptions.java
Outdated
Show resolved
Hide resolved
…uishing between frameAddress/lo
…ensure error is deserialized
…ame with custom streamable
kattrali
reviewed
Aug 30, 2019
fractalwrench
force-pushed
the
custom-exception-serialization
branch
from
September 2, 2019 11:57
7444e41
to
cccc88f
Compare
kattrali
approved these changes
Sep 3, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Goal
This changeset fixes the deserialization of custom fields in a stackframe by
ErrorReader
, when an error report has been cached on disk. This caused several issues:columnNumber
in React Native JS exceptions, reducing the available information for source mappingloadAddress
,frameAddress
, andsymbolAddress
fields for NDK errorsChangeset
If no
beforeSend
callback has been specified, skip deserialization of the error report and stream the file directly, to reduce unnecessary work and mitigate the impact of any other deserialisation bugs.Generally speaking, the serialization has been changed to allow an arbitrary
List<Map<String, Object>>
, which contains the full stacktrace. Broken down across classes, this has had the following effects:CachedThread
:Stacktrace
object eagerly in the constructor, rather than in the stream methodErrorReader
:List<Map>
rather than mapping data into aStackTraceElement
.Exceptions
:toStream
method now delegates to theBugsnagException
class. The pre-existing implementation has been split acrossBugsnagException
andStacktrace
respectively.Stacktrace
:toStream
methodList<Map>
for arbitrary stackframesStackTraceElement
toList<Map>
by adapting the existing serialization codeBugsnagException
:Streamable
. If the wrapped exception is of typeStreamable
, delegate the streaming to itList<Map>
for serializing stackframesList<Map>
has been supplied, construct theStacktrace
using that, rather than the throwable's stacktrace.Tests