mirror of
https://github.com/yuzu-emu/breakpad.git
synced 2025-07-23 03:08:42 +00:00
Fix corrupted symbol file due to malformed INLINE/INLINE_ORIGIN records
- Ignore DW_TAG_inlined_subroutine with empty range. - Don't stop parsing after parsing malformed INLINE/INLINE_ORIGIN records, because reports can still be generated without them but won't have inlined frames. Bug: 1190878 Change-Id: I445105ad06b9146268f7d064e85b0d162c3f2a39 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3321166 Reviewed-by: Joshua Peraza <jperaza@chromium.org>
This commit is contained in:
parent
0ae29c99d1
commit
647aa17a7a
|
@ -652,6 +652,11 @@ void DwarfCUToModule::InlineHandler::Finish() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ignore DW_TAG_inlined_subroutine with empty range.
|
||||||
|
if (ranges.empty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Every DW_TAG_inlined_subroutine should have a DW_AT_abstract_origin.
|
// Every DW_TAG_inlined_subroutine should have a DW_AT_abstract_origin.
|
||||||
assert(specification_offset_ != 0);
|
assert(specification_offset_ != 0);
|
||||||
|
|
||||||
|
|
|
@ -128,6 +128,7 @@ bool BasicSourceLineResolver::Module::LoadMapFromMemory(
|
||||||
linked_ptr<Function> cur_func;
|
linked_ptr<Function> cur_func;
|
||||||
int line_number = 0;
|
int line_number = 0;
|
||||||
int num_errors = 0;
|
int num_errors = 0;
|
||||||
|
int inline_num_errors = 0;
|
||||||
char* save_ptr;
|
char* save_ptr;
|
||||||
|
|
||||||
// If the length is 0, we can still pretend we have a symbol file. This is
|
// If the length is 0, we can still pretend we have a symbol file. This is
|
||||||
|
@ -208,12 +209,13 @@ bool BasicSourceLineResolver::Module::LoadMapFromMemory(
|
||||||
} else if (strncmp(buffer, "INLINE ", 7) == 0) {
|
} else if (strncmp(buffer, "INLINE ", 7) == 0) {
|
||||||
linked_ptr<Inline> in = ParseInline(buffer);
|
linked_ptr<Inline> in = ParseInline(buffer);
|
||||||
if (!in.get())
|
if (!in.get())
|
||||||
LogParseError("ParseInline failed", line_number, &num_errors);
|
LogParseError("ParseInline failed", line_number, &inline_num_errors);
|
||||||
else
|
else
|
||||||
cur_func->AppendInline(in);
|
cur_func->AppendInline(in);
|
||||||
} else if (strncmp(buffer, "INLINE_ORIGIN ", 14) == 0) {
|
} else if (strncmp(buffer, "INLINE_ORIGIN ", 14) == 0) {
|
||||||
if (!ParseInlineOrigin(buffer)) {
|
if (!ParseInlineOrigin(buffer)) {
|
||||||
LogParseError("ParseInlineOrigin failed", line_number, &num_errors);
|
LogParseError("ParseInlineOrigin failed", line_number,
|
||||||
|
&inline_num_errors);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!cur_func.get()) {
|
if (!cur_func.get()) {
|
||||||
|
|
Loading…
Reference in a new issue