From 125e5ed58b72550e6b74e0139c2c3dd5e262a6ec Mon Sep 17 00:00:00 2001 From: Aliaksey Kandratsenka Date: Sat, 12 Apr 2014 12:38:19 -0700 Subject: [PATCH] don't enable backtrace() for stacktrace capturing by default Because we don't yet have a treatment for deadlocks that are caused by (recursive) use of malloc from within that facility. --- configure.ac | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index bb81424..4e39a6b 100644 --- a/configure.ac +++ b/configure.ac @@ -81,6 +81,11 @@ if test "$enable_minimal" = yes; then enable_heap_profiler=no enable_heap_checker=no fi +AC_ARG_ENABLE([stacktrace-via-backtrace], + [AS_HELP_STRING([--enable-stacktrace-via-backtrace], + [enable use of backtrace() for stacktrace capturing (may deadlock)])], + [enable_backtrace=yes], + []) # Checks for programs. @@ -394,8 +399,9 @@ case "$host" in ;; esac -AC_CHECK_DECLS([backtrace], [], [], [#include ]) - +if test "x$enable_backtrace" = xyes; then + AC_CHECK_DECLS([backtrace], [], [], [#include ]) +fi # For windows, this has a non-trivial value (__declspec(export)), but any # system that uses configure wants this to be the empty string. @@ -471,5 +477,7 @@ AC_CONFIG_FILES([Makefile src/gperftools/tcmalloc.h src/windows/gperftools/tcmalloc.h]) AC_OUTPUT -AS_IF([test "$x86_no_fp_by_default" = yes && test "x$enable_frame_pointers" != xyes && test "x$UNWIND_LIBS" = x], - [AC_MSG_WARN([No frame pointers and no libunwind. Expect backtrace capturing and unittests to fail])]) +AS_IF([test "$x86_no_fp_by_default" = yes && test "x$enable_frame_pointers" != xyes && test "x$UNWIND_LIBS" = x && test "x$enable_minimal" != xyes], + [AS_IF([test "x$enable_backtrace" = xyes], + [AC_MSG_WARN([No frame pointers and no libunwind. Expect backtrace capturing and unittests to fail])], + [AC_MSG_FAILURE([No frame pointers and no libunwind. The compilation will fail])])])