Crash加载ramdump报cpu_possible_mask异常问题

来源:互联网 发布:大数据的优缺点 编辑:程序博客网 时间:2024/05/21 05:59

在使用Crash调试ramdump的时候发现一个错误,这里记录下。

[ 另外需要说明一点是,首先要确保vimlinx跟sysdump是同一次编译生成的,可以这样确认:

$ strings vmlinux |grep "Linux version"
Linux version 3.10.65-ge5e31c1 (android@ubuntu) (gcc version 4.8 (GCC) ) #7 SMP PREEMPT Fri May 19 15:50:19 CST 2017

$ strings sysdump |grep "Linux version"
Linux version 3.10.65-ge5e31c1 (android@ubuntu) (gcc version 4.8 (GCC) ) #7 SMP PREEMPT Fri May 19 15:50:19 CST 2017

---- 如此可见以上vmlinux跟sysdump是匹配的,否则无法继续调试.  ]


$crash vmlinux sysdump


crash 7.1.3
Copyright (C) 2002-2014 Red Hat, Inc.
Copyright (C) 2004, 2005, 2006, 2010 IBM Corporation
Copyright (C) 1999-2006 Hewlett-Packard Co
Copyright (C) 2005, 2006, 2011, 2012 Fujitsu Limited
Copyright (C) 2006, 2007 VA Linux Systems Japan K.K.
Copyright (C) 2005, 2011 NEC Corporation
Copyright (C) 1999, 2002, 2007 Silicon Graphics, Inc.
Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc.
This program 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. Enter "help copying" to see the conditions.
This program has absolutely no warranty. Enter "help warranty" for details.
GNU gdb (GDB) 7.6
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-unknown-linux-gnu --target=arm-elf-linux"...

crash: read error: kernel virtual address: c0629750 type: "cpu_possible_mask"

What happen ?


其实就是需要指定DDR起始地址就行了(各个平台定义不一样,可以查lk代码或者开机log看):

#define PHYS_OFFSET_ADDR            0x80000000

$crash -m phys_base=0x80000000 vmlinux sysdump


crash 7.1.3
Copyright (C) 2002-2014 Red Hat, Inc.
Copyright (C) 2004, 2005, 2006, 2010 IBM Corporation
Copyright (C) 1999-2006 Hewlett-Packard Co
Copyright (C) 2005, 2006, 2011, 2012 Fujitsu Limited
Copyright (C) 2006, 2007 VA Linux Systems Japan K.K.
Copyright (C) 2005, 2011 NEC Corporation
Copyright (C) 1999, 2002, 2007 Silicon Graphics, Inc.
Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc.
This program 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. Enter "help copying" to see the conditions.
This program has absolutely no warranty. Enter "help warranty" for details.
NOTE: setting phys_base to: 0x80000000
GNU gdb (GDB) 7.6
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-unknown-linux-gnu --target=arm-elf-linux"...

please wait... (gathering task table data)
crash: invalid task address: e0776f40

crash: invalid task address: e0777480

crash: invalid task address: e0775a40
KERNEL: vmlinux
DUMPFILE: sysdump
CPUS: 4 [OFFLINE: 3]
DATE: Sun Jan 1 17:01:14 2017
UPTIME: 00:07:11
LOAD AVERAGE: 13.74, 10.87, 4.93
TASKS: 1136
NODENAME: localhost
RELEASE: 3.10.65-ge5e31c1
VERSION: #7 SMP PREEMPT Fri May 19 15:50:19 CST 2017
MACHINE: armv7l (unknown Mhz)
MEMORY: 1 GB
PANIC: "SysRq : Trigger a crash"
PID: 4591
COMMAND: "sh"
TASK: e8a24540 [THREAD_INFO: e8d7e000]
CPU: 2
STATE: TASK_RUNNING (SYSRQ)

crash>



原创粉丝点击