From 72f7b290185c2f86085d6dbec56b6f3ab9f5dbfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Wed, 23 Jan 2008 21:47:17 +0000 Subject: [PATCH] Limit the number of stack frames we print. Infinite recursions or, even worse, cyclic stack frames would be seriously annoying. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23712 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/vm/vm.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/system/kernel/vm/vm.cpp b/src/system/kernel/vm/vm.cpp index 31e41cc545..f104c5e2fc 100644 --- a/src/system/kernel/vm/vm.cpp +++ b/src/system/kernel/vm/vm.cpp @@ -3719,7 +3719,9 @@ vm_page_fault(addr_t address, addr_t faultAddress, bool isWrite, bool isUser, #endif dprintf("stack trace:\n"); - while (status == B_OK && frame.return_address != NULL) { + int32 maxFrames = 50; + while (status == B_OK && --maxFrames >= 0 + && frame.return_address != NULL) { dprintf(" %p", frame.return_address); area = vm_area_lookup(addressSpace, (addr_t)frame.return_address);