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

arm64: Support overflow stack panic #100

Closed
wants to merge 1 commit into from

Conversation

yangh
Copy link

@yangh yangh commented Nov 15, 2021

Overflow stack supported since kernel 4.14 in commit 872d8327ce8,
without this patch, bt command trigger a SIGSEGV fault due the SP
pointed to the overflow stack which not yet loaded by crash.

Before:

  KERNEL: ../vmlinux
DUMPFILE: la_guestdump.gcore
    CPUS: 8
    DATE: Tue Jul 13 19:59:44 CST 2021
  UPTIME: 00:00:42

LOAD AVERAGE: 3.99, 1.13, 0.39
TASKS: 1925
NODENAME: localhost
RELEASE: 4.14.156+
VERSION: #1 SMP PREEMPT Tue Jul 13 10:37:23 UTC 2021
MACHINE: aarch64 (unknown Mhz)
MEMORY: 8.7 GB
PANIC: "Kernel panic - not syncing: kernel stack overflow"
PID: 1969
COMMAND: "irq/139-0-0024"
TASK: ffffffcc1a230000 [THREAD_INFO: ffffffcc1a230000]
CPU: 0
STATE: TASK_RUNNING (PANIC)

crash-7.3.0> bt
PID: 1969 TASK: ffffffcc1a230000 CPU: 0 COMMAND: "irq/139-0-0024"
Segmentation fault (core dumped)

After:

crash> bt
PID: 1969 TASK: ffffffcc1a230000 CPU: 0 COMMAND: "irq/139-0-0024"
#0 [ffffffcc7fd5cf50] __delay at ffffff8008c80774
#1 [ffffffcc7fd5cf60] __const_udelay at ffffff8008c80864
#2 [ffffffcc7fd5cf80] msm_trigger_wdog_bite at ffffff80084e9430
#3 [ffffffcc7fd5cfa0] do_vm_restart at ffffff80087bc974
#4 [ffffffcc7fd5cfc0] machine_restart at ffffff80080856fc
#5 [ffffffcc7fd5cfd0] emergency_restart at ffffff80080d49bc
#6 [ffffffcc7fd5d140] panic at ffffff80080af4c0
#7 [ffffffcc7fd5d150] nmi_panic at ffffff80080af150
#8 [ffffffcc7fd5d190] handle_bad_stack at ffffff800808b0b8
#9 [ffffffcc7fd5d2d0] __bad_stack at ffffff800808285c
--- ---
#10 [ffffff801187bc60] el1_error_invalid at ffffff8008082e7c
#11 [ffffff801187bcc0] cyttsp6_mt_attention at ffffff8000e8498c [cyttsp6]
#12 [ffffff801187bd20] call_atten_cb at ffffff8000e82030 [cyttsp6]
#13 [ffffff801187bdc0] cyttsp6_irq at ffffff8000e81e34 [cyttsp6]
#14 [ffffff801187bdf0] irq_thread_fn at ffffff8008128dd8
#15 [ffffff801187be50] irq_thread at ffffff8008128ca4
#16 [ffffff801187beb0] kthread at ffffff80080d2fc4
crash>

Signed-off-by: Hong YANG [email protected]

Overflow stack supported since kernel 4.14 in commit 872d8327ce8,
without this patch, bt command trigger a SIGSEGV fault due the SP
pointed to the overflow stack which not yet loaded by crash.

Before:

      KERNEL: ../vmlinux
    DUMPFILE: la_guestdump.gcore
        CPUS: 8
        DATE: Tue Jul 13 19:59:44 CST 2021
      UPTIME: 00:00:42
LOAD AVERAGE: 3.99, 1.13, 0.39
       TASKS: 1925
    NODENAME: localhost
     RELEASE: 4.14.156+
     VERSION: crash-utility#1 SMP PREEMPT Tue Jul 13 10:37:23 UTC 2021
     MACHINE: aarch64  (unknown Mhz)
      MEMORY: 8.7 GB
       PANIC: "Kernel panic - not syncing: kernel stack overflow"
         PID: 1969
     COMMAND: "irq/139-0-0024"
        TASK: ffffffcc1a230000  [THREAD_INFO: ffffffcc1a230000]
         CPU: 0
       STATE: TASK_RUNNING (PANIC)

crash-7.3.0> bt
PID: 1969   TASK: ffffffcc1a230000  CPU: 0   COMMAND: "irq/139-0-0024"
Segmentation fault (core dumped)

After:

crash> bt
PID: 1969   TASK: ffffffcc1a230000  CPU: 0   COMMAND: "irq/139-0-0024"
  #0 [ffffffcc7fd5cf50] __delay at ffffff8008c80774
  crash-utility#1 [ffffffcc7fd5cf60] __const_udelay at ffffff8008c80864
  crash-utility#2 [ffffffcc7fd5cf80] msm_trigger_wdog_bite at ffffff80084e9430
  crash-utility#3 [ffffffcc7fd5cfa0] do_vm_restart at ffffff80087bc974
  crash-utility#4 [ffffffcc7fd5cfc0] machine_restart at ffffff80080856fc
  crash-utility#5 [ffffffcc7fd5cfd0] emergency_restart at ffffff80080d49bc
  crash-utility#6 [ffffffcc7fd5d140] panic at ffffff80080af4c0
  crash-utility#7 [ffffffcc7fd5d150] nmi_panic at ffffff80080af150
  crash-utility#8 [ffffffcc7fd5d190] handle_bad_stack at ffffff800808b0b8
  crash-utility#9 [ffffffcc7fd5d2d0] __bad_stack at ffffff800808285c
--- <IRQ stack> ---
 crash-utility#10 [ffffff801187bc60] el1_error_invalid at ffffff8008082e7c
 crash-utility#11 [ffffff801187bcc0] cyttsp6_mt_attention at ffffff8000e8498c [cyttsp6]
 crash-utility#12 [ffffff801187bd20] call_atten_cb at ffffff8000e82030 [cyttsp6]
 crash-utility#13 [ffffff801187bdc0] cyttsp6_irq at ffffff8000e81e34 [cyttsp6]
 crash-utility#14 [ffffff801187bdf0] irq_thread_fn at ffffff8008128dd8
 crash-utility#15 [ffffff801187be50] irq_thread at ffffff8008128ca4
 crash-utility#16 [ffffff801187beb0] kthread at ffffff80080d2fc4
crash>

Signed-off-by: Hong YANG <[email protected]>
@k-hagio
Copy link
Contributor

k-hagio commented Nov 15, 2021

Thanks for the patch.
Could you please subscribe and send it to the crash-utility mailing list? We usually review patches there.

Please see Contribution Guidelines -> Submitting Patches.

@yangh
Copy link
Author

yangh commented Nov 16, 2021

Thanks, I'll sent to the mail list later.

@yangh yangh closed this Nov 16, 2021
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

Successfully merging this pull request may close these issues.

2 participants