WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
216746
Enable AddressSanitizer in C++ std library templates
https://bugs.webkit.org/show_bug.cgi?id=216746
Summary
Enable AddressSanitizer in C++ std library templates
David Kilzer (:ddkilzer)
Reported
2020-09-20 10:47:50 PDT
Enable AddressSanitizer in C++ std library templates. This amounts to undefining the _LIBCPP_HAS_NO_ASAN macro when building. Although most of WebKit doesn't used C++ std library types like std::vector or std::hash, ANGLE and libwebrtc do use these types, so it's beneficial to enable AddressSanitizer in these cases when compiling with Asan enabled for the rest of WebKit.
Attachments
Patch v1
(2.44 KB, patch)
2020-09-20 11:10 PDT
,
David Kilzer (:ddkilzer)
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
David Kilzer (:ddkilzer)
Comment 1
2020-09-20 11:10:18 PDT
Created
attachment 409239
[details]
Patch v1
David Kilzer (:ddkilzer)
Comment 2
2020-09-20 11:11:25 PDT
(In reply to David Kilzer (:ddkilzer) from
comment #0
)
> Although most of WebKit doesn't used C++ std library types like std::vector > or std::hash, ANGLE and libwebrtc do use these types, so it's beneficial to > enable AddressSanitizer in these cases when compiling with Asan enabled for > the rest of WebKit.
Actually, I think this is mostly affects std::vector and related classes, not std::hash.
David Kilzer (:ddkilzer)
Comment 3
2020-09-20 11:19:59 PDT
I CCed folks that work on ANGLE and libwebrtc since there is a small chance that enabling this might find some latent issues in those libraries when running layout tests.
Alexey Proskuryakov
Comment 4
2020-09-20 13:03:27 PDT
Comment on
attachment 409239
[details]
Patch v1 View in context:
https://bugs.webkit.org/attachment.cgi?id=409239&action=review
> Tools/sanitizer/asan.xcconfig:9 > +WK_SANITIZER_OTHER_CPLUSPLUSFLAGS_YES = $(inherited) -U_LIBCPP_HAS_NO_ASAN;
Nice. Did you run tests locally to confirm that nothing terrible was going to happen? EWS doesn't have ASan.
> Tools/sanitizer/sanitizer.xcconfig:7 > WK_SANITIZER_OTHER_CFLAGS_YES = -fno-omit-frame-pointer -g; > +WK_SANITIZER_OTHER_CPLUSPLUSFLAGS_YES = ;
Does "-fno-omit-frame-pointer -g" get added for C++ in some other way, or do we not need it?
David Kilzer (:ddkilzer)
Comment 5
2020-09-20 20:45:48 PDT
Comment on
attachment 409239
[details]
Patch v1 View in context:
https://bugs.webkit.org/attachment.cgi?id=409239&action=review
>> Tools/sanitizer/asan.xcconfig:9 >> +WK_SANITIZER_OTHER_CPLUSPLUSFLAGS_YES = $(inherited) -U_LIBCPP_HAS_NO_ASAN; > > Nice. Did you run tests locally to confirm that nothing terrible was going to happen? EWS doesn't have ASan.
Yes. No new ASan-related crashes in any std C++ objects.
>> Tools/sanitizer/sanitizer.xcconfig:7 >> +WK_SANITIZER_OTHER_CPLUSPLUSFLAGS_YES = ; > > Does "-fno-omit-frame-pointer -g" get added for C++ in some other way, or do we not need it?
As noted in the ChangeLog, OTHER_CFLAGS applies to C++ sources, so it doesn't need to be listed twice. I verified this by reviewing build log output.
Alexey Proskuryakov
Comment 6
2020-09-21 12:01:20 PDT
> As noted in the ChangeLog, OTHER_CFLAGS applies to C++ sources, so it doesn't need to be listed twice.
My understanding was that OTHER_CFLAGS was the default value for OTHER_CPLUSPLUSFLAGS, but it had no effect when OTHER_CPLUSPLUSFLAGS was defined.
> I verified this by reviewing build log output.
Surprising.
Radar WebKit Bug Importer
Comment 7
2020-09-21 12:25:34 PDT
<
rdar://problem/69319755
>
EWS
Comment 8
2020-09-21 13:02:29 PDT
Committed
r267358
: <
https://trac.webkit.org/changeset/267358
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 409239
[details]
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug