-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
Duplicate Sentry Reports for Native Client Crashes #1045
Comments
So the parent app is the Electron app, or the native app? Is the native app using the Sentry Native SDK? Does this only occur on macOS or all platforms? |
Hi @timfish , So the parent app is the Electron app, or the native app? Is the native app using the Sentry Native SDK? Does this only occur on macOS or all platforms? |
The Sentry Electron SDK uses the Electron
There's no option to configure it so I don't think there's anything we can do to stop this. You may be able to custom build Electron and disable this but that would be a lot of work. When starting your native code from Electron, you could set an environment variable that your native uses to disable crash handling? |
Hi @timfish, If we call process.crashReporter.addExtraParameter('ignore', 'true') in the child_process and then filter out such crashes in beforeSend hook, would this approach be feasible? Additionally, I’m concerned that even if we manage to filter out these events from being uploaded, would it still impact the parent project’s Crash Free Session Rate? |
The
Yes, even if you could filter in You could switch the crash reporter off in your child process? Are you trying to avoid doing that because then all crashes will then go to the Electron app and you'd like them going to two different Sentry projects depending on the source? |
No, we cannot disable crash reporting for the child process because the native app is maintained by a separate development team. They have already enabled the Sentry Native SDK within the native app to report crashes to their own project.
Since the native app runs as a child process of the Electron app, its crashes are reported by the Sentry Electron SDK to the Electron project's Sentry instance as well, inflating the project's session crash rate — something we want to avoid. Do you have any suggestions? |
Both the Electron
We could add an option to ignore child process crashes from Electron but this would not be 100% reliable. It would have both false positives and false negatives. The SDK gets events from Electron for renderer and child process crashes and we assume any minidumps found after those events correspond to the event type. If we find any minidumps at startup, we assume they are for the Electron main process because it exits immediately on crash. However, the assumptions we make are not always correct. For example, your event above that was sent from Electron has With Electron, minidumps are written by an external crashpad process and Electron notifies us but another minidump may be written by the time we read the disk. There are race conditions that we can only attempt to mitigate against. If you look at all the native events in your Electron project that you'd like to filter out, what do they have for the You could parse the minidumps and determine which process it came from. If I had to do this it would be via a native module using the |
Although most of the events have event.process marked as "browser," there are still a few events where event.process is marked as "renderer."
Could you explain in detail how to add these callbacks to work around the impact on the CFSR? It seems this is the only way we have currently. Thanks |
I've been working on #1049 which should allow us to better determine which process generated the minidump. I need to test this with the Sentry Native SDK but I'm hoping you'll be able to set With this I can then add an option to the Electron SDK that will allow these to be ignored while not impacting CSFR. |
Yes, that is correct. They will be ignored and the mindumps deleted by the Electron SDK. It's worth noting that |
Hi @timfish I wanted to clarify that the native client binary in our setup is being initialized using |
I have not tested this but I suspect You will only get the process listed as |
Hi @timfish
In our scenario, we launch a native client from our Electron app using child_process.spawn. Given this, we will still face a challenge in distinguishing or ignoring crashes specifically from this native client. Do you have any suggestions on how we can proceed? |
I that case, crashes from your native client will be classified as |
Okay, great! Let’s try it out once the PR is merged and see how it integrates. |
The latest release (5.10.0) already reads the process type from the minidump and populates the |
Through some changes in |
v5.11.0 has been released. This includes a fix for |
Hi @timfish, Thank you for the update! I wanted to confirm if simply upgrading the Sentry Electron SDK and applying the following change would be sufficient to resolve my issue:
|
Yes it's |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Electron SDK Version
4.22.0
Electron Version
27.2.20
What platform are you using?
None
Link to Sentry event
https://jupiter-ct.sentry.io/issues/5977075889/events/d8cb5ff92ddd4fbb9e7bd0380f77df83/?project=1430058 , https://jupiter-ct.sentry.io/issues/5105499169/events/49718a83fe6142b4a727520fb6ce24d8/?project=4506692758077440
Steps to Reproduce
We have observed an issue where the same crash is being reported in two separate Sentry projects:
The parent application's Sentry project (e.g., Jupiter).
The Native Client's Sentry project.
This duplication occurs when the Native Client is launched from the parent application. Both projects log the same crash as separate issues.
Example:
Here are two examples of duplicate issues for the same crash:
Parent Application Sentry Project: [MTKView draw]: Fatal Error: EXC_BREAKPOINT / EXC_ARM_BREAKPOINT / 0x100742e00 — Project: jupiter-ct.
Native Client Sentry Project: EXC_BREAKPOINT: height — Project: ringcentral-video-nc.
Expected Result
Actual Result
This duplication occurs when the Native Client is launched from the parent application. Both projects log the same crash as separate issues.
The text was updated successfully, but these errors were encountered: