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
This file contains hidden or 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
this PR adds preservePorts option to Sygnals.installSignals. When set to true it will save mach exception handlers before invoking callback and restore after it. It is required to pre-serve mach handlers from modification by third party analytics such as Crashlytics.
RoboVM uses signals handlers to process null-pointer exceptions. Crash reporters often uses same signals to handle crashed and some of them terminates app. Which causes NPE even in try-catch block to crash app. More details in old post
Crashlytics additionally install task mach exception handler end intercepts javas NPE as EXC_BAD_ACCESS and reports these as crashes.
The workaround for this is same as with signals -- restore mach port handlers to state it was before calling Sygnals.installSignals.
This PR adds additional API to Signal with preservePorts parameter, when set to true -- will preserve handler and restore after processing callback call:
…to true it will save mach exception handlers before invoking callback and restore after it. It is required to pre-serve mach handlers from modification by third party analytics
I have one question, according to your original post on crash reporters, Signals.installSignals(...) was needed as otherwise a caught exception (such as the NPE in the example code) would result in the application being terminated. However in my tests, using Signals.installSignals or not didn't seem to make any difference. The behaviour was exactly the same. Any idea why ?
In case of crashlytics it play nice and calls previous handler which is robovm one. But there was some crash reporters that were callung abort() once they received sigabort. For example this was happening with appdynamics. And signal.installSignal was just for sake processing signals before aggressive sdks
Important to mention that even if reporter just observes signal and passes it to parrent, without signal.installSignal it will catch all robovms npe and report them as crashes. So approach still valid
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.
this PR adds preservePorts option to Sygnals.installSignals. When set to true it will save mach exception handlers before invoking callback and restore after it. It is required to pre-serve mach handlers from modification by third party analytics such as Crashlytics.
RoboVM uses signals handlers to process null-pointer exceptions. Crash reporters often uses same signals to handle crashed and some of them terminates app. Which causes NPE even in try-catch block to crash app. More details in old post
Crashlytics additionally install task mach exception handler end intercepts javas NPE as EXC_BAD_ACCESS and reports these as crashes.
The workaround for this is same as with signals -- restore mach port handlers to state it was before calling Sygnals.installSignals.
This PR adds additional API to Signal with preservePorts parameter, when set to true -- will preserve handler and restore after processing callback call: