diff --git a/changes/bug17151 b/changes/bug17151 new file mode 100644 index 0000000000..0993b90eac --- /dev/null +++ b/changes/bug17151 @@ -0,0 +1,7 @@ + o Minor bugfixes (portability): + - Use libexecinfo on FreeBSD, to enable backtrace support. Fixes part of + bug 17151; bugfix on 0.2.5.2-alpha. Patch from Marcin Cieślak. + + o Minor bugfixes (testing): + - Skip backtrace tests when backtrace support is not compiled in. Fixes + part of bug 17151; bugfix on 0.2.7.1-alpha. Patch from Marcin Cieślak. diff --git a/changes/bug17154 b/changes/bug17154 new file mode 100644 index 0000000000..6ad7b74468 --- /dev/null +++ b/changes/bug17154 @@ -0,0 +1,3 @@ + o Minor bugfixes (testing): + - Fix breakage when running 'make check' with BSD make. Fixes bug + 17154; bugfix on 0.2.7.3-rc. Patch by Marcin Cieślak. diff --git a/configure.ac b/configure.ac index a6fa1cb38e..53ed865d31 100644 --- a/configure.ac +++ b/configure.ac @@ -360,6 +360,7 @@ AC_SEARCH_LIBS(socket, [socket network]) AC_SEARCH_LIBS(gethostbyname, [nsl]) AC_SEARCH_LIBS(dlopen, [dl]) AC_SEARCH_LIBS(inet_aton, [resolv]) +AC_SEARCH_LIBS(backtrace, [execinfo]) saved_LIBS="$LIBS" AC_SEARCH_LIBS([clock_gettime], [rt]) if test "$LIBS" != "$saved_LIBS"; then diff --git a/src/or/include.am b/src/or/include.am index 7b12b56eb1..d0e955f495 100644 --- a/src/or/include.am +++ b/src/or/include.am @@ -123,9 +123,9 @@ src_or_tor_cov_LDADD = src/or/libtor-testing.a src/common/libor-testing.a \ src/common/libor-event-testing.a src/trunnel/libor-trunnel-testing.a \ @TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ @TOR_OPENSSL_LIBS@ \ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ @TOR_SYSTEMD_LIBS@ -export TESTING_TOR_BINARY = $(top_builddir)/src/or/tor-cov +export TESTING_TOR_BINARY=$(top_builddir)/src/or/tor-cov else -export TESTING_TOR_BINARY = $(top_builddir)/src/or/tor +export TESTING_TOR_BINARY=$(top_builddir)/src/or/tor endif ORHEADERS = \ diff --git a/src/test/test_bt.sh b/src/test/test_bt.sh index 56e6cc40f8..f55f451f92 100755 --- a/src/test/test_bt.sh +++ b/src/test/test_bt.sh @@ -3,6 +3,7 @@ exitcode=0 +"${builddir:-.}/src/test/test-bt-cl" backtraces || exit 77 "${builddir:-.}/src/test/test-bt-cl" assert | "${PYTHON:-python}" "${abs_top_srcdir:-.}/src/test/bt_test.py" || exitcode=1 "${builddir:-.}/src/test/test-bt-cl" crash | "${PYTHON:-python}" "${abs_top_srcdir:-.}/src/test/bt_test.py" || exitcode=1 diff --git a/src/test/test_bt_cl.c b/src/test/test_bt_cl.c index 01c621eb0e..dabaee6e0a 100644 --- a/src/test/test_bt_cl.c +++ b/src/test/test_bt_cl.c @@ -84,15 +84,24 @@ main(int argc, char **argv) if (argc < 2) { puts("I take an argument. It should be \"assert\" or \"crash\" or " - "\"none\""); + "\"backtraces\" or \"none\""); return 1; } + +#if !(defined(HAVE_EXECINFO_H) && defined(HAVE_BACKTRACE) && \ + defined(HAVE_BACKTRACE_SYMBOLS_FD) && defined(HAVE_SIGACTION)) + puts("Backtrace reporting is not supported on this platform"); + return 77; +#endif + if (!strcmp(argv[1], "assert")) { crashtype = 1; } else if (!strcmp(argv[1], "crash")) { crashtype = 0; } else if (!strcmp(argv[1], "none")) { crashtype = -1; + } else if (!strcmp(argv[1], "backtraces")) { + return 0; } else { puts("Argument should be \"assert\" or \"crash\" or \"none\""); return 1;