Skip to content

Commit

Permalink
Fix UBSAN reported access to withing misaligned addresses
Browse files Browse the repository at this point in the history
This is can be an issue on ARM, it can cause a hang of
CrashReportTest.MiniDump test on macOS.
  • Loading branch information
sergio-nsk committed Aug 6, 2024
1 parent ff38335 commit 57e5e28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/client/linux/minidump_writer/directory_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,10 @@ class DirectoryReader {

private:
const int fd_;
bool hit_eof_;
unsigned buf_used_;
uint8_t buf_[sizeof(struct kernel_dirent) + NAME_MAX + 1];
alignas(struct kernel_dirent)
uint8_t buf_[sizeof(struct kernel_dirent) + NAME_MAX + 1];
bool hit_eof_;
};

} // namespace google_breakpad
Expand Down
2 changes: 1 addition & 1 deletion src/client/linux/minidump_writer/linux_dumper.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ class LinuxDumper {
// ID of the crashed thread.
pid_t crash_thread_;

mutable PageAllocator allocator_;
mutable alignas(MappingInfo) PageAllocator allocator_;

// IDs of all the threads.
wasteful_vector<pid_t> threads_;
Expand Down

0 comments on commit 57e5e28

Please sign in to comment.