Skip to content

Commit

Permalink
Make sure to build libc++abi without -fsanitize=vptr.
Browse files Browse the repository at this point in the history
The existing suppression that dealt with this will stop working after
a libc++abi roll.

Bug: 1181057,609786
Change-Id: I8a4716d90a0a20de622dbb8c15daab1d44aec473
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2716602
Commit-Queue: Nico Weber <thakis@chromium.org>
Commit-Queue: Arthur Eubanks <aeubanks@google.com>
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: Arthur Eubanks <aeubanks@google.com>
Cr-Commit-Position: refs/heads/master@{#856913}
  • Loading branch information
nico authored and Chromium LUCI CQ committed Feb 23, 2021
1 parent c0917ea commit c3215ba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 8 additions & 0 deletions buildtools/third_party/libc++abi/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ source_set("libc++abi") {
"//buildtools/third_party/libc++:config",
]

# private_typeinfo.cpp implements __dynamic_cast(), which is the runtime
# bit that implements dynamic_cast<>(). But ubsan's vptr check inserts
# dynamic_cast<>()s, which leads to infinite recursion. So make sure we don't
# pass -fsanitize=vptr.
configs -= [ "//build/config/sanitizers:default_sanitizer_flags" ]
configs +=
[ "//build/config/sanitizers:default_sanitizer_flags_but_ubsan_vptr" ]

if (export_libcxxabi_from_executables || libcxx_is_shared) {
configs -= [ "//build/config/gcc:symbol_visibility_hidden" ]
configs += [ "//build/config/gcc:symbol_visibility_default" ]
Expand Down
6 changes: 0 additions & 6 deletions tools/ubsan/vptr_blacklist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,3 @@ type:*StartPageService*
# Remove once function attribute level blacklisting is implemented.
# See crbug.com/476063.
fun:*forbidGCDuringConstruction*

#############################################################################
# UBsan goes into an infinite recursion when __dynamic_cast instrumented with
# "vptr". See crbug.com/609786.

src:*/third_party/libc\+\+abi/trunk/src/private_typeinfo.cpp

0 comments on commit c3215ba

Please sign in to comment.