libguestfs/0001-appliance-Use-a-glibc-trick-to-try-to-display-a-stac.patch
Richard W.M. Jones 95a41e67df New upstream version 1.21.11.
- Add experimental patch to capture stack trace of segfaults in the appliance.
2013-02-14 22:18:47 +00:00

35 lines
818 B
Diff

From c598e14052399f19d36d7874d7133cba779bd3c2 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Thu, 14 Feb 2013 22:15:25 +0000
Subject: [PATCH] appliance: Use a glibc trick to try to display a stack trace
if a program in the appliance segfaults.
---
appliance/init | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/appliance/init b/appliance/init
index dee4efc..e7e59da 100755
--- a/appliance/init
+++ b/appliance/init
@@ -10,6 +10,16 @@ RUNLEVEL=S
PREVLEVEL=N
export RUNLEVEL PREVLEVEL
+# Try to print a stack trace for segfaults inside the appliance.
+for d in /lib64 /lib; do
+ f=$d/libSegFault.so
+ if [ -f "$f" ]; then
+ LD_PRELOAD=$f
+ export LD_PRELOAD
+ break
+ fi
+done
+
mkdir -p /sysroot
if [ ! -d /proc ]; then rm -f /proc; fi
--
1.8.1.2