From f7e07777e033e580351dc6886ab7dbdddd9839fe Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Sun, 13 Apr 2008 17:50:45 -0400 Subject: runtime backtrace: stop infinite loops by checking for full print buffer 2008-04-13 Frank Ch. Eigler * print.c (_stp_pbuf_full): New function to note full print buffer. * stack-{i386,x86_64}.c: Use it in all stack-searching loops, to impose another limit against unbounded iteration. --- runtime/stack-x86_64.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'runtime/stack-x86_64.c') diff --git a/runtime/stack-x86_64.c b/runtime/stack-x86_64.c index ae8e446d..9915c594 100644 --- a/runtime/stack-x86_64.c +++ b/runtime/stack-x86_64.c @@ -12,7 +12,8 @@ static void _stp_stack_print_fallback(unsigned long stack, int verbose) { unsigned long addr; - while (stack & (THREAD_SIZE - 1)) { + while (stack & (THREAD_SIZE - 1) && + !_stp_pbuf_full()) { if (unlikely(_stp_read_address(addr, (unsigned long *)stack, KERNEL_DS))) { /* cannot access stack. give up. */ return; -- cgit