From bb940d21474958a1d8ee2abffdcb6bac27918398 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sun, 9 Nov 2008 20:07:40 -0800 Subject: [PATCH] Make backtraces slightly more reliable. We now ignore pointers that are not null but still clearly wild. We could check that there's really a valid PDE and PTE (I think Linux does this) but it would take more code and be ugly. --- src/lib/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/debug.c b/src/lib/debug.c index 6d7c9e1..1dc1bf8 100644 --- a/src/lib/debug.c +++ b/src/lib/debug.c @@ -17,7 +17,7 @@ debug_backtrace (void) printf ("Call stack:"); for (frame = __builtin_frame_address (0); - frame != NULL && frame[0] != NULL; + (uintptr_t) frame >= 0x1000 && frame[0] != NULL; frame = frame[0]) printf (" %p", frame[1]); printf (".\n"); -- 2.30.2