From 825b6638cf76aecc5a540d3fa662d157760fc11e Mon Sep 17 00:00:00 2001 From: Aliaksey Kandratsenka Date: Wed, 12 Jun 2024 19:43:04 -0400 Subject: [PATCH] don't try to unit-test generic_fp on known-broken platforms I.e. 32-bit legacy arm has broken frame pointers backtracing. This fixes https://github.com/gperftools/gperftools/issues/1512 --- src/stacktrace.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/stacktrace.cc b/src/stacktrace.cc index 75575d6..2698b14 100644 --- a/src/stacktrace.cc +++ b/src/stacktrace.cc @@ -372,6 +372,23 @@ const char* TEST_bump_stacktrace_implementation(const char* suggestion) { // skip null implementation continue; } +#ifdef HAVE_GST_arm + if (get_stack_impl == &impl__arm) { + // "arm" backtracer is hopelessly broken. So don't test. We + // still ship it, though, just in case. + continue; + } +#endif // HAVE_GST_arm +#if defined(HAVE_GST_generic_fp) && (!__x86_64__ && !__i386__ && !__aarch64__ && !__riscv) + // Those "major" architectures have functional frame pointer + // backtracer and they're built with -fno-omit-frame-pointers + // -mno-omit-leaf-frame-pointer. So we do expect those tests to + // succeed. Everyone else (e.g. 32-bit legacy arm) is unlikely to + // pass. + if (get_stack_impl == &impl__generic_fp || get_stack_impl == &impl__generic_fp_unsafe) { + continue; + } +#endif // generic_fp && !"good architecture" break; } while (true);