Bug 1926561 - Fix Breakpad's detection of anonymous mappings r=afranchuk

Differential Revision: https://phabricator.services.mozilla.com/D226630
This commit is contained in:
Gabriele Svelto
2024-10-28 16:41:50 +00:00
parent 838b2a2d88
commit 3f7bc3bfd0

View File

@@ -593,11 +593,18 @@ bool LinuxDumper::EnumerateMappings() {
bool exec = (*(i2 + 3) == 'x');
const char* i3 = my_read_hex_ptr(&offset, i2 + 6 /* skip ' rwxp ' */);
if (*i3 == ' ') {
const char* name = NULL;
const char* name = my_strchr(line, '/');
const char* label = my_strchr(line, '[');
// Anonymous mappings may sometimes contain path-like names so we
// have to explicitly tell them apart.
if ((name != NULL) && (label != NULL)) {
name = NULL;
}
// Only copy name if the name is a valid path name, or if
// it's the VDSO image.
if (((name = my_strchr(line, '/')) == NULL) &&
linux_gate_loc &&
if ((name == NULL) && linux_gate_loc &&
reinterpret_cast<void*>(start_addr) == linux_gate_loc) {
name = kLinuxGateLibraryName;
offset = 0;