New issue
Advanced search Search tips

Issue 892167 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 14
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 1
Type: Bug

Blocked on:
issue 894363



Sign in to add a comment

libFuzzer on Mac PC Table Mismatch

Project Member Reported by metzman@chromium.org, Oct 4

Issue description

Since 9/30 (at latest) all Mac runs of libFuzzer have quit early with this error:

ERROR: The size of coverage PC tables does not match the
number of instrumented PCs. This might be a compiler bug,
please contact the libFuzzer developers.
Also check https://bugs.llvm.org/show_bug.cgi?id=34636
for possible workarounds (tl;dr: don't use the old GNU ld)


See gs://clusterfuzz-libfuzzer-logs/libFuzzer_safe_browsing_dmg_fuzzer/mac_libfuzzer_chrome_asan/ for proof.

It seems likely to me that this has happened ever since the switch to -fsanitize=fuzzer, since (I think) this bug can only occur with the new instrumentation. 

I'm not reverting the patch because it's only affected Mac.

Assigning to Max as he made the switch and (more importantly) because no one else has a Mac.

 
Abhishek and I looked at the stats (https://clusterfuzz.com/v2/fuzzer-stats/by-time/date-start/2018-06-01/date-end/2018-10-03/fuzzer/libFuzzer_safe_browsing_hfs_fuzzer/job/mac_libfuzzer_chrome_asan) and it seems pretty likely that this was caused by the fsanitize=fuzzer switch since the switch was made August 15th and there's almost no activity after that date, while there was before.
Cc: mascasa@google.com kcc@chromium.org
ccing dynamic-tools folks who may know more about this breakage.
Matt, was your fix for issue 856239 (similar problem on Linux) platform specific? Maybe we can just do the same thing in Mac-specific code, if this is the case?
Project Member

Comment 4 by bugdroid1@chromium.org, Oct 4

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f892900930eeb0fe9a235330441166bbe61edc6c

commit f892900930eeb0fe9a235330441166bbe61edc6c
Author: Jonathan Metzman <metzman@chromium.org>
Date: Thu Oct 04 18:25:29 2018

[libFuzzer][Mac] Speculative fix for PC Table Mismatch

Use old instrumentation on Mac because of PC Table mismatch with 8-bit
counters.
Also fix comment misstating default value of sanitizer_coverage_flags.

TBR=mmoroz@chromium.org

Bug:  892167 
Change-Id: I8c69911dd88630dcb382891b4b7e7ed885fced4b
Reviewed-on: https://chromium-review.googlesource.com/c/1262077
Commit-Queue: Jonathan Metzman <metzman@chromium.org>
Reviewed-by: Max Moroz <mmoroz@chromium.org>
Reviewed-by: Abhishek Arya <inferno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596766}
[modify] https://crrev.com/f892900930eeb0fe9a235330441166bbe61edc6c/build/config/sanitizers/BUILD.gn
[modify] https://crrev.com/f892900930eeb0fe9a235330441166bbe61edc6c/build/config/sanitizers/sanitizers.gni

I suspect we may need to add the inline 8-bit counters and PC tables to the "Used" set on Mac.  We already do this with PC guards on Mac.  Not sure exactly why we have to do this, or if there's a better way (that doesn't prevent dead stripping)... I believe Kostya did some investigation in the past.
Cc: och...@chromium.org mbarbe...@chromium.org infe...@chromium.org metzman@chromium.org
Components: -Tools>Stability>ClusterFuzz
I'm removing Tools>Stability>ClusterFuzz component to get rid of RVG restriction and share this with George from Apple.
Components: Tools>Stability>libFuzzer
Status: Started (was: Assigned)
Confirmed that disabling dead stripping (like in issue 856239) "fixes" the problem, but it is not something we should do. Looking more.
Thanks a lot to Matt's advice, I've uploaded https://reviews.llvm.org/D53113 and https://reviews.llvm.org/D53114.
Blockedon: 894363
Project Member

Comment 12 by bugdroid1@chromium.org, Nov 13

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a6986c17e678c3a36b024dacb3e61e71a658f26b

commit a6986c17e678c3a36b024dacb3e61e71a658f26b
Author: Max Moroz <mmoroz@chromium.org>
Date: Tue Nov 13 17:38:17 2018

[libFuzzer] Switch back to -fsanitize=fuzzer-no-link instrumentation on Mac.

This reverts the speculative fix landed in https://crrev.com/c/1262077.

Bug:  892167 
Change-Id: I1eb3c8c9cb2615cfd33681554fad7e4234a4a497
Reviewed-on: https://chromium-review.googlesource.com/c/1332428
Reviewed-by: Jonathan Metzman <metzman@chromium.org>
Commit-Queue: Max Moroz <mmoroz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607636}
[modify] https://crrev.com/a6986c17e678c3a36b024dacb3e61e71a658f26b/build/config/sanitizers/BUILD.gn
[modify] https://crrev.com/a6986c17e678c3a36b024dacb3e61e71a658f26b/build/config/sanitizers/sanitizers.gni

Status: Fixed (was: Started)

Sign in to add a comment