public inbox for kexec@lists.infradead.org
 help / color / mirror / Atom feed
From: bwalle@suse.de (Bernhard Walle)
To: kexec@lists.infradead.org
Cc: oomichi@mxs.nes.nec.co.jp
Subject: [patch] [PATCH] Parse 64 bit VMCOREINFO on 32 bit userland
Date: Fri, 28 Nov 2008 10:08:09 +0100	[thread overview]
Message-ID: <20081128090809.GA27442@suse.de> (raw)

This bug fixes the problem that on a 32 bit userland makedumpfile (as common
on the PPC platform) the parsing of the 64 bit VMCOREINFO fails with:

   # makedumpfile -c /home/sachin/dump/vmcore vmcore.filtered
   read_vmcoreinfo_symbol: Invalid data in /tmp/vmcoreinfowVoyJK:
   SYMBOL(mem_section)=c000000000bb4400

We just need to assume that the symbols are always 'unsigned long long' (64 bit)
instead of 'unsigned long' (native pointer size on Linux platforms).


Signed-off-by: Bernhard Walle <bwalle@suse.de>

---
 makedumpfile.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -2271,10 +2271,10 @@ read_vmcoreinfo_basic_info(void)
 	return TRUE;
 }
 
-unsigned long
+unsigned long long
 read_vmcoreinfo_symbol(char *str_symbol)
 {
-	unsigned long symbol = NOT_FOUND_SYMBOL;
+	unsigned long long symbol = NOT_FOUND_SYMBOL;
 	char buf[BUFSIZE_FGETS], *endp;
 	unsigned int i;
 
@@ -2291,8 +2291,8 @@ read_vmcoreinfo_symbol(char *str_symbol)
 		if (buf[i - 1] == '\n')
 			buf[i - 1] = '\0';
 		if (strncmp(buf, str_symbol, strlen(str_symbol)) == 0) {
-			symbol = strtoul(buf + strlen(str_symbol), &endp, 16);
-			if ((!symbol || symbol == ULONG_MAX)
+			symbol = strtoull(buf + strlen(str_symbol), &endp, 16);
+			if ((!symbol || symbol == ULONGLONG_MAX)
 			    || strlen(endp) != 0) {
 				ERRMSG("Invalid data in %s: %s",
 				    info->name_vmcoreinfo, buf);

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

                 reply	other threads:[~2008-11-28  9:08 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=20081128090809.GA27442@suse.de \
    --to=bwalle@suse.de \
    --cc=kexec@lists.infradead.org \
    --cc=oomichi@mxs.nes.nec.co.jp \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox