WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] - Stacktrace modification

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] - Stacktrace modification
From: "Robert S. Phillips" <rphillips@xxxxxxxxxxxxxxx>
Date: Wed, 17 May 2006 09:51:18 -0400
Delivery-date: Fri, 19 May 2006 04:30:01 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0.7-1.1.fc4 (X11/20050929)
This patch aids the quick diagnosis of stack overflow bugs.
In the debug build when showing a stack trace, show stack limits
and stack frame addresses.  This results in the follow
appearance:

    (XEN) Stack base:ffff830000234000 limit:ffff830000233000
    (XEN) Xen call trace:
    (XEN)    ffff830000233c28[<ffff830000144fe4>] put_page_type+0xf8/0x455
(XEN) ffff830000233c48[<ffff830000140d0a>] put_page_and_type+0x15/0x20 (XEN) ffff830000233c88[<ffff830000142271>] put_page_from_l1e+0x12a/0x1ad
    (XEN)    ffff830000233cf8[<ffff83000014b7d9>] revalidate_l1+0x18f/0x1a7
    (XEN)    ffff830000233d88[<ffff83000014ba93>] ptwr_flush+0x2a2/0x4fb
(XEN) ffff830000233da8[<ffff83000014cd86>] cleanup_writable_pagetable+0x68/0x88
    (XEN)    ffff830000233f08[<ffff8300001469cf>] do_mmuext_op+0xd4/0xaf5
    (XEN)    00007cffffdcc0b7[<ffff8300001ca45d>] syscall_enter+0xad/0x107

Signed-off-by: Robert S. Phillips (rphillips@xxxxxxxxxxxxxxx)
# HG changeset patch
# User rphillips@rphillips
# Node ID f5480845f7080594723fe107e04fb4b9e4223b74
# Parent  204450e59b0a80a99ae335ef9cdf33de0caaaa77

This patch aids the quick diagnosis of stack overflow bugs.
In the debug build when showing a stack trace, show stack limits
and stack frame addresses.  This results in the follow
appearance:

     (XEN) Stack base:ffff830000234000 limit:ffff830000233000
     (XEN) Xen call trace:
     (XEN)    ffff830000233c28[<ffff830000144fe4>] put_page_type+0xf8/0x455
     (XEN)    ffff830000233c48[<ffff830000140d0a>] put_page_and_type+0x15/0x20
     (XEN)    ffff830000233c88[<ffff830000142271>] put_page_from_l1e+0x12a/0x1ad
     (XEN)    ffff830000233cf8[<ffff83000014b7d9>] revalidate_l1+0x18f/0x1a7
     (XEN)    ffff830000233d88[<ffff83000014ba93>] ptwr_flush+0x2a2/0x4fb
     (XEN)    ffff830000233da8[<ffff83000014cd86>] 
cleanup_writable_pagetable+0x68/0x88
     (XEN)    ffff830000233f08[<ffff8300001469cf>] do_mmuext_op+0xd4/0xaf5
     (XEN)    00007cffffdcc0b7[<ffff8300001ca45d>] syscall_enter+0xad/0x107

Signed-off-by: Robert S. Phillips (rphillips@xxxxxxxxxxxxxxx)

diff -r 204450e59b0a -r f5480845f708 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c      Tue May 16 11:26:53 2006 -0400
+++ b/xen/arch/x86/traps.c      Tue May 16 11:47:06 2006 -0400
@@ -198,20 +198,22 @@
 
 static void show_trace(struct cpu_user_regs *regs)
 {
-    unsigned long *frame, next, addr, low, high;
-
-    printk("Xen call trace:\n   ");
-
-    printk("[<%p>]", _p(regs->eip));
-    print_symbol(" %s\n   ", regs->eip);
+    unsigned long *frame, next, addr, low, high, bos, los;
 
     /* Bounds for range of valid frame pointer. */
     low  = (unsigned long)(ESP_BEFORE_EXCEPTION(regs) - 2);
     high = (low & ~(STACK_SIZE - 1)) + 
         (STACK_SIZE - sizeof(struct cpu_info) - 2*sizeof(unsigned long));
-
+    bos = (low & ~(STACK_SIZE - 1)) + STACK_SIZE;
+    los = bos - PAGE_SIZE;
+    printk("Stack base:%p limit:%p\n", _p(bos), _p(los));
+    printk("Xen call trace:\n   ");
+    
     /* The initial frame pointer. */
     next = regs->ebp;
+    
+    printk("%p[<%p>]", _p(next), _p(regs->eip));
+    print_symbol(" %s\n   ", regs->eip);
 
     for ( ; ; )
     {
@@ -239,7 +241,7 @@
             addr  = frame[1];
         }
 
-        printk("[<%p>]", _p(addr));
+        printk("%p[<%p>]", _p(next), _p(addr));
         print_symbol(" %s\n   ", addr);
 
         low = (unsigned long)&frame[2];
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] - Stacktrace modification, Robert S. Phillips <=