Hi,
The attached patch fixes the following xencrash bugs:
* "bt" not switch mca stack to vcpu stack (ia64.c)
* "bt" causes infinite loop if ar_bspstore is illegal value
(unwind.c line 1747)
(illegal ar_bspstore value may be something worng, error stop
is OK. the fix is not limited for XEN_HYPER_MODE, I think
the fix is more robust.)
* "bt" shows unnecessary warning message (unwind.c line 1674)
* "man log" causes SIGSEGV (xen_hyper_global_data.c)
* "man log" is no example (xen_hyper_global_data.c)
The patch is for crash-4.0-3.20.
Thanks.
--
Itsuro ODA <oda(a)valinux.co.jp>
--
Index: ia64.c
===================================================================
RCS file: /cvsroot/xen_ia64/people/xencrash/src/crash/ia64.c,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -r1.3 -r1.3.2.1
--- ia64.c 21 Feb 2007 22:58:33 -0000 1.3
+++ ia64.c 9 Mar 2007 06:40:22 -0000 1.3.2.1
@@ -4009,7 +4009,7 @@
if (symbol_exists("unw_init_frame_info")) {
machdep->flags |= NEW_UNWIND;
if (MEMBER_EXISTS("unw_frame_info", "pt")) {
- if (MEMBER_EXISTS("pt_regs", "ar_csd")) {
+ if (MEMBER_EXISTS("cpu_user_regs", "ar_csd")) {
machdep->flags |= NEW_UNW_V3;
ms->unwind_init = unwind_init_v3;
ms->unwind = unwind_v3;
Index: unwind.c
===================================================================
RCS file: /cvsroot/xen_ia64/people/xencrash/src/crash/unwind.c,v
retrieving revision 1.2
retrieving revision 1.2.2.2
diff -u -r1.2 -r1.2.2.2
--- unwind.c 21 Feb 2007 22:58:33 -0000 1.2
+++ unwind.c 14 Mar 2007 07:33:21 -0000 1.2.2.2
@@ -1674,8 +1674,13 @@
unw_get_sp(info, &sp);
unw_get_bsp(info, &bsp);
- if (ip < GATE_ADDR + PAGE_SIZE)
- break;
+ if (XEN_HYPER_MODE()) {
+ if (!IS_KVADDR(ip))
+ break;
+ } else {
+ if (ip < GATE_ADDR + PAGE_SIZE)
+ break;
+ }
if ((sm = value_search(ip, NULL)))
name = sm->name;
@@ -1747,7 +1752,8 @@
if (unw_switch_from_osinit_v3(info, bt, "INIT") == FALSE)
break;
} else {
- unw_switch_from_osinit_v2(info, bt);
+ if (unw_switch_from_osinit_v2(info, bt) == FALSE)
+ break;
frame++;
goto restart;
}
Index: xen_hyper_global_data.c
===================================================================
RCS file: /cvsroot/xen_ia64/people/xencrash/src/crash/xen_hyper_global_data.c,v
retrieving revision 1.2
retrieving revision 1.2.2.3
diff -u -r1.2 -r1.2.2.3
--- xen_hyper_global_data.c 21 Feb 2007 22:58:33 -0000 1.2
+++ xen_hyper_global_data.c 14 Mar 2007 07:28:21 -0000 1.2.2.3
@@ -169,7 +169,41 @@
char *xen_hyper_help_log[] = {
"log",
"dump system message buffer",
+" ",
" This command dumps the xen conring contents in chronological order." ,
+" ",
+"EXAMPLES",
+" Dump the Xen message buffer:\n",
+" %s> log",
+" __ __ _____ ___ _ _ _",
+" \\ \\/ /___ _ __ |___ / / _ \\ _ _ _ __ ___| |_ __ _| |__ | |
___",
+" \\ // _ \\ '_ \\ |_ \\| | | |__| | | | '_ \\/ __| __/ _` | '_
\\| |/ _ \\",
+" / \\ __/ | | | ___) | |_| |__| |_| | | | \\__ \\ || (_| | |_) | |
__/",
+" /_/\\_\\___|_| |_| |____(_)___/ \\__,_|_|
|_|___/\\__\\__,_|_.__/|_|\\___|",
+" ",
+"
http://www.cl.cam.ac.uk/netos/xen",
+" University of Cambridge Computer Laboratory",
+" ",
+" Xen version 3.0-unstable (damm@) (gcc version 3.4.6 (Gentoo 3.4.6-r1,
ssp-3.4.5-1.0,",
+" pie-8.7.9)) Wed Dec 6 17:34:32 JST 2006",
+" Latest ChangeSet: unavailable",
+" ",
+" (XEN) Console output is synchronous.",
+" (XEN) Command line: 12733-i386-pae/xen.gz console=com1 sync_console
conswitch=bb com1",
+" =115200,8n1,0x3f8 dom0_mem=480000 crashkernel=64M@32M",
+" (XEN) Physical RAM map:",
+" (XEN) 0000000000000000 - 0000000000098000 (usable)",
+" (XEN) 0000000000098000 - 00000000000a0000 (reserved)",
+" (XEN) 00000000000f0000 - 0000000000100000 (reserved)",
+" (XEN) 0000000000100000 - 000000003f7f0000 (usable)",
+" (XEN) 000000003f7f0000 - 000000003f7f3000 (ACPI NVS)",
+" (XEN) 000000003f7f3000 - 000000003f800000 (ACPI data)",
+" (XEN) 00000000e0000000 - 00000000f0000000 (reserved)",
+" (XEN) 00000000fec00000 - 0000000100000000 (reserved)",
+" (XEN) Kdump: 64MB (65536kB) at 0x2000000",
+" (XEN) System RAM: 1015MB (1039904kB)",
+" (XEN) ACPI: RSDP (v000 XPC ) @
0x000f9250",
+" ...",
NULL
};
--