-
-
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. |
How are you starting the Electron crash reporter? The event has The |
Just to answer this quickly: I asked Tim internally to take another look and removed the label because it's used internally to track which issues need a reply. So no worries, this was not "just removed" :) We take triaging turns within the team and delegate specific issues to the respective SDK owners or experts. |
@timfish If Sentry is not enabled, crashReporter.start() is used with uploadToServer: false, meaning crash reports are collected locally but not automatically uploaded. If Sentry is enabled, Sentry.sentryMinidumpIntegration() is used to capture and process crash reports through Sentry. |
In my testing with the following setup on macOS, events are not sent when import * as Sentry from '@sentry/electron/main';
Sentry.init({
dsn: '__DSN__',
debug: true,
beforeSend: (event) => {
if (event.tags['event.process'] === 'unknown') {
return null;
}
return event;
}
}); Can you create a reproduction where this isn't working? |
@timfish Have you tested this setup using integrations: [Sentry.electronMinidumpIntegration()]? As you mentioned earlier, if we use electronMinidumpIntegration, then beforeSend won’t be called. |
@timfish Our team provided the following steps to reproduce this issue: Reproducible Steps:
|
The |
Hi @timfish, I tested with a demo app, and in case of a native crash, native crash sentry Link : I'm not sure why this discrepancy is occurring. Do you have any insights on what could be causing this difference? |
The sentry-electron/src/main/integrations/sentry-minidump/minidump-loader.ts Lines 173 to 180 in 4a7798a
If |
Looking through the stacktraces from the above linked I have no idea how Electrons crashpad decides to classify these as renderer crashes! |
WebKit is running from a separately spawned process, which is launched by Electron. It is not running directly in the Electron main or renderer process. |
The stacktrace I saw looked like it was going through both Electron and WebKit! |
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: