[Crash-utility] [PATCH/RFC] Fix relocation address

Simon Kagstrom simon.kagstrom at netinsight.net
Thu Dec 17 15:05:24 UTC 2009


Hi!

I'm having problems getting kdumps from my relocatable kernel (2.6.31-8)
working with crash on a IA-32 board. I use makedumpfile to generate a
compressed dump, and when I try to load it with crash I get

  ./crash vmlinux vmcore --reloc=0x100000
  crash: invalid kernel virtual address: 98  type: "present"
  WARNING: cannot read cpu_present_map
  crash: invalid kernel virtual address: 908bd975  type: "online"
  WARNING: cannot read cpu_online_map
  crash: cannot determine base kernel version
  crash: vmlinux and vmcore do not match!

specifying --reloc also fails:

  ./crash vmlinux vmcore --reloc=0x100000
  crash: seek error: kernel virtual address: c01a2108  type: "cpu_possible_mask"


So I started looking into the code and found something which looks like
a typo in relocate() (patch below). Changing this makes crash work for
me.

Great tool by the way, leaves you longing for the next kernel panic ;-)

// Simon

--- orig-crash-4.1.2/symbols.c	2009-12-09 21:37:40.000000000 +0100
+++ crash-4.1.2/symbols.c	2009-12-17 16:03:24.000000000 +0100
@@ -671,7 +671,7 @@ relocate(ulong symval, char *symname, in
 		break;
 	}
 
-	return (symval - kt->relocate);
+	return (symval + kt->relocate);
 }
 
 /*




More information about the Crash-utility mailing list