fuchsia: clarify stack capture in case of stack overflow

Bug: fuchsia:74897
Change-Id: I1a81feaa2e854c51d7dc476d57b5f7d1ffb1d6e7
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2895346
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Francois Rousseau <frousseau@google.com>
This commit is contained in:
Francois Rousseau 2021-05-13 16:31:10 -07:00 committed by Commit Bot
parent 0ac2a18ece
commit e841b92e18

View File

@ -46,6 +46,12 @@ void GetStackRegions(
#error Port
#endif
// TODO(fxbug.dev/74897): make this work for stack overflows, e.g., by looking
// up using the initial stack pointer (sp) when the thread was created. Right
// now, it gets the stack by getting the mapping that contains the current sp.
// But in the case of stack overflows, the current sp is by definition outside
// of the stack so the mapping returned is not the stack and fails the type
// check, at least on arm64.
zx_info_maps_t range_with_sp;
if (!memory_map.FindMappingForAddress(sp, &range_with_sp)) {
LOG(ERROR) << "stack pointer not found in mapping";
@ -54,7 +60,7 @@ void GetStackRegions(
if (range_with_sp.type != ZX_INFO_MAPS_TYPE_MAPPING) {
LOG(ERROR) << "stack range has unexpected type " << range_with_sp.type
<< ", aborting";
<< ", stack overflow? Aborting";
return;
}