Skip to content
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

Implement sentry_handle_exception for macOS and Linux when using crashpad #1032

Closed
david-antiteum opened this issue Aug 22, 2024 · 3 comments
Labels
area: backend backend: crashpad enhancement New feature or request Platform: Linux Platform: macOS upstream The issue is related to an upstream dependency

Comments

@david-antiteum
Copy link

Description

sentry_handle_exception only works for Windows with crashpad as the crashpad_backend_except is not implemented in macOS and Linux.

Extra

The Windows version of our app generates a crash report, including symbols and line numbers when calling sentry_handle_exception. Our macOS and Linux versions has no crash report at all due to the lack of implementation in crashpad_backend_except.

If using the default signal handlers, that is, let sentry do all the magic, in macOS and Linux the crash is reported with function names but no line numbers.

We are using the latest version of the SDK (0.7.8), curl and crashpad in macOS and Linux. Sentry is configure with this cmake line:

cmake -B build -DSENTRY_BACKEND=crashpad -DSENTRY_TRANSPORT=curl -DSENTRY_BUILD_TESTS=OFF -DSENTRY_BUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Release -DCRASHPAD_ENABLE_STACKTRACE=ON -DSENTRY_TRANSPORT_COMPRESSION=ON

Thanks,

David

@supervacuus
Copy link
Collaborator

The Windows version of our app generates a crash report, including symbols and line numbers when calling sentry_handle_exception. Our macOS and Linux versions has no crash report at all due to the lack of implementation in crashpad_backend_except.

This is primarily an upstream issue since crashpad does not expose this functionality in the client interface on these platforms. Can you elaborate on why you need this functionality on Linux and macOS, or in what scenario you use Sentry? Do you have your own signal handlers installed? That could be a problem on macOS since the POSIX signal handlers only abstract over mach exception ports (which we use in crashpad and breakpad).

People use this feature on Windows mainly because they already have an elaborate SEH handling structure in place. But it would be interesting to understand the specific use case for Linux and macOS (especially the latter because your signal handler might not be firing before we handle the crash).

If using the default signal handlers, that is, let sentry do all the magic, in macOS and Linux the crash is reported with function names but no line numbers.

That issue is entirely different, probably not caused by client processing but by the uploaded debug information.

@david-antiteum
Copy link
Author

david-antiteum commented Aug 27, 2024

People use this feature on Windows mainly because they already have an elaborate SEH handling structure in place. But it would be interesting to understand the specific use case for Linux and macOS (especially the latter because your signal handler might not be firing before we handle the crash).

OK, then the only missing part is to document the function as Windows only to avoid using it in unsupported platforms. Other than that, we are happy removing our signal handlers and using the Sentry ones.

If using the default signal handlers, that is, let sentry do all the magic, in macOS and Linux the crash is reported with function names but no line numbers.

That issue is entirely different, probably not caused by client processing but by the uploaded debug information.

I did some extra checks and seems that the problem was on the uploaded debug information. All good on this side.

@supervacuus
Copy link
Collaborator

OK, then the only missing part is to document the function as Windows only to avoid using it in unsupported platforms. Other than that, we are happy removing our signal handlers and using the Sentry ones.

I added platform support to the inline docs in #1036. Thanks for the reminder.

We can still leave this open to gather additional use cases.

@kahest kahest closed this as completed Aug 29, 2024
@github-project-automation github-project-automation bot moved this from Needs Discussion to Done in Mobile & Cross Platform SDK Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: backend backend: crashpad enhancement New feature or request Platform: Linux Platform: macOS upstream The issue is related to an upstream dependency
Projects
Archived in project
Archived in project
Development

No branches or pull requests

3 participants