Commit a1246f9a authored by ssid's avatar ssid Committed by Commit Bot

Remove exidx wrapper in arm builds

Removes exidx wrapper from arm32 unwinds. The wrapper caused issues
with unwinding crashes in official test bots, crbug/1078588. Since we
are not using libunwind to unwind due to other crashes, this wrapper can
be removed.

BUG=1078588

Change-Id: Ifc6832345a715e75a4344f4dcdd1b570d6f0626b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2330743Reviewed-by: default avataroysteine <oysteine@chromium.org>
Commit-Queue: ssid <ssid@chromium.org>
Cr-Commit-Position: refs/heads/master@{#808093}
parent 5fc4fde4
...@@ -13,10 +13,6 @@ buildflag_header("buildflags") { ...@@ -13,10 +13,6 @@ buildflag_header("buildflags") {
flags = [ "ENABLE_LOADER_LOCK_SAMPLING=$enable_loader_lock_sampling" ] flags = [ "ENABLE_LOADER_LOCK_SAMPLING=$enable_loader_lock_sampling" ]
} }
config("wrap_find_exidx") {
ldflags = [ "-Wl,-wrap,dl_unwind_find_exidx" ]
}
source_set("traced_process") { source_set("traced_process") {
sources = [ sources = [
"traced_process.cc", "traced_process.cc",
...@@ -162,9 +158,6 @@ target(tracing_lib_type, "cpp") { ...@@ -162,9 +158,6 @@ target(tracing_lib_type, "cpp") {
] ]
deps += [ "//buildtools/third_party/libunwind" ] deps += [ "//buildtools/third_party/libunwind" ]
include_dirs = [ "//buildtools/third_party/libunwind/trunk/include" ] include_dirs = [ "//buildtools/third_party/libunwind/trunk/include" ]
# stack_unwinder_android.cc overrides the dl_unwind_find_exidx function.
all_dependent_configs += [ ":wrap_find_exidx" ]
} }
} # !is_ios && !is_nacl } # !is_ios && !is_nacl
} }
...@@ -440,43 +440,8 @@ static void ThreadSignalHandler(int n, siginfo_t* siginfo, void* sigcontext) { ...@@ -440,43 +440,8 @@ static void ThreadSignalHandler(int n, siginfo_t* siginfo, void* sigcontext) {
*params->success = true; *params->success = true;
} }
// ARM EXIDX table contains addresses in sorted order with unwind data, each of
// 32 bits.
struct FakeExidx {
uintptr_t pc;
uintptr_t index_data;
};
} // namespace } // namespace
extern "C" {
_Unwind_Ptr __real_dl_unwind_find_exidx(_Unwind_Ptr, int*);
// Override the default |dl_unwind_find_exidx| function used by libunwind to
// give a fake unwind table just for the handler function. Otherwise call the
// original function. Libunwind marks the cursor invalid if it finds even one
// frame without unwind info. Mocking the info keeps the unwind cursor valid
// after unwind_init_local() within ThreadSignalHandler().
__attribute__((visibility("default"), noinline)) _Unwind_Ptr
__wrap_dl_unwind_find_exidx(_Unwind_Ptr pc, int* length) {
if (!CFIBacktraceAndroid::is_chrome_address(pc)) {
return __real_dl_unwind_find_exidx(pc, length);
}
// Fake exidx table that is passed to libunwind to work with chrome functions.
// 0x80000000 has high bit set to 1. This means the unwind data is inline and
// not in exception table (section 5 EHABI). 0 on the second high byte causes
// a 0 proceedure to be lsda. But this is never executed since the pc and sp
// will be overridden, before calling unw_step.
static const FakeExidx chrome_exidx_data[] = {
{CFIBacktraceAndroid::executable_start_addr(), 0x80000000},
{CFIBacktraceAndroid::executable_end_addr(), 0x80000000}};
*length = base::size(chrome_exidx_data);
return reinterpret_cast<_Unwind_Ptr>(chrome_exidx_data);
}
} // extern "C"
namespace tracing { namespace tracing {
// static // static
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment