User Stack Tracer Causes Crash 2

From: He Zhe
Date: Thu May 30 2019 - 04:21:46 EST


Hi,

https://lore.kernel.org/lkml/20190320221534.165ab87b@xxxxxxxxxxxxxxxx/ didn't get merged. And the crash it was trying to fix still happens on the latest master branch. If rebasing the patch on the latest top, the following new crash come up.

Sometimes,

root@intel-x86-64:~# echo 1 > /sys/kernel/debug/tracing/options/userstacktrace
root@intel-x86-64:~# echo 1 > /sys/kernel/debug/tracing/events/preemptirq/irq_disable/enable
root@intel-x86-64:~# echo 1 > /proc/sys/kernel/stack_tracer_enabled
hangs...

Sometimes,

root@intel-x86-64:~# echo 1 > /sys/kernel/debug/tracing/options/userstacktrace
root@intel-x86-64:~# echo 1 > /sys/kernel/debug/tracing/events/preemptirq/irq_disable/enable
root@intel-x86-64:~# echo 1 > /proc/sys/kernel/stack_tracer_enabled
PANIC: double fault, error_code: 0x0
CPU: 0 PID: 492 Comm: sh Not tainted 5.2.0-rc2 #1
Hardware name: Intel Corporation Broadwell Client platform/Basking Ridge, BIOS BDW-E2R1.86C.0118.R01.1503110618 03/11/2015
RIP: 0010:error_entry+0x32/0x100
Code: 89 7c 24 08 52 31 d2 51 31 c9 50 41 50 45 31 c0 41 51 45 31 c9 41 52 45 31 d2 41 53 45 31 db 53 31 db 55 31 ed 41 54 45 31 e4 <41> 55 45 31 ed 41 56 45 31 f6 41 57 45 31 ff 56 48 8d 6c 24 09 f6
RSP: 0018:ffff9ab680000000 EFLAGS: 00010046
RAX: 00000000ae200a97 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffffae200ec9 RDI: ffffffffae201176
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
FS:Â 00007f2c078a4740(0000) GS:ffff988fb8a00000(0000) knlGS:0000000000000000
CS:Â 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffff9ab67ffffff8 CR3: 000000005b8ee003 CR4: 00000000003606f0
Call Trace:
Â<IRQ>
Â? native_iret+0x7/0x7
Â? int3+0x29/0x40
Â? error_entry+0x86/0x100
Â? trace_hardirqs_off_caller_cr2+0x1/0x20
Â? trace_hardirqs_off_caller_cr2+0x1/0x20
Â? trace_hardirqs_off_thunk_cr2+0x1a/0x1c
Â? native_iret+0x7/0x7
Â? int3+0x29/0x40
Â? error_entry+0x86/0x100
Â? error_entry+0x86/0x100
Â? int3+0x29/0x40
Â? native_iret+0x7/0x7
Â? int3+0x29/0x40
Â? error_entry+0x86/0x100
Â? trace_hardirqs_off_caller_cr2+0x1/0x20
Â? trace_hardirqs_off_caller_cr2+0x1/0x20
Â? trace_hardirqs_off_thunk_cr2+0x1a/0x1c
Â? native_iret+0x7/0x7
Â? int3+0x29/0x40
Â? error_entry+0x86/0x100
Â? error_entry+0x86/0x100
Â? int3+0x29/0x40
Â? native_iret+0x7/0x7
Â? int3+0x29/0x40
Â? error_entry+0x86/0x100
Â? trace_hardirqs_off_caller_cr2+0x1/0x20
Â? trace_hardirqs_off_caller_cr2+0x1/0x20
Â? trace_hardirqs_off_thunk_cr2+0x1a/0x1c
Â? native_iret+0x7/0x7
Â? int3+0x29/0x40
Â? error_entry+0x86/0x100
Â? error_entry+0x86/0x100
Â? int3+0x29/0x40
Â? native_iret+0x7/0x7
Â? int3+0x29/0x40
Â? error_entry+0x86/0x100
Â? trace_hardirqs_off_caller_cr2+0x1/0x20
Â? trace_hardirqs_off_caller_cr2+0x1/0x20
Â? trace_hardirqs_off_thunk_cr2+0x1a/0x1c
Â? native_iret+0x7/0x7
Â? int3+0x29/0x40
Â? error_entry+0x86/0x100
Â? error_entry+0x86/0x100
Â? int3+0x29/0x40
Â? native_iret+0x7/0x7
Â? int3+0x29/0x40
Â? error_entry+0x86/0x100
Â? trace_hardirqs_off_caller_cr2+0x1/0x20
Â? trace_hardirqs_off_caller_cr2+0x1/0x20
Â? trace_hardirqs_off_thunk_cr2+0x1a/0x1c
Â? native_iret+0x7/0x7
Â? int3+0x29/0x40
Â? error_entry+0x86/0x100
Â? error_entry+0x86/0x100
Â? int3+0x29/0x40
Â? native_iret+0x7/0x7
Â? int3+0x29/0x40
Â? error_entry+0x86/0x100
Â? trace_hardirqs_off_caller_cr2+0x1/0x20
Â? trace_hardirqs_off_caller_cr2+0x1/0x20
Â? trace_hardirqs_off_thunk_cr2+0x1a/0x1c
Â? native_iret+0x7/0x7
Â? int3+0x29/0x40
Â? error_entry+0x86/0x100
Â? error_entry+0x86/0x100
Â? int3+0x29/0x40
Â? native_iret+0x7/0x7
Â? int3+0x29/0x40
Â? error_entry+0x86/0x100
Â? trace_hardirqs_off_caller_cr2+0x1/0x20
Â? trace_hardirqs_off_caller_cr2+0x1/0x20
Â? trace_hardirqs_off_thunk_cr2+0x1a/0x1c
Â? native_iret+0x7/0x7
Â? int3+0x29/0x40
Â? error_entry+0x86/0x100
Â? error_entry+0x86/0x100
Â? int3+0x29/0x40
Â? native_iret+0x7/0x7
Â? int3+0x29/0x40
Â? error_entry+0x86/0x100
Â? trace_hardirqs_off_caller_cr2+0x1/0x20
Â? trace_hardirqs_off_caller_cr2+0x1/0x20
Â? trace_hardirqs_off_thunk_cr2+0x1a/0x1c
Â? native_iret+0x7/0x7
Â? int3+0x29/0x40
Â? error_entry+0x86/0x100
Â? error_entry+0x86/0x100
Â? int3+0x29/0x40
Â? native_iret+0x7/0x7
Â? int3+0x29/0x40
Â? error_entry+0x86/0x100
Â? trace_hardirqs_off_caller_cr2+0x1/0x20
Â? trace_hardirqs_off_caller_cr2+0x1/0x20
Â? trace_hardirqs_off_thunk_cr2+0x1a/0x1c
Â? native_iret+0x7/0x7
Â? int3+0x29/0x40
Â? error_entry+0x86/0x100
Â? error_entry+0x86/0x100
Â? int3+0x29/0x40
Â? native_iret+0x7/0x7
Â? int3+0x29/0x40
Â? error_entry+0x86/0x100
Â? trace_hardirqs_off_caller_cr2+0x1/0x20
Â? trace_hardirqs_off_caller_cr2+0x1/0x20
Â? trace_hardirqs_off_thunk_cr2+0x1a/0x1c
Â? native_iret+0x7/0x7
Â? int3+0x29/0x40
Â? error_entry+0x86/0x100
Â? error_entry+0x86/0x100
Â? int3+0x29/0x40
Â? native_iret+0x7/0x7
Â? int3+0x29/0x40
Â? error_entry+0x86/0x100
Â? trace_hardirqs_off_caller_cr2+0x1/0x20
Â? trace_hardirqs_off_caller_cr2+0x1/0x20
Â? trace_hardirqs_off_thunk_cr2+0x1a/0x1c
Â? native_iret+0x7/0x7
Â? int3+0x29/0x40
Â? error_entry+0x86/0x100
Â? error_entry+0x86/0x100
Â? int3+0x29/0x40
Â? native_iret+0x7/0x7
Â? int3+0x29/0x40
Â? error_entry+0x86/0x100
Â? trace_hardirqs_off_caller_cr2+0x1/0x20
Â? trace_hardirqs_off_caller_cr2+0x1/0x20
Â? trace_hardirqs_off_thunk_cr2+0x1a/0x1c
Â? native_iret+0x7/0x7
Â? int3+0x29/0x40
Â? error_entry+0x86/0x100
Â? error_entry+0x86/0x100
Â? int3+0x29/0x40
Â? native_iret+0x7/0x7
Â? int3+0x29/0x40
Â? error_entry+0x86/0x100
Â? trace_hardirqs_off_caller_cr2+0x1/0x20
Â? trace_hardirqs_off_caller_cr2+0x1/0x20
Â? trace_hardirqs_off_thunk_cr2+0x1a/0x1c
Â? native_iret+0x7/0x7
Â? int3+0x29/0x40
Â? error_entry+0x86/0x100
Â? error_entry+0x86/0x100
Â? int3+0x29/0x40
Â? native_iret+0x7/0x7
Â? int3+0x29/0x40
Â? error_entry+0x86/0x100
Â? trace_hardirqs_off_caller_cr2+0x1/0x20
Â? trace_hardirqs_off_caller_cr2+0x1/0x20
Â? trace_hardirqs_off_thunk_cr2+0x1a/0x1c
Â? native_iret+0x7/0x7
Â? int3+0x29/0x40
Â? error_entry+0x86/0x100
Â? error_entry+0x86/0x100
Â? int3+0x29/0x40
Â? native_iret+0x7/0x7
Â? int3+0x29/0x40
Â? error_entry+0x86/0x100
Â? trace_hardirqs_off_caller_cr2+0x1/0x20
Â? trace_hardirqs_off_caller_cr2+0x1/0x20
Â? trace_hardirqs_off_thunk_cr2+0x1a/0x1c
Â? native_iret+0x7/0x7
Â? int3+0x29/0x40
Â? error_entry+0x86/0x100
Â? error_entry+0x86/0x100
Â? int3+0x29/0x40
Â? native_iret+0x7/0x7
Â? int3+0x29/0x40
Â? error_entry+0x86/0x100
Â? trace_hardirqs_off_caller_cr2+0x1/0x20
Â? trace_hardirqs_off_caller_cr2+0x1/0x20
Â? trace_hardirqs_off_thunk_cr2+0x1a/0x1c
Â? native_iret+0x7/0x7
Â? int3+0x29/0x40
Â? error_entry+0x86/0x100
Â? error_entry+0x86/0x100
Â? int3+0x29/0x40
Â? native_iret+0x7/0x7