FAQ Search Today's Posts Mark Forums Read

» Linux Archive
Home
New Posts
Search
FAQ



 
 
LinkBack Thread Tools
 
Old 03-28-2008, 01:32 AM
Yang Zhiguo
 
Default search -k

hi,

When i use search command as following, there is a Segmentation fault.
crash> search -k 12345
Segmentation fault

With the following patch, it is OK?

--- ../crash/crash-4.0-6.1/memory.c 2008-02-29 01:09:10.000000000 +0900
+++ memory.c 2008-03-28 10:32:47.000000000 +0900
@@ -11047,6 +11047,11 @@ search(ulong start, ulong end, ulong mas
break;

case KVADDR:
+ if (machine_type("IA64") &&
(machdep->machspec->kernel_start > pp)) {

+ pp = machdep->machspec->kernel_start;
+ continue;
+ }
+
if (!kvtop(CURRENT_CONTEXT(), pp, &paddr, 0) ||
!phys_to_page(paddr, &page)) {
if (!next_kpage(pp, &pp))

Best Regards,


--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 03-28-2008, 02:15 AM
Dave Anderson
 
Default search -k

Yang Zhiguo wrote:

hi,

When i use search command as following, there is a Segmentation fault.
crash> search -k 12345
Segmentation fault

With the following patch, it is OK?


I tried reproducing it on a readily-available ia64 running a RHEL5 xen
kernel, and
the command runs OK for me. I'll try it on a bare-metal ia64 tomorrow
to see if that

makes a difference.

In any case, your patch would skip the vmalloc (region 5) area
completely, so that's
not going to work. So I need to know why it's failing on your machine.
Can you

run crash from gdb, and figure out exactly which address it's failing on?

Thanks,
Dave


--- ../crash/crash-4.0-6.1/memory.c 2008-02-29 01:09:10.000000000
+0900

+++ memory.c 2008-03-28 10:32:47.000000000 +0900
@@ -11047,6 +11047,11 @@ search(ulong start, ulong end, ulong mas
break;

case KVADDR:
+ if (machine_type("IA64") &&
(machdep->machspec->kernel_start > pp)) {

+ pp = machdep->machspec->kernel_start;
+ continue;
+ }
+
if (!kvtop(CURRENT_CONTEXT(), pp, &paddr, 0) ||
!phys_to_page(paddr, &page)) {
if (!next_kpage(pp, &pp))

Best Regards,


--
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
 
Old 03-28-2008, 08:06 AM
"Yang Zhiguo"
 
Default search -k

hi,

i run crash with gdb.

[root@rhel51rc2 crash-4.0-6.1]# gdb ./crash
GNU gdb Red Hat Linux (6.5-25.el5rh)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "ia64-redhat-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".

(gdb) b search
Breakpoint 1 at 0x40000000000f8e11: file memory.c, line 11025.
(gdb) r -s
Starting program: /home/yangzg/crash-4.0-6.1/crash -s
crash> search -k 12345

Breakpoint 1, search (start=11529215046068469760, end=18446744073709551615, mask=0, memtype=1, value=0x60000fffffe3eab0, vcnt=1) at memory.c:11025
11025 if (start & (sizeof(long)-1)) {
(gdb) n
11030 pagebuf = GETBUF(PAGESIZE());
(gdb)
11031 next = start;
(gdb)
11033 for (pp = VIRTPAGEBASE(start); next < end; next = pp) {
(gdb)
11034 lastpage = (VIRTPAGEBASE(next) == VIRTPAGEBASE(end));
(gdb)
11035 if (LKCD_DUMPFILE())
(gdb)
11038 switch (memtype)
(gdb)
11050 if (!kvtop(CURRENT_CONTEXT(), pp, &paddr, 0) ||
(gdb) s
kvtop (tc=0x6000000001ec1c50, kvaddr=11529215046068469760, paddr=0x60000fffffe368e8, verbose=0) at memory.c:2306
2306 return (machdep->kvtop(tc ? tc : CURRENT_CONTEXT(), kvaddr,
(gdb) s
ia64_kvtop (tc=0x6000000001ec1c50, kvaddr=11529215046068469760, paddr=0x60000fffffe368e8, verbose=0) at ia64.c:1031
1031 if (!IS_KVADDR(kvaddr))
(gdb) n
1034 if (!vt->vmalloc_start) {
(gdb)
1039 switch (VADDR_REGION(kvaddr))
(gdb)
1054 if (ia64_IS_VMALLOC_ADDR(kvaddr))
(gdb)
1056 *paddr = ia64_VTOP(kvaddr);
(gdb) s
ia64_VTOP (vaddr=11529215046068469760) at ia64.c:3501
3501 ms = &ia64_machine_specific;
(gdb) n
3503 switch (VADDR_REGION(vaddr))
(gdb)
3522 if (ia64_IS_VMALLOC_ADDR(vaddr) ||
(gdb)
3531 paddr = vaddr - ms->kernel_start +
(gdb)
3533 break;
(gdb) p/x paddr
$1 = 0xffffffff04000000 ======>error occured
(gdb) p/x vaddr
$2 = 0xa000000000000000
(gdb) p/x ms->kernel_start
$3 = 0xa000000100000000
(gdb) p/x ms->phys_start
$4 = 0x4000000
(gdb)

Best Regards,
yang

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 03-28-2008, 02:38 PM
Dave Anderson
 
Default search -k

Yang Zhiguo wrote:

hi,

i run crash with gdb.

[root@rhel51rc2 crash-4.0-6.1]# gdb ./crash
GNU gdb Red Hat Linux (6.5-25.el5rh)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "ia64-redhat-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".

(gdb) b search
Breakpoint 1 at 0x40000000000f8e11: file memory.c, line 11025.
(gdb) r -s
Starting program: /home/yangzg/crash-4.0-6.1/crash -s
crash> search -k 12345

Breakpoint 1, search (start=11529215046068469760, end=18446744073709551615, mask=0, memtype=1, value=0x60000fffffe3eab0, vcnt=1) at memory.c:11025
11025 if (start & (sizeof(long)-1)) {
(gdb) n
11030 pagebuf = GETBUF(PAGESIZE());
(gdb)
11031 next = start;
(gdb)
11033 for (pp = VIRTPAGEBASE(start); next < end; next = pp) {
(gdb)
11034 lastpage = (VIRTPAGEBASE(next) == VIRTPAGEBASE(end));
(gdb)
11035 if (LKCD_DUMPFILE())
(gdb)
11038 switch (memtype)
(gdb)
11050 if (!kvtop(CURRENT_CONTEXT(), pp, &paddr, 0) ||
(gdb) s
kvtop (tc=0x6000000001ec1c50, kvaddr=11529215046068469760, paddr=0x60000fffffe368e8, verbose=0) at memory.c:2306
2306 return (machdep->kvtop(tc ? tc : CURRENT_CONTEXT(), kvaddr,
(gdb) s
ia64_kvtop (tc=0x6000000001ec1c50, kvaddr=11529215046068469760, paddr=0x60000fffffe368e8, verbose=0) at ia64.c:1031
1031 if (!IS_KVADDR(kvaddr))
(gdb) n
1034 if (!vt->vmalloc_start) {
(gdb)
1039 switch (VADDR_REGION(kvaddr))
(gdb)
1054 if (ia64_IS_VMALLOC_ADDR(kvaddr))
(gdb)
1056 *paddr = ia64_VTOP(kvaddr);
(gdb) s
ia64_VTOP (vaddr=11529215046068469760) at ia64.c:3501
3501 ms = &ia64_machine_specific;
(gdb) n
3503 switch (VADDR_REGION(vaddr))
(gdb)
3522 if (ia64_IS_VMALLOC_ADDR(vaddr) ||
(gdb)
3531 paddr = vaddr - ms->kernel_start +
(gdb)
3533 break;
(gdb) p/x paddr
$1 = 0xffffffff04000000 ======>error occured
(gdb) p/x vaddr
$2 = 0xa000000000000000
(gdb) p/x ms->kernel_start
$3 = 0xa000000100000000
(gdb) p/x ms->phys_start
$4 = 0x4000000
(gdb)

Best Regards,
yang


I can reproduce it on a bare-metal RHEL5 kernel, so let me
figure out what's going on...

Thanks,
Dave


--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 03-28-2008, 06:34 PM
Dave Anderson
 
Default search -k

Dave Anderson wrote:
> I can reproduce it on a bare-metal RHEL5 kernel, so let me
> figure out what's going on...

Hello Yang,

The problem is that the functions that implement the search
command were originally written to be processor-neutral on
machines with a relatively small, contiguous, unity-mapped
kernel/static-data region and a vmalloc region. With the
advent of machines with sparse memory regions, architectures
with separately-mapped kernel regions that are no longer part
of their unity-mapped regions, the command does not scale well
because too much time is spent dealing with inter-region
non-existent memory. It's due for a proper re-write with
a machine-dependent next_kpage() assist function.

I was mistaken in stating that your patch would skip the vmalloc
section, but it could only compile on an ia64. Attached is an
ugly patch that does does the same thing as yours did, compiles
on all architectures, and would still work on 2.4-era ia64 kernels
whose kernel text/static-data were still located in the unity-mapped
region 7.

Some day I'll get around to a real fix...

Thanks,
Dave





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

Thread Tools




All times are GMT. The time now is 12:15 PM.

VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org