From: "Robert S. Phillips" <rphillips@virtualiron.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] - Stacktrace modification
Date: Wed, 17 May 2006 09:51:18 -0400 [thread overview]
Message-ID: <446B2A56.50005@virtualiron.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 974 bytes --]
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@virtualiron.com)
[-- Attachment #2: patch-9811-stacktrace --]
[-- Type: text/plain, Size: 2440 bytes --]
# 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@virtualiron.com)
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];
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
reply other threads:[~2006-05-17 13:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=446B2A56.50005@virtualiron.com \
--to=rphillips@virtualiron.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.