Marc Gonzalez
unread,Jul 4, 2023, 8:57:47 AM7/4/23Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-br...@googlegroups.com, Joshua Peraza, Mark Mentovai, Ivan Penkov, Lei Zhang, Yuki Wang, Arnaud Vrac
Functions that inspect the ELF header such as FindElfSection()
actually expect a pointer to the start of the file.
Thus, we must map the entire object file.
In fact, mapping.offset doesn't even make sense to me.
---
src/client/linux/minidump_writer/linux_dumper.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/client/linux/minidump_writer/linux_dumper.cc b/src/client/linux/minidump_writer/linux_dumper.cc
index 85922a9c..5c4c389c 100644
--- a/src/client/linux/minidump_writer/linux_dumper.cc
+++ b/src/client/linux/minidump_writer/linux_dumper.cc
@@ -346,7 +346,7 @@ LinuxDumper::ElfFileIdentifierForMapping(const MappingInfo& mapping,
return false;
bool filename_modified = HandleDeletedFileInMapping(filename);
- MemoryMappedFile mapped_file(filename, mapping.offset);
+ MemoryMappedFile mapped_file(filename, 0);
if (!mapped_file.data() || mapped_file.size() < SELFMAG)
return false;
@@ -459,7 +459,7 @@ bool ElfFileSoName(const LinuxDumper& dumper,
if (!dumper.GetMappingAbsolutePath(mapping, filename))
return false;
- MemoryMappedFile mapped_file(filename, mapping.offset);
+ MemoryMappedFile mapped_file(filename, 0);
if (!mapped_file.data() || mapped_file.size() < SELFMAG) {
// mmap failed
return false;
--
2.34.1