[Crash-utility] crash-7.0.9 vs. 7.0.8 on ARM - crashing

Dave Anderson anderson at redhat.com
Fri Jan 30 14:29:01 UTC 2015


----- Original Message -----
> Hi,
>
> It looks like crash-7.0.9 is broken on ARM, while 7.0.8 works without
> any problems.
>
> I compiled both versions on my ARM target board exactly the same way,
> but 7.0.9 throws a core dump when invoked.[1]
>
> # CONFIG_ARM_LPAE is not set
>
> [1] http://pastebin.com/HpHeHBAF
>
> Please advise
>
> Regards,
>
> Robert

Good catch.  Apparently the ARM users and maintainers on this list don't
ever run "live" as you are doing.  And since I don't have any ARM hardware,
I can only test it on supplied dumpfiles with an x86 binary built with
"make target=ARM".

The problem is this patch that went into crash-7.0.9:

  Improve the method for determining whether a 32-bit ARM vmlinux is
  an LPAE enabled kernel by first checking whether CONFIG_ARM_LPAE
  exists in the vmcoreinfo data, and if it does not, by then checking
  whether the next higher symbol above "swapper_pg_dir" is 0x5000 bytes
  higher in value.
  (sdu.liu at huawei.com)


diff --git a/arm.c b/arm.c
index cb7d841..e7d3dbc 100644
--- a/arm.c
+++ b/arm.c
@@ -190,6 +190,8 @@ void
 arm_init(int when)
 {
        ulong vaddr;
+       char *string;
+       struct syment *sp;
 
 #if defined(__i386__) || defined(__x86_64__)
        if (ACTIVE())
@@ -229,8 +231,13 @@ arm_init(int when)
                 * LPAE requires an additional page for the PGD,
                 * so PG_DIR_SIZE = 0x5000 for LPAE
                 */
-               if ((symbol_value("_text") - symbol_value("swapper_pg_dir")) == 0x5000)
+               if ((string = pc->read_vmcoreinfo("CONFIG_ARM_LPAE"))) {
                        machdep->flags |= PAE;
+                       free(string);
+               } else if ((sp = next_symbol("swapper_pg_dir", NULL)) &&
+                        (sp->value - symbol_value("swapper_pg_dir")) == 0x5000)
+                         machdep->flags |= PAE;
+
                machdep->kvbase = symbol_value("_stext") & ~KVBASE_MASK;
                machdep->identity_map_base = machdep->kvbase;
                machdep->is_kvaddr = arm_is_kvaddr;


The pc->read_vmcoreinfo method is only initialized for ELF kdumps and
compressed kdumps.  So either a dummy function should be put in there
that returns a NULL or arm_init() should check for its existence.

I appreciate the bug report -- I'll post something today for crash-7.1.0.

Thanks,
  Dave




> ..."One of my most productive days was throwing away 1000 lines of
> code." - Ken Thompson.
>
> My public pgp key is available,at:
> http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x90320BF1
>
> 




More information about the Crash-utility mailing list