Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Crash Utility (http://www.linux-archive.org/crash-utility/)
-   -   ARM: corrupted pages tables vs unwind (http://www.linux-archive.org/crash-utility/626061-arm-corrupted-pages-tables-vs-unwind.html)

Rabin Vincent 01-28-2012 09:06 AM

ARM: corrupted pages tables vs unwind
 
I have access to a system whose crashdump extraction mechanism
unfortunately trashes the first few hundred kilobytes of physical
memory, which includes the page tables at swapper_pg_dir.

crash does chug along and remains quite useful without these page tables
since much of the interesting information is in the direct mapped
region, but it disables the use of the unwind tables because it
fails to read the module unwind tables, which are placed at a
non-direct-mapped address.

The patch below allows unwind tables to be used only for core kernel
addresses if the module tables are inaccessible.

Alternatively, we could perhaps not attempt to read the
module unwind tables when --no_modules is specified.

Rabin

diff --git a/unwind_arm.c b/unwind_arm.c
index 6554804..a21c592 100644
--- a/unwind_arm.c
+++ b/unwind_arm.c
@@ -148,8 +148,6 @@ init_unwind_tables(void)
if (!init_module_unwind_tables()) {
error(WARNING,
"UNWIND: failed to initialize module unwind tables
");
- free_kernel_unwind_table();
- return FALSE;
}

/*
@@ -347,6 +345,7 @@ fail:
}

free(module_unwind_tables);
+ module_unwind_tables = NULL;
return FALSE;
}

@@ -536,7 +535,7 @@ search_table(ulong ip)
*/
if (is_core_kernel_text(ip)) {
return kernel_unwind_table;
- } else {
+ } else if (module_unwind_tables) {
struct unwind_table *tbl;

for (tbl = &module_unwind_tables[0]; tbl->idx; tbl++) {

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility

Mika Westerberg 01-29-2012 06:02 PM

ARM: corrupted pages tables vs unwind
 
On Sat, Jan 28, 2012 at 03:36:28PM +0530, Rabin Vincent wrote:
> I have access to a system whose crashdump extraction mechanism
> unfortunately trashes the first few hundred kilobytes of physical
> memory, which includes the page tables at swapper_pg_dir.
>
> crash does chug along and remains quite useful without these page tables
> since much of the interesting information is in the direct mapped
> region, but it disables the use of the unwind tables because it
> fails to read the module unwind tables, which are placed at a
> non-direct-mapped address.
>
> The patch below allows unwind tables to be used only for core kernel
> addresses if the module tables are inaccessible.
>
> Alternatively, we could perhaps not attempt to read the
> module unwind tables when --no_modules is specified.

IMHO crash should at least try to allow user to perform analysis even if it
cannot do V<->P translations via page tables. The patch looks good and makes
ARM port of crash a bit more tolerant so,

Acked-by: Mika Westerberg <mika.westerberg@iki.fi>

Thanks!

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility

Dave Anderson 01-30-2012 03:57 PM

ARM: corrupted pages tables vs unwind
 
----- Original Message -----
> On Sat, Jan 28, 2012 at 03:36:28PM +0530, Rabin Vincent wrote:
> > I have access to a system whose crashdump extraction mechanism
> > unfortunately trashes the first few hundred kilobytes of physical
> > memory, which includes the page tables at swapper_pg_dir.
> >
> > crash does chug along and remains quite useful without these page tables
> > since much of the interesting information is in the direct mapped
> > region, but it disables the use of the unwind tables because it
> > fails to read the module unwind tables, which are placed at a
> > non-direct-mapped address.
> >
> > The patch below allows unwind tables to be used only for core kernel
> > addresses if the module tables are inaccessible.
> >
> > Alternatively, we could perhaps not attempt to read the
> > module unwind tables when --no_modules is specified.
>
> IMHO crash should at least try to allow user to perform analysis even if it
> cannot do V<->P translations via page tables. The patch looks good and makes
> ARM port of crash a bit more tolerant so,
>
> Acked-by: Mika Westerberg <mika.westerberg@iki.fi>
>
> Thanks!
>

One small change required:

$ make warn
...
cc -c -g -DARM -m32 -D_FILE_OFFSET_BITS=64 -DGDB_7_3_1 unwind_arm.c -o unwind_arm.o -Wall -O2 -Wstrict-prototypes -Wmissing-prototypes -fstack-protector
unwind_arm.c:219: warning: ‘free_kernel_unwind_table’ defined but not used
...

I'll remove the free_kernel_unwind_table() function since nobody
calls it anymore -- and then queue it for crash-6.0.3.

Dave

> --
> Crash-utility mailing list
> Crash-utility@redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility
>

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility


All times are GMT. The time now is 03:52 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.