Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Unified Diff: snapshot/mac/mach_o_image_segment_reader.cc

Issue 1276573002: Tolerate weird cl_kernels modules on Mac OS X 10.11 (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | snapshot/mac/process_reader_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: snapshot/mac/mach_o_image_segment_reader.cc
diff --git a/snapshot/mac/mach_o_image_segment_reader.cc b/snapshot/mac/mach_o_image_segment_reader.cc
index 8a077ddec036410e5ec373eb024c416712281d54..5c74d80dd1815ac10a9a6202e003abd1679ec727 100644
--- a/snapshot/mac/mach_o_image_segment_reader.cc
+++ b/snapshot/mac/mach_o_image_segment_reader.cc
@@ -121,8 +121,8 @@ bool MachOImageSegmentReader::Initialize(ProcessReader* process_reader,
if (section_segment_name != segment_name) {
// cl_kernels modules (for OpenCL) aren’t ld output, and they’re formatted
- // incorrectly on Mac OS X 10.10. They have a single __TEXT segment, but
- // one of the sections within it claims to belong to the __LD segment.
+ // incorrectly on OS X 10.10 and 10.11. They have a single __TEXT segment,
+ // but one of the sections within it claims to belong to the __LD segment.
// This mismatch shouldn’t happen. This errant section also has the
// S_ATTR_DEBUG flag set, which shouldn’t happen unless all of the other
// sections in the segment also have this bit set (they don’t). These odd
@@ -132,13 +132,19 @@ bool MachOImageSegmentReader::Initialize(ProcessReader* process_reader,
// sometimes more will be, tolerate this quirk.
//
// https://openradar.appspot.com/20239912
- if (!(file_type == MH_BUNDLE &&
- module_name == "cl_kernels" &&
- MacOSXMinorVersion() == 10 &&
+ bool ok = false;
+ if (file_type == MH_BUNDLE && module_name == "cl_kernels") {
+ int mac_os_x_minor_version = MacOSXMinorVersion();
+ if ((mac_os_x_minor_version == 10 || mac_os_x_minor_version == 11) &&
segment_name == SEG_TEXT &&
section_segment_name == "__LD" &&
section_name == "__compact_unwind" &&
- (section.flags & S_ATTR_DEBUG))) {
+ (section.flags & S_ATTR_DEBUG)) {
+ ok = true;
+ }
+ }
+
+ if (!ok) {
LOG(WARNING) << "section.segname incorrect in segment " << segment_name
<< section_info;
return false;
« no previous file with comments | « no previous file | snapshot/mac/process_reader_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698