Skip to content

Commit

Permalink
Fix for 'sys' to properly display the PANIC message
Browse files Browse the repository at this point in the history
Using 'sys' command, we can view the panic message with general system
information. If we run RISCV64-based vmcore, PANIC message is not properly
displayed.

The reason is that the string "Unable to handle kernel" is not
completely matched with the panic_msg[]. The corresponding kernel commit
is 21733cb518471.

Without the patch:
  crash> sys
        KERNEL: vmlinux  [TAINTED]
      DUMPFILE: vmcore
          CPUS: 4
          DATE: Thu Aug 22 16:13:08 KST 2024
        UPTIME: 00:33:25
  LOAD AVERAGE: 0.07, 0.07, 0.02
         TASKS: 385
      NODENAME: starfive
       RELEASE: 6.6.20+
       VERSION: #13 SMP Mon Aug 19 12:58:52 KST 2024
       MACHINE: riscv64  (unknown Mhz)
        MEMORY: 4 GB
         PANIC: ""

With the patch:
  crash> sys
        KERNEL: vmlinux  [TAINTED]
      DUMPFILE: vmcore
          CPUS: 4
          DATE: Thu Aug 22 16:13:08 KST 2024
        UPTIME: 00:33:25
  LOAD AVERAGE: 0.07, 0.07, 0.02
         TASKS: 385
      NODENAME: starfive
       RELEASE: 6.6.20+
       VERSION: #13 SMP Mon Aug 19 12:58:52 KST 2024
       MACHINE: riscv64  (unknown Mhz)
        MEMORY: 4 GB
         PANIC: "Unable to handle kernel access to user memory without uaccess routines at virtual address 0000000000000000"

Signed-off-by: Austin Kim <[email protected]>
  • Loading branch information
austindhkim authored and lian-bo committed Nov 11, 2024
1 parent ca74157 commit db00776
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions task.c
Original file line number Diff line number Diff line change
Expand Up @@ -6392,6 +6392,11 @@ get_panicmsg(char *buf)
get_symbol_data("sysrq_pressed", sizeof(int), &msg_found);
break;
}

/*
* Try to search panic string in panic keywords
*/
search_panic_task_by_keywords(buf, &msg_found);
}

found:
Expand Down

0 comments on commit db00776

Please sign in to comment.