Skip to content

Sentry Patches#1

Open
jan-auer wants to merge 720 commits intomasterfrom
getsentry
Open

Sentry Patches#1
jan-auer wants to merge 720 commits intomasterfrom
getsentry

Conversation

@jan-auer
Copy link
Copy Markdown
Member

This PR contains patches for Sentry. Do not merge.

Swatinem pushed a commit that referenced this pull request Sep 10, 2020
__builtin_trap uses ud2 on x86_64, producing a SIGILL. On arm64, it uses
brk #1, producing a SIGTRAP. Test expectations must be adjusted
accordingly.

Bug: crashpad:345
Test: crashpad_snapshot_test MachOImageAnnotationsReader.CrashModuleInitialization, crashpad_util_test ExcServerVariants.*,ExceptionPorts.*
Change-Id: I22e75b7b48b8887031b1d95f1cea8a09733daf49
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2386464
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
supervacuus pushed a commit to supervacuus/crashpad that referenced this pull request Dec 12, 2022
…Body

This bug was found when trying to upgrading the MSAN bots from Ubuntu
18.04 (where this codepath was not hit) to 20.04.  The following MSAN
error is produced when running HTTPTransport/HTTPTransport.*

==3496553==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x5616c540ad7d in __is_long buildtools/third_party/libc++/trunk/include/string:1674:33
    getsentry#1 0x5616c540ad7d in size buildtools/third_party/libc++/trunk/include/string:1069:17
    getsentry#2 0x5616c540ad7d in crashpad::(anonymous namespace)::HTTPTransportLibcurl::WriteResponseBody(char*, unsigned long, unsigned long, void*) third_party/crashpad/crashpad/util/net/http_transport_libcurl.cc:528:50
    ...
    SUMMARY: MemorySanitizer: use-of-uninitialized-value buildtools/third_party/libc++/trunk/include/string:1674:33 in __is_long
  ORIGIN: invalid (0). Might be a bug in MemorySanitizer origin tracking.

The memory is initialized in http_transport_test.cc:293, but MSAN gets
confused.  Given the message output by MSAN (ORIGIN: invalid (0).
Might be a bug in MemorySanitizer origin tracking), this appears
to be a bug in MSAN, not crashpad, so this CL suppresses the error.

Bug: chromium: 1260217
Change-Id: I2d6a46e3489816270cc1fee776793ffafe0147e4
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4015160
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
compnerd and others added 28 commits November 28, 2023 08:53
`simd_stub.c` was removed from the repository upstream. This updates the CMakeLists.txt so that it is possible to build for Windows ARM64.
The ARM64 build should use the ARM64 branch.  The normal spelling for the CMAKE_SYSTEM_PROCESSOR is ARM64 when building with MSVC toolsets.  This allows building for Windows ARM64 with MSBuild + CMake.
build: remove obsolete source file
build: adjust process name matching
The implementation details of flags can change; fixing this proactively
makes it easier to roll googletest in chromium.

Bug: chromium:1409870
Change-Id: Ib27a922a5b3147386a36f98b42e60950e2215190
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5081703
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
bit_cast should never be used on pointers, as it doesn't avoid UB and
can lose qualifiers.

Fortunately, the only use of bit_cast on a pointer was to cast
nullptr into a function pointer, and because nullptr will implicitly
behave as any kind of pointer, that cast isn't needed.

Bug: none
Change-Id: I3ad79b36b7fb5ab53d4b4b6dfc82dea883ec8b53
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5106728
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
https://developer.apple.com/documentation/kernel/1462446-mach_absolute_time

> Prefer to use the equivalent clock_gettime_nsec_np(CLOCK_UPTIME_RAW) in nanoseconds.

The two are equivalent:

https://github.com/apple-oss-distributions/Libc/blob/c5a3293354e22262702a3add5b2dfc9bb0b93b85/gen/clock_gettime.c#L118

Change-Id: I1c7a08d821d1840b74fc5eaa0e9ceca2ade5bbfc
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5085307
Commit-Queue: Ben Hamilton <benhamilton@google.com>
Reviewed-by: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
The real Chromium base/bit_cast.h is in the base namespace.
mini_chromium's version was just changed to be in the base namespace
as well. Roll to the latest mini_chromium and scope all calls to
bit_cast.

Bug: chromium:1506769
Change-Id: I7b25ee512f67694ef6ed3d0250e4f6a6db151eb3
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5116880
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Change-Id: Ifc373d313db71872cc0fd7706da2bdc07cf4ba1b
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5126940
Reviewed-by: Justin Cohen <justincohen@chromium.org>
Commit-Queue: Ben Hamilton <benhamilton@google.com>
Avoid unconditionally running mig in incremental builds,
and causing un-necessary re-build of downstream targets.

Bug: b/42147841
Bug: b/42084680
Change-Id: I961189870aec8f0b1a1ced22105730218664e109
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5171755
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: David Fang <fangism@google.com>
…ae8eb0 (1 commit)

https://chromium.googlesource.com/chromium/mini_chromium/+log/ac3e73239534..cc2ae8eb01d0

$ git log ac3e73239..cc2ae8eb0 --date=short --no-merges --format='%ad %ae %s'
2024-01-10 pbos Add Flush() method to LogMessage

Created with:
  roll-dep crashpad/third_party/mini_chromium/mini_chromium

Bug: chromium:1409729
Change-Id: I59b4c9fc9701f3a504b89f396de9da49b333712f
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5185844
Commit-Queue: Peter Boström <pbos@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
…4ecb51 (1 commit)

https://chromium.googlesource.com/chromium/mini_chromium/+log/cc2ae8eb01d0..1e64ecb51edf

$ git log cc2ae8eb0..1e64ecb51 --date=short --no-merges --format='%ad %ae %s'
2024-01-10 pbos Make ~LogMessage virtual

Created with:
  roll-dep crashpad/third_party/mini_chromium/mini_chromium

Bug: chromium:1409729
Change-Id: Ib0011b85c35c781ea35e0d399cccb81b54916ca4
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5186000
Commit-Queue: Peter Boström <pbos@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
…ccaa8e (1 commit)

https://chromium.googlesource.com/chromium/mini_chromium/+log/1e64ecb51edf..c7fccaa8ec14

$ git log 1e64ecb51..c7fccaa8e --date=short --no-merges --format='%ad %ae %s'
2024-01-10 pbos Implement base::ImmediateCrash()

Created with:
  roll-dep crashpad/third_party/mini_chromium/mini_chromium

Bug: chromium:1409729
Change-Id: Iaa4f4d81027cb0ddafe85bab8d186949eb7f852e
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5186004
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
…a01130 (1 commit)

https://chromium.googlesource.com/chromium/mini_chromium/+log/c7fccaa8ec14..203a01130fac

$ git log c7fccaa8e..203a01130 --date=short --no-merges --format='%ad %ae %s'
2024-01-10 pbos Fix base::ImmediateCrash() IWYU

Created with:
  roll-dep crashpad/third_party/mini_chromium/mini_chromium

Bug: chromium:1409729
Change-Id: Ic9fee112a48b66c92b8446270280d5f2a3d0ef59
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5187485
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
This will be used by base/logging.h in chromium to make sure that
LOG(FATAL) variants never return and are properly understood as
[[noreturn]] by the compiler.

Once that's landed in chromium it'll be up/downstreamed into
mini_chromium as well.

Bug: chromium:1409729
Change-Id: I75340643fe075475f997bbc45250fa10df63c9fa
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5185996
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
This CL introduces a new crash key 'crashpad_uptime_ns' that records the
number of nanoseconds between when Crashpad was initialized and when a
snapshot is generated.

Crashpad minidumps record the MDRawMiscInfo process_create_time using a
sysctl(KERN_PROC).kp_proc.p_starttime. This time is used to display the
'uptime' of a process.  However, iOS 15 and later has a feature that
'prewarms' the app to reduce the amount of time the user waits before
the app is usable. This mean crashes that may happen immediately on
startup would appear to happen minutes or hours after process creation
time.

While initial implementations of prewarming would include some parts of
main, since iOS16 prewarming is complete before main, and therefore
before Crashpad is typically initialized.

Bug: crashpad:472
Change-Id: Iff960e37ae40121bd5927d319a2767d1cafce846
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5171091
Reviewed-by: Ben Hamilton <benhamilton@google.com>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
This will trigger dead-code warnings in chromium once LOG(FATAL) is
understood as [[noreturn]], which needs to be fixed in crashpad first.

Bug: 1409729
Change-Id: I75cb4d93e648ca9804f1299345e52bb3e2834cd9
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5193351
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Change-Id: I0a30b816e2550e7df6d7777c6d27e6104fc2f9fa
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5206711
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
It's expected that iOS intermediate dumps can be written with
missing information, but it's better to try and report as much as
possible rather than drop the incomplete minidump.

Bug: b/284959148
Change-Id: I04110b576a4ee552814234d559c9ba85db0382f0
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4582167
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
This assumption is non-portable and prevents Chromium from using
bounded iterators in libc++.

Bug: chromium: 1519908
Change-Id: Iafe6639ef3bc896d6fa4fb3ceb7ac0b546363017
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5237292
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
This changes fxbug.dev/ URLs from Monorail bug numbers to the new
Fuchsia Issue Tracker numbers.

The migration to the new issue tracker was announced here:
https://groups.google.com/a/fuchsia.dev/g/announce/c/GOYfJozEqmk/m/qsGsaJ7UAAAJ

Bug: 298074672
Change-Id: I5f4b7a26a3f41bf539fa79d15e1a108ea35a5b29
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5246697
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
The change in macOS 14's dyld to insert new modules in the front of
`dyld_all_image_infos` means that if the any images are loaded
during an exception while iterating the modules list, the primary
executable will be missed. Instead, read the modules in reverse
order.


Change-Id: I49f6468173f18ef4bd0f326c84e4b48cfc696cd3
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5249275
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
This change adds a method to update a CrashpadInfo stream.

As part of this change, AddUserDataMinidumpStream() now returns a handle
to the added stream. This handle can be passed to
UpdateUserDataMinidumpStream() if a new version of the stream needs to
be attached to the crash report.

This method is needed for e.g., allowing Chrome's System Profile to
update, as it contains some data that takes a while to collect.

Bug: crashpad:474
Change-Id: I19e935a6904d8843215582e5606b189479ee338b
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5260024
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Jesse McKenna <jessemckenna@google.com>
If building for chromium, honor the ios_is_app_extension gn variable
that is set per toolchain. When it is defined, the code is built for
an application extension (i.e. -fapplication-extension is passed to
the compiler).

Use CRASHPAD_IS_IOS_APP_EXTENSION build guard to not compile code
that use unavailable extension when ios_is_app_extension is set. If
the variable is not set, then check at runtime whether the API can
be used or not (if the crashpad client uses the same toolchain for
the main application and its application extensions).

This is required to pass -fapplication-extension to the compiler when
building application extensions (which allow catching API that is not
available to application extensions).

Bug: 40120082
Change-Id: I28d545fcfd0f8662430c40ff202b79b0c2b2ff8b
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5286216
Reviewed-by: Justin Cohen <justincohen@chromium.org>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
CrashpadInfo::AddUserDataMinidumpStream() and
UpdateUserDataMinidumpStream() allocate memory for the newly added
streams. This change makes the CrashpadInfo test free that allocated
memory to prevent memory leaks from these tests.

This is intended to fix the ASAN failures seen on crrev.com/c/5285881:
https://ci.chromium.org/ui/p/chromium/builders/try/linux_chromium_asan_rel_ng/1839072/overview

Bug: crashpad:474
Change-Id: I6e030291594d22e316942a58805a177ce448053b
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5292137
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Jesse McKenna <jessemckenna@google.com>
Bug: b/325495632
Change-Id: I19df5b44b76efcdb050344e79bcc2dfd18d8e289
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5299466
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
jessemckenna and others added 15 commits October 20, 2025 10:39
kBackwardsClockTolerance is in a header file, so it should be inlined to
ensure it's not duplicated across translation units.

This fixes the following Chromium presubmit warning:

Consider inlining constexpr variable definitions in headers outside of classes
to avoid unnecessary copies of the constant. See https://abseil.io/tips/168 for
more details.
  third_party\crashpad\crashpad\handler\crash_report_upload_rate_limit.h: 29
    constexpr int kBackwardsClockTolerance = 60 * 60 * 24;  // 1 day

Bug: 42310127
Change-Id: Ie37ec72f62f5e3ee8c8080e5e1dd951a575e248a
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/7056627
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Jesse McKenna <jessemckenna@google.com>
This fixes the following clang-tidy error seen when rolling Crashpad
into Chrome:

check: modernize-concat-nested-namespaces

nested namespaces can be concatenated
(https://clang.llvm.org/extra/clang-tidy/checks/modernize/concat-nested-namespaces.html)

Change-Id: I5b5ef3deef40e5850b92a0375b00b057c9b60244
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/7068660
Commit-Queue: Jesse McKenna <jessemckenna@google.com>
Reviewed-by: Mark Mentovai <mark@chromium.org>
use std::atomic_fetch_add() in place of base::subtle::Barrier_AtomicIncrement()
move __attribute__((packed)) to the end of the struct to satisfy GCC
meta: update 2025-10-22
#137)

* Support optional usage of stack pointer for captured stack frame
* fix: add GNU-stack note to crashpad_info_note.S

* bump lower-end GCC to 10.5.0 on Ubuntu 22.04
Updated C++ standard requirement from C++20 to C++17.
* add LANGUAGE ASM_MASM property to source files

* add LANGUAGE ASM_MARMASM property to source files + fix indentation
@sentry
Copy link
Copy Markdown

sentry Bot commented Apr 7, 2026

🚧 Skipped: PR exceeds review size limit.

Please split into smaller PRs and re-run.
Reference ID: 12934800

Comment thread build/ios/convert_gn_xcodeproj.py
Comment thread Makefile
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@sentry
Copy link
Copy Markdown

sentry Bot commented Apr 20, 2026

🚧 Skipped: PR exceeds review size limit.

Please split into smaller PRs and re-run.
Reference ID: 13574702

* fix(arm32): use %progbits in .note.GNU-stack section directive

@progbits is silently dropped on ARM because @ is the line-comment
character in ARM assembler syntax, leaving `.section .note.GNU-stack,""`
followed by an unrecognized comma — the assembler errors out with
"junk at end of line, first unrecognized character is `,`".

Switch to %progbits, which works on every supported architecture and
matches what the same file already does on the other two .section
directives (.note.crashpad.info and .rodata) above.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* ci: add Linux Arm32 cross-build matrix entry

Adds a "Linux Arm32 (gcc-arm-linux-gnueabihf)" row that runs on
ubuntu-24.04-arm and cross-compiles to armhf via the
gcc-arm-linux-gnueabihf toolchain. The arm64 runner is used because
its default apt sources point at ports.ubuntu.com, which serves armhf
multiarch packages directly — no sources.list surgery needed, just
`dpkg --add-architecture armhf` plus the cross-toolchain and armhf
runtime dev libs.

This catches arm-specific assembler / preprocessor breakages in the
client-side code (such as the .note.GNU-stack `@progbits` regression
that this branch also fixes) before they reach downstream consumers.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* ci: add Linux Arm64 native build matrix entries

Existing matrix had no native Linux Arm64 coverage. Add GCC and clang
rows on ubuntu-24.04-arm so arm64-specific build issues (which x86
builds wouldn't catch) get a CI signal.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* ci: point pkg-config at armhf multiarch dir for arm32 cross-build

CRASHPAD_ENABLE_STACKTRACE=ON triggers a pkg_check_modules call for
libunwind-ptrace. The .pc file lives in /usr/lib/arm-linux-gnueabihf/
pkgconfig once libunwind-dev:armhf is installed, but pkg-config's
default search path on the arm64 runner is the host's
/usr/lib/aarch64-linux-gnu/pkgconfig and misses it. Set
PKG_CONFIG_LIBDIR via GITHUB_ENV from the install step so subsequent
build steps inherit it; using PKG_CONFIG_LIBDIR (not PKG_CONFIG_PATH)
also prevents accidentally linking host-arch libs into the cross
binary.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@sentry
Copy link
Copy Markdown

sentry Bot commented Apr 21, 2026

🚧 Skipped: PR exceeds review size limit.

Please split into smaller PRs and re-run.
Reference ID: 13622292

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sentry
Copy link
Copy Markdown

sentry Bot commented Apr 21, 2026

🚧 Skipped: PR exceeds review size limit.

Please split into smaller PRs and re-run.
Reference ID: 13633434

Co-authored-by: OpenAI Codex <noreply@openai.com>
@sentry
Copy link
Copy Markdown

sentry Bot commented Apr 28, 2026

🚧 Skipped: PR exceeds review size limit.

Please split into smaller PRs and re-run.
Reference ID: 13801046

@sentry
Copy link
Copy Markdown

sentry Bot commented May 7, 2026

🚧 Skipped: PR exceeds review size limit.

Please split into smaller PRs and re-run.
Reference ID: 13964875

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8044671. Configure here.

Comment thread client/client_argv_handling.h
Co-authored-by: OpenAI Codex <noreply@openai.com>
@sentry
Copy link
Copy Markdown

sentry Bot commented May 7, 2026

🚧 Skipped: PR exceeds review size limit.

Please split into smaller PRs and re-run.
Reference ID: 13967760

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.