mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-09 14:06:33 +00:00
mac: Work around broken {CTL_KERN, KERN_PROCARGS2} sysctl in 11.0db6
A new bug in macOS 11.0db6 20A5364e has broken the {CTL_KERN, KERN_PROCARGS2} sysctl such that it will not work properly unless provided with a buffer at least 17 bytes larger than originally indicated. Work around the bug by providing a buffer a whole 32 bytes larger. Bug: crashpad:347, crashpad:355 Test: crashpad_util_test ProcessInfo.{Self,SelfTask,Forked} Change-Id: I9324a63390875308979a10fefcd4c1c880651aee Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2399646 Reviewed-by: Robert Sesek <rsesek@chromium.org> Commit-Queue: Mark Mentovai <mark@chromium.org>
This commit is contained in:
parent
ca88ff1edb
commit
fc97e5cbb2
@ -175,7 +175,14 @@ bool ProcessInfo::Arguments(std::vector<std::string>* argv) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
args_size = args_size_estimate + 1;
|
||||
// TODO(https://crashpad.chromium.org/bug/355): This was increased from + 1
|
||||
// to + 32 to work around a new bug in macOS 11.0db6 20A5364e that has
|
||||
// broken {CTL_KERN, KERN_PROCARGS2} such that it will not work properly
|
||||
// unless provided with a buffer at least 17 bytes larger than indicated in
|
||||
// args_size_estimate. If this bug is fixed prior to the 11.0 release,
|
||||
// remove the workaround and go back to + 1. (A positive offset is needed
|
||||
// for the reasons described above.)
|
||||
args_size = args_size_estimate + 32;
|
||||
args.resize(args_size);
|
||||
rv = sysctl(mib, base::size(mib), &args[0], &args_size, nullptr, 0);
|
||||
if (rv != 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user