From f318826ec56ba6ee7016d4d5a70e3ecb8d5b84a5 Mon Sep 17 00:00:00 2001 From: Mischan Toosarani-Hausberger Date: Sat, 20 May 2023 20:53:53 +0200 Subject: [PATCH 1/9] crashpad backend starts handler with http-proxy --- external/crashpad | 2 +- src/backends/sentry_backend_crashpad.cpp | 21 +++++++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/external/crashpad b/external/crashpad index 1904ae143..dc779354c 160000 --- a/external/crashpad +++ b/external/crashpad @@ -1 +1 @@ -Subproject commit 1904ae14360bb3115e098950733a4fd3da93b25a +Subproject commit dc779354ccf020a3155ea1fac4534a9345ccdfa2 diff --git a/src/backends/sentry_backend_crashpad.cpp b/src/backends/sentry_backend_crashpad.cpp index ddb93f2ca..d88f85616 100644 --- a/src/backends/sentry_backend_crashpad.cpp +++ b/src/backends/sentry_backend_crashpad.cpp @@ -322,12 +322,21 @@ crashpad_backend_startup( crashpad::CrashpadClient client; char *minidump_url = sentry__dsn_get_minidump_url(options->dsn, options->user_agent); - SENTRY_TRACEF("using minidump url \"%s\"", minidump_url); - std::string url = minidump_url ? std::string(minidump_url) : std::string(); - sentry_free(minidump_url); - bool success = client.StartHandler(handler, database, database, url, - annotations, arguments, /* restartable */ true, - /* asynchronous_start */ false, attachments); + if (minidump_url) { + SENTRY_TRACEF("using minidump URL \"%s\"", minidump_url); + bool success = client.StartHandler(handler, database, database, + minidump_url, options->http_proxy ? options->http_proxy : "", + annotations, arguments, + /* restartable */ true, + /* asynchronous_start */ false, attachments); + sentry_free(minidump_url); + } else { + SENTRY_WARN( + "failed to construct minidump URL (check DSN or user-agent)"); + delete data->db; + data->db = nullptr; + return 1; + } #ifdef CRASHPAD_WER_ENABLED sentry_path_t *handler_dir = sentry__path_dir(absolute_handler_path); From 51a38db5991b4cb82d5182d8e7ba89985325669b Mon Sep 17 00:00:00 2001 From: Mischan Toosarani-Hausberger Date: Mon, 22 May 2023 12:34:56 +0200 Subject: [PATCH 2/9] Fix bool success in crashpad backend. --- src/backends/sentry_backend_crashpad.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backends/sentry_backend_crashpad.cpp b/src/backends/sentry_backend_crashpad.cpp index d88f85616..c424c8229 100644 --- a/src/backends/sentry_backend_crashpad.cpp +++ b/src/backends/sentry_backend_crashpad.cpp @@ -319,12 +319,13 @@ crashpad_backend_startup( // `sentry_init` will persist the upload flag. data->db = crashpad::CrashReportDatabase::Initialize(database).release(); + bool success; crashpad::CrashpadClient client; char *minidump_url = sentry__dsn_get_minidump_url(options->dsn, options->user_agent); if (minidump_url) { SENTRY_TRACEF("using minidump URL \"%s\"", minidump_url); - bool success = client.StartHandler(handler, database, database, + success = client.StartHandler(handler, database, database, minidump_url, options->http_proxy ? options->http_proxy : "", annotations, arguments, /* restartable */ true, From 52967defa3ed099301f4a972e8823c6a8d316859 Mon Sep 17 00:00:00 2001 From: Mischan Toosarani-Hausberger Date: Mon, 22 May 2023 12:35:39 +0200 Subject: [PATCH 3/9] Update crashpad submodule --- external/crashpad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/crashpad b/external/crashpad index dc779354c..96b7d5f58 160000 --- a/external/crashpad +++ b/external/crashpad @@ -1 +1 @@ -Subproject commit dc779354ccf020a3155ea1fac4534a9345ccdfa2 +Subproject commit 96b7d5f5802638a99174647012f118f05f572379 From 822561fe18d06ea372f474b30c3ac3f346b532bf Mon Sep 17 00:00:00 2001 From: Mischan Toosarani-Hausberger Date: Mon, 22 May 2023 14:45:03 +0200 Subject: [PATCH 4/9] Update crashpad submodule for Linux support --- external/crashpad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/crashpad b/external/crashpad index 96b7d5f58..3bc228260 160000 --- a/external/crashpad +++ b/external/crashpad @@ -1 +1 @@ -Subproject commit 96b7d5f5802638a99174647012f118f05f572379 +Subproject commit 3bc2282608a448645a3a8c153ef8e4705bfb221c From 63578ae21e8ae5557c9aa49a143232495f604b11 Mon Sep 17 00:00:00 2001 From: Mischan Toosarani-Hausberger Date: Mon, 22 May 2023 18:19:12 +0200 Subject: [PATCH 5/9] Update crashpad submodule --- external/crashpad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/crashpad b/external/crashpad index 3bc228260..af58387d0 160000 --- a/external/crashpad +++ b/external/crashpad @@ -1 +1 @@ -Subproject commit 3bc2282608a448645a3a8c153ef8e4705bfb221c +Subproject commit af58387d057f04cf676ba0ee9a28cb0715a67715 From 0c8b778aeceae3fc4cecbb5ee7017fab42c13baf Mon Sep 17 00:00:00 2001 From: Mischan Toosarani-Hausberger Date: Mon, 22 May 2023 18:39:14 +0200 Subject: [PATCH 6/9] add change-log --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb0c31af4..f43a8014c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Disable PC adjustment in the backend for libunwindstack ([#839](https://github.com/getsentry/sentry-native/pull/839)) - Crashpad backend allows inspection and enrichment of the crash event in the on_crash/before_send hooks ([#843](https://github.com/getsentry/sentry-native/pull/843)) +- Add http-proxy support to the `crashpad_handler` ([#847](https://github.com/getsentry/sentry-native/pull/847), [crashpad#86](https://github.com/getsentry/crashpad/pull/86)) **Internal**: From b651d3e323dfaa04e6b91e99818137f117359f0e Mon Sep 17 00:00:00 2001 From: Mischan Toosarani-Hausberger Date: Mon, 22 May 2023 18:54:50 +0200 Subject: [PATCH 7/9] fix format for clang-format 15 --- src/backends/sentry_backend_crashpad.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/backends/sentry_backend_crashpad.cpp b/src/backends/sentry_backend_crashpad.cpp index c424c8229..b3bc19440 100644 --- a/src/backends/sentry_backend_crashpad.cpp +++ b/src/backends/sentry_backend_crashpad.cpp @@ -325,9 +325,9 @@ crashpad_backend_startup( = sentry__dsn_get_minidump_url(options->dsn, options->user_agent); if (minidump_url) { SENTRY_TRACEF("using minidump URL \"%s\"", minidump_url); - success = client.StartHandler(handler, database, database, - minidump_url, options->http_proxy ? options->http_proxy : "", - annotations, arguments, + success = client.StartHandler(handler, database, database, minidump_url, + options->http_proxy ? options->http_proxy : "", annotations, + arguments, /* restartable */ true, /* asynchronous_start */ false, attachments); sentry_free(minidump_url); From 02e0948c3b221ae8f616d8c820bb48d6e230fba4 Mon Sep 17 00:00:00 2001 From: Mischan Toosarani-Hausberger Date: Mon, 22 May 2023 20:48:03 +0200 Subject: [PATCH 8/9] Update crashpad submodule with apple fixes. --- external/crashpad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/crashpad b/external/crashpad index af58387d0..f72392edd 160000 --- a/external/crashpad +++ b/external/crashpad @@ -1 +1 @@ -Subproject commit af58387d057f04cf676ba0ee9a28cb0715a67715 +Subproject commit f72392eddbebb4b48b7404707bc454f69d29505f From 18d256257be6780999cf6381302dc76640d0acf4 Mon Sep 17 00:00:00 2001 From: Mischan Toosarani-Hausberger Date: Mon, 22 May 2023 20:58:06 +0200 Subject: [PATCH 9/9] Update crashpad submodule --- external/crashpad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/crashpad b/external/crashpad index f72392edd..704134973 160000 --- a/external/crashpad +++ b/external/crashpad @@ -1 +1 @@ -Subproject commit f72392eddbebb4b48b7404707bc454f69d29505f +Subproject commit 7041349732770d0902e156deaba6e86bfdee1a0a