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

crashpad_handler socket transport not working on some Linux systems #773

Closed
matusfedorko opened this issue Dec 1, 2022 · 8 comments · Fixed by getsentry/crashpad#79 or #803
Closed

Comments

@matusfedorko
Copy link

Hi,

crashpad_handler on linux silently fails to upload crash reports (tested with Sentry 22.11.0). More specifically it will send the report, but it will get bad request as a response. This can be fixed by using net/http_transport_libcurl.cc instead of the default net/http_transport_socket.cc (see also the patch below).

My dilemma is how to proceed now ? Where should I report this ? Should I report to crashpad devs ? I figured you'd want to know too, so maybe you can patch your fork of crashpad in the meantime.

diff --git a/Sources/External/include/Sentry/external/crashpad/util/CMakeLists.txt b/Sources/External/include/Sentry/external/crashpad/util/CMakeLists.txt
index 4c1d0e6f9..bb29356e4 100644
--- a/Sources/External/include/Sentry/external/crashpad/util/CMakeLists.txt
+++ b/Sources/External/include/Sentry/external/crashpad/util/CMakeLists.txt
@@ -246,7 +246,10 @@ endif()
 
 if(LINUX OR ANDROID)
     target_sources(crashpad_util PRIVATE
-        net/http_transport_socket.cc
+        net/http_transport_libcurl.cc
         linux/address_types.h
         linux/auxiliary_vector.cc
         linux/auxiliary_vector.h
@Swatinem
Copy link
Member

Swatinem commented Dec 1, 2022

Thanks for the report! I believe a libcurl based transport was added at some later point after we adopted the socket transport (which btw needed patching in itself).

As we already depend on libcurl for sentrys own downloader, I believe its fair to extend that dependency to our crashpad fork as well.

@matusfedorko
Copy link
Author

Thanks, that would be highly appreciated or at least if there would be an option to choose between socket transport and curl transport, because crashpad is not our direct dependency and due to that we don't have any reasonable way right now to fix the issue on our end without risking the loss of the patch with next sentry update.

@supervacuus supervacuus self-assigned this Dec 5, 2022
BogdanLivadariu added a commit to BogdanLivadariu/crashpad that referenced this issue Dec 9, 2022
as per description and comments on:  getsentry/sentry-native#773
@bsergean
Copy link

I confirm this is fixed in 0.5.4, tested on linux and mac with the curl transport.

@supervacuus
Copy link
Collaborator

@bsergean, I am trying to understand what you mean. The fix wasn't released with 0.5.4.

@bsergean
Copy link

bsergean commented Jan 30, 2023 via email

@bsergean
Copy link

I think that regardless of the reporting, I'm running into a separate problem with crashpad, as our process don't have ptrace enabled. I think we'll have to go back to using breakpad.

[9626:9626:20230130,164600.137083:ERROR scoped_ptrace_attach.cc:27] ptrace: Operation not permitted (1)

@supervacuus
Copy link
Collaborator

Od, I was able to see crashes reported with 0.5.4. Maybe the compilation was still picking up the breakpad compilation ?

Yes, because crashpad generally works fine on Linux. Just on some systems, it doesn't work with the socket transport. Since the curl transport seems to fix this issue and is the preferred transport on Linux by upstream, we will also make it the default.

@supervacuus
Copy link
Collaborator

I think that regardless of the reporting, I'm running into a separate problem with crashpad, as our process don't have ptrace enabled. I think we'll have to go back to using breakpad.

[9626:9626:20230130,164600.137083:ERROR scoped_ptrace_attach.cc:27] ptrace: Operation not permitted (1)

This is an environmental problem where something in your Linux setup (Docker, AppArmor, SELinux, ...?) prevents the crashpad_handler from establishing a ptrace connection to your process. If this problem persists, please create another issue, this is unrelated to this issue.

@supervacuus supervacuus changed the title crashpad_handler not working on Linux crashpad_handler socket transport not working on some Linux systems Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants