summaryrefslogtreecommitdiff
path: root/os/osinit.c
diff options
context:
space:
mode:
authorJoel Bosveld <joel.bosveld@gmail.com>2009-09-08 23:06:00 +0800
committerJoel Bosveld <joel.bosveld@gmail.com>2009-09-08 23:55:13 +0800
commit1ba17340a98a34b40f78442963aa4132e6cfae5c (patch)
treed11d814844e4ad037d146133250b73f28cdb3e31 /os/osinit.c
parent5e38708c3466129c3e5af40a915c044bb26e083f (diff)
parent1bdc9ec617d357b076c9e69296018bc212d91c7d (diff)
Merge branch 'upstream' (one day I will rebase rather than merge)HEADmaster
Conflicts: test/Makefile.am
Diffstat (limited to 'os/osinit.c')
-rw-r--r--os/osinit.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/os/osinit.c b/os/osinit.c
index 17a2bedc7..e8fcd4540 100644
--- a/os/osinit.c
+++ b/os/osinit.c
@@ -59,6 +59,10 @@ SOFTWARE.
#ifdef HAVE_DLFCN_H
# include <dlfcn.h>
#endif
+#ifdef HAVE_BACKTRACE
+#include <execinfo.h>
+#endif
+
#include "dixstruct.h"
@@ -192,6 +196,16 @@ OsInit(void)
siglist[i], strerror(errno));
}
}
+#ifdef HAVE_BACKTRACE
+ /*
+ * initialize the backtracer, since the ctor calls dlopen(), which
+ * calls malloc(), which isn't signal-safe.
+ */
+ do {
+ void *array;
+ backtrace(&array, 1);
+ } while (0);
+#endif
#ifdef RTLD_DI_SETSIGNAL
/* Tell runtime linker to send a signal we can catch instead of SIGKILL