[Crash-utility] IKCONFIG initialize timing

Kazuo Moriwaka moriwaka at valinux.co.jp
Fri Aug 18 11:38:57 UTC 2006


Hi,

For xen domain dump image, read_in_kernel_config() calls
gdb_interface() like following backtrace, and crash exits with a fatal
error "crash: gdb_interface: gdb not initialized?". 


#0  gdb_interface (req=0x83c54a0) at gdb_interface.c:301
#1  0x0810ef5c in datatype_info (name=0x8303513 "vcpu_guest_context", member=0x8304b38 "ctrlreg", dm=0x0) at symbols.c:3648
#2  0x080fcff0 in x86_xendump_p2m_create (xd=0x83aaa80) at x86.c:4345
#3  0x081381ed in xc_core_p2m_create () at xendump.c:952
#4  0x08135bbb in xc_core_read (bufptr=0x8403be8, cnt=1568, addr=3223390688, paddr=2165216) at xendump.c:131
#5  0x081372d9 in read_xendump (fd=-1, bufptr=0x8403be8, cnt=1568, addr=3223390688, paddr=2165216) at xendump.c:663
#6  0x08095d07 in readmem (addr=3223390688, memtype=1, buffer=0x8403be8, size=32768, type=0x82fe2da "kernel_config_data",
    error_handle=2) at memory.c:1563
#7  0x080e57a8 in read_in_kernel_config (command=0) at kernel.c:5113
#8  0x080825ce in main (argc=3, argv=0xafa7ba54) at main.c:383


I made following patch which changes timing to read ikconfig data
after gdb initialize.  This is checked by compile and run for xendump
on x86_32 and x86_32pae.


diff -u crash-4.0-3.1/kernel.c crash-4.0-3.1.patched/kernel.c
--- crash-4.0-3.1/kernel.c	2006-08-05 00:24:00.000000000 +0900
+++ crash-4.0-3.1.patched/kernel.c	2006-08-18 20:07:52.000000000 +0900
@@ -152,6 +152,7 @@
 		break;
 
 	case POST_GDB:
+                read_in_kernel_config(IKCFG_INIT);
 		if (symbol_exists("__per_cpu_offset")) {
 			i = get_array_length("__per_cpu_offset", NULL, 0);
 			get_symbol_data("__per_cpu_offset", 
diff -u crash-4.0-3.1/main.c crash-4.0-3.1.patched/main.c
--- crash-4.0-3.1/main.c	2006-08-05 00:24:00.000000000 +0900
+++ crash-4.0-3.1.patched/main.c	2006-08-18 20:10:34.000000000 +0900
@@ -380,7 +380,6 @@
 	machdep_init(PRE_SYMTAB);
         symtab_init();
 	machdep_init(PRE_GDB);
-	read_in_kernel_config(IKCFG_INIT);
         datatype_init();
 
 	/*

-- 
Kazuo Moriwaka <moriwaka at valinux.co.jp>




More information about the Crash-utility mailing list