Skip to content

Commit 0c84f8a

Browse files
committed
Explicitly check for backtrace() and backtrace_symbols()
1 parent e79e661 commit 0c84f8a

4 files changed

Lines changed: 98 additions & 70 deletions

File tree

Modules/faulthandler.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ faulthandler_dump_traceback(int fd, int all_threads,
216216
reentrant = 0;
217217
}
218218

219-
#ifdef HAVE_EXECINFO_H
219+
#if defined(HAVE_EXECINFO_H) && defined(HAVE_BACKTRACE) && defined(HAVE_BACKTRACE_SYMBOLS)
220220
static void
221221
faulthandler_stack_dump_impl(int fd)
222222
{

configure

Lines changed: 86 additions & 68 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2929,7 +2929,7 @@ AC_DEFINE([STDC_HEADERS], [1],
29292929

29302930
# checks for header files
29312931
AC_CHECK_HEADERS([ \
2932-
alloca.h asm/types.h bluetooth.h conio.h direct.h dlfcn.h endian.h errno.h execinfo.h fcntl.h grp.h \
2932+
alloca.h asm/types.h bluetooth.h conio.h direct.h dlfcn.h endian.h errno.h fcntl.h grp.h \
29332933
io.h langinfo.h libintl.h libutil.h linux/auxvec.h sys/auxv.h linux/fs.h linux/limits.h linux/memfd.h \
29342934
linux/netfilter_ipv4.h linux/random.h linux/soundcard.h linux/sched.h \
29352935
linux/tipc.h linux/wait.h netdb.h net/ethernet.h netinet/in.h netpacket/packet.h poll.h process.h pthread.h pty.h \
@@ -2944,6 +2944,10 @@ AC_CHECK_HEADERS([ \
29442944
AC_HEADER_DIRENT
29452945
AC_HEADER_MAJOR
29462946

2947+
# for faulthandler
2948+
AC_CHECK_HEADERS([execinfo.h],
2949+
[AC_CHECK_FUNCS(backtrace backtrace_symbols)])
2950+
29472951
# bluetooth/bluetooth.h has been known to not compile with -std=c99.
29482952
# http://permalink.gmane.org/gmane.linux.bluez.kernel/22294
29492953
SAVE_CFLAGS=$CFLAGS

pyconfig.h.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@
8989
/* Define to 1 if you have the `atanh' function. */
9090
#undef HAVE_ATANH
9191

92+
/* Define to 1 if you have the `backtrace' function. */
93+
#undef HAVE_BACKTRACE
94+
95+
/* Define to 1 if you have the `backtrace_symbols' function. */
96+
#undef HAVE_BACKTRACE_SYMBOLS
97+
9298
/* Define if you have the 'bind' function. */
9399
#undef HAVE_BIND
94100

0 commit comments

Comments
 (0)