fix: increase max crash key value length (#24782)

* fix: increase max crash key value length

* chore: fix linting

* chore: fix linux

* Update spec-main/api-crash-reporter-spec.ts

Co-authored-by: Jeremy Rose <jeremya@chromium.org>

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
This commit is contained in:
Jeremy Rose 2020-07-29 19:04:04 -07:00 committed by GitHub
parent 01023435c0
commit d93bb34ac4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 5 deletions

View file

@ -24,7 +24,19 @@ namespace crash_keys {
namespace {
using ExtraCrashKeys = std::deque<crash_reporter::CrashKeyString<127>>;
#if defined(OS_LINUX)
// Breakpad has a flawed system of calculating the number of chunks
// we add 127 bytes to force an extra chunk
constexpr size_t kMaxCrashKeyValueSize = 20479;
#else
constexpr size_t kMaxCrashKeyValueSize = 20320;
#endif
static_assert(kMaxCrashKeyValueSize < crashpad::Annotation::kValueMaxSize,
"max crash key value length above what crashpad supports");
using ExtraCrashKeys =
std::deque<crash_reporter::CrashKeyString<kMaxCrashKeyValueSize>>;
ExtraCrashKeys& GetExtraCrashKeys() {
static base::NoDestructor<ExtraCrashKeys> extra_keys;
return *extra_keys;