Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bt command coredump #168

Open
sensarliar opened this issue Jan 18, 2024 · 2 comments
Open

bt command coredump #168

sensarliar opened this issue Jan 18, 2024 · 2 comments

Comments

@sensarliar
Copy link

when I use crash-7-branch code to parse the MTK arm64 dump, bt command got a coredump.
log is here:
1、
crash ./symbols/vmlinux SYS_COREDUMP

crash 7.3.2
Copyright (C) 2002-2022 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, 2020-2022 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.

BFD: ./symbols/vmlinux: don't know how to handle section .relr.dyn' [0x 13] BFD: ./symbols/vmlinux: don't know how to handle section .relr.dyn' [0x 13]
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=aarch64-elf-linux"...
BFD: /mnt/disk/code/dumpdump/20231231080842-00691540-fulldump/symbols/vmlinux: don't know how to handle section `.relr.dyn' [0x 13]

WARNING: kernel relocated [104616MB]: patching 183134 gdb minimal_symbol values

WARNING: cpu 0: cannot find NT_PRSTATUS note
WARNING: cpu 1: cannot find NT_PRSTATUS note
WARNING: cpu 2: cannot find NT_PRSTATUS note
WARNING: cpu 3: cannot find NT_PRSTATUS note
WARNING: cpu 4: cannot find NT_PRSTATUS note
WARNING: cpu 6: cannot find NT_PRSTATUS note
WARNING: cpu 7: cannot find NT_PRSTATUS note
KERNEL: ./symbols/vmlinux [TAINTED]
DUMPFILE: SYS_COREDUMP
CPUS: 8 [OFFLINE: 7]
DATE: Sun Dec 31 16:02:42 CST 2023
UPTIME: 1 days, 22:05:37
LOAD AVERAGE: 80.90, 68.00, 44.75
TASKS: 551
NODENAME: localhost
RELEASE: 4.19.191+
VERSION: #1 SMP PREEMPT Thu Dec 7 11:32:01 CST 2023
MACHINE: aarch64 (unknown Mhz)
MEMORY: 7.7 GB
PANIC: "-(5)[75:khungtaskd]Kernel panic - not syncing: hungtask: blocked tasks"
PID: 75
COMMAND: "khungtaskd"
TASK: ffffffcd92d349c0 [THREAD_INFO: ffffffcd92d349c0]
CPU: 5
STATE: TASK_RUNNING (PANIC)

crash> bt
PID: 75 TASK: ffffffcd92d349c0 CPU: 5 COMMAND: "khungtaskd"
Segmentation fault (core dumped)

2、
gdb /code/github/crash22/crash/crash ./core-crash-28039-11-1705478417
GNU gdb (Ubuntu 12.1-0ubuntu1
22.04) 12.1
Copyright (C) 2022 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 "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
https://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /mnt/disk/code/github/crash22/crash/crash...
[New LWP 28039]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/mnt/disk/code/github/crash22/crash/crash ./symbols/vmlinux SYS_CORED'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 arm64_is_kernel_exception_frame (bt=bt@entry=0x7fff65db1f60, stkptr=stkptr@entry=18446743524087971344) at arm64.c:2370
2370 if (INSTACK(regs->sp, bt) && INSTACK(regs->regs[29], bt) &&
(gdb) q

@sensarliar
Copy link
Author

1、add this code, not working。
2369 error(WARNING,
2370 "xxxxa: fp: %lx sp: %lx pc: %lx\n",
2371 stkptr, STACK_OFFSET_TYPE(stkptr), STACKSIZE());
2372 error(WARNING,
2373 "xxxx22: fp: %lx sp: %lx pc: %lx\n",
2374 bt->stacktop, bt->stackbase, 0);
2375 if (stkptr > STACKSIZE() && !INSTACK(stkptr, bt)) {
2376 if (CRASHDEBUG(1))
2377 error(WARNING, "stkptr: %lx is outside the kernel stack range\n", stkptr);
2378 return FALSE;
2379 }

bt
PID: 64 TASK: ffffffc24c0b5b80 CPU: 6 COMMAND: "khungtaskd"
bt: WARNING: xxxxarm64_unwind_frame: switch stacks: fp: ffffff8008003de0 sp: ffffffffff693de0 pc: 4000
bt: WARNING: xxxx22arm64_unwind_frame: switch stacks: fp: ffffff8008974000 sp: ffffff8008970000 pc: 0
#0 [ffffff8008003f10] ipi_cpu_stop at ffffff9096a2a310
Segmentation fault (core dumped)

2、 add fatal error print,it works

2369 error(FATAL,
2370 "xxxxa: fp: %lx sp: %lx pc: %lx\n",
2371 stkptr, STACK_OFFSET_TYPE(stkptr), STACKSIZE());

@uran0sH
Copy link

uran0sH commented Mar 7, 2024

crash-8.0.4 also core dump when execute bt.

crash> bt
PID: 1806     TASK: ffff88810bc40000  CPU: 4    COMMAND: "insmod"
 #0 [ffff88810cef7240] machine_kexec at ffffffff9cf9338f
 #1 [ffff88810cef7348] __crash_kexec at ffffffff9d32409f
 #2 [ffff88810cef74a8] crash_kexec at ffffffff9d327b88
 #3 [ffff88810cef7540] oops_end at ffffffff9cec813b
 #4 [ffff88810cef7568] die_addr at ffffffff9cec8b70
 #5 [ffff88810cef75a0] exc_general_protection at ffffffff9fe349b9
 #6 [ffff88810cef7640] asm_exc_general_protection at ffffffffa000122b
    [exception RIP: generate_oops+53]
    RIP: ffffffffc14c0105  RSP: ffff88810cef76f0  RFLAGS: 00010282
    RAX: 0000000000000008  RBX: ffff88810cef77d0  RCX: 0000000000000001
    RDX: dffffc0000000001  RSI: ffff88810cef7760  RDI: 0000000000000000
    RBP: ffff88810cef7708   R8: 000000000073706f   R9: 0000000000000001
    R10: ffffffffa23266e7  R11: ffffffffa00000ea  R12: 1ffff110219deee6
    R13: 0000000000000000  R14: 0000000000000004  R15: ffff88810cef7898
    ORIG_RAX: ffffffffffffffff  CS: 0010  SS: 0018
Segmentation fault

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants