Bug 190327 - [Xcode] Never build yasm with ASAN
Summary: [Xcode] Never build yasm with ASAN
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-10-06 00:40 PDT by mitz
Modified: 2020-04-06 10:27 PDT (History)
7 users (show)

See Also:


Attachments
Opt yasm out of ASAN (2.62 KB, patch)
2018-10-06 00:43 PDT, mitz
youennf: review+
commit-queue: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2018-10-06 00:40:17 PDT
yasm is only used at build time to derive other source files, so there’s no point building it with ASAN. Worse, when targeting the iOS Simulator, yasm is built as a Simulator binary, even though it’s then run on the host. This works, but if ASAN is enabled, it tries to link against the Simulator ASAN dylib, which causes a failure at runtime.

Patch forthcoming.
Comment 1 mitz 2018-10-06 00:43:36 PDT
Created attachment 351719 [details]
Opt yasm out of ASAN
Comment 2 youenn fablet 2018-10-06 07:23:39 PDT
Comment on attachment 351719 [details]
Opt yasm out of ASAN

View in context: https://bugs.webkit.org/attachment.cgi?id=351719&action=review

> Tools/asan/asan.xcconfig:16
> +CLANG_ADDRESS_SANITIZER_NO = YES;

Is it working?
Should we set WK_ASAN_ALLOWED = NO in yasm.xcconfig and 
CLANG_ADDRESS_SANITIZER = $(CLANG_ADDRESS_SANITIZER_$(WK_ASAN_ALLOWED));
CLANG_ADDRESS_SANITIZER_NO = NO;
Comment 3 mitz 2018-10-06 08:49:52 PDT
Comment on attachment 351719 [details]
Opt yasm out of ASAN

View in context: https://bugs.webkit.org/attachment.cgi?id=351719&action=review

>> Tools/asan/asan.xcconfig:16
>> +CLANG_ADDRESS_SANITIZER_NO = YES;
> 
> Is it working?
> Should we set WK_ASAN_ALLOWED = NO in yasm.xcconfig and 
> CLANG_ADDRESS_SANITIZER = $(CLANG_ADDRESS_SANITIZER_$(WK_ASAN_ALLOWED));
> CLANG_ADDRESS_SANITIZER_NO = NO;

By convention, if a build setting is not specified, it’s equivalent to being set to NO. So if we wanted a build setting that means “ASAN allowed” we’d have to remember to explicitly set it to YES in every project. Since this is such a rare exception, I opted for something we set in the one place where we make the exception.
Comment 4 WebKit Commit Bot 2018-10-06 09:05:09 PDT
Comment on attachment 351719 [details]
Opt yasm out of ASAN

Rejecting attachment 351719 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-01', 'apply-attachment', '--no-update', '--non-interactive', 351719, '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit

Logging in as commit-queue@webkit.org...
Fetching: https://bugs.webkit.org/attachment.cgi?id=351719&action=edit
Fetching: https://bugs.webkit.org/show_bug.cgi?id=190327&ctype=xml&excludefield=attachmentdata
Processing 1 patch from 1 bug.
Processing patch 351719 from bug 190327.
Fetching: https://bugs.webkit.org/attachment.cgi?id=351719
Failed to run "[u'/Volumes/Data/EWS/WebKit/Tools/Scripts/svn-apply', '--force', '--reviewer', u'Youenn Fablet']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

Parsed 4 diffs from patch file(s).
(Stripping trailing CRs from patch.)
patching file Source/ThirdParty/libwebrtc/ChangeLog
Hunk #1 succeeded at 1 with fuzz 3.
(Stripping trailing CRs from patch.)
patching file Source/ThirdParty/libwebrtc/Configurations/yasm.xcconfig
Hunk #1 FAILED at 19.
1 out of 1 hunk FAILED -- saving rejects to file Source/ThirdParty/libwebrtc/Configurations/yasm.xcconfig.rej
(Stripping trailing CRs from patch.)
patching file Tools/ChangeLog
(Stripping trailing CRs from patch.)
patching file Tools/asan/asan.xcconfig

Failed to run "[u'/Volumes/Data/EWS/WebKit/Tools/Scripts/svn-apply', '--force', '--reviewer', u'Youenn Fablet']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

Full output: https://webkit-queues.webkit.org/results/9473060
Comment 5 mitz 2018-10-06 09:07:37 PDT
Committed <https://trac.webkit.org/r236898>.
Comment 6 Radar WebKit Bug Importer 2018-10-06 09:08:22 PDT
<rdar://problem/45068477>
Comment 7 Alexey Proskuryakov 2018-10-06 10:16:18 PDT
There is some benefit building internal tools with ASan - we want them to behave reliably, so catching random memory corruption is useful.