long perf stat session triggers kernel panic - not syncing: Fatal exception
- Dominant language
- C++
- Stars
- 33.7k
- Forks
- 1.8k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 116
Description
### Windows Version
Microsoft Windows [version 10.0.26100.8246]
### WSL Version
2.6.3.0
### Are you using WSL 1 or WSL 2?
- [x] WSL 2
- [ ] WSL 1
### Kernel Version
6.6.87.2-1
### Distro Version
Ubuntu 24.04
### Other Software
In Ubuntu 24.04, I've installed linux-tools-generic, which installed linux-tools-6.8.0-110, allowing me to run [perf](https://www.man7.org/linux/man-pages/man1/perf.1.html), and, in particular [perf stat](https://www.man7.org/linux/man-pages/man1/perf-stat.1.html).
Unfortunately, the longer I run `perf stat` on a CPU intensive program, the higher the chance it's going to kill my Linux environment, printing this message in the terminal (pardon my french):
[processus terminé avec le code 1 (0x00000001)]
Vous pouvez maintenant fermer ce terminal avec CTRL+D, ou appuyez sur Entrée pour redémarrer
My traduction:
[process exited with code 1 (0x00000001)]
You could now close this terminal with CTRL+D, or press Enter to restart
Looking at the files in `C:\Users\\AppData\Local\Temp\wsl-crashes`, I see the same call trace every time my session is interrupted by a crash:
Call Trace:
intel_update_topdown_event+0x6c/0x180
icl_update_topdown_event+0x1b/0x30
intel_pmu_update+0x26/0x30
x86_pmu_stop+0xac/0xd0
x86_pmu_del+0x73/0x1b0
event_sched_out+0xcd/0x260
group_sched_out+0x52/0xa0
__pmu_ctx_sched_out+0xfa/0x150
ctx_sched_out+0xe5/0x1c0
task_ctx_sched_out+0x44/0x60
__perf_event_task_sched_out+0x1c0/0x460
? psi_task_switch+0xbd/0x210
__schedule+0x575/0xb00
schedule+0x6f/0xf0
exit_to_user_mode_prepare+0x71/0x140
irqentry_exit_to_user_mode+0xd/0x20
irqentry_exit+0x3f/0x50
sysvec_hyperv_stimer0+0x6a/0xd0
asm_sysvec_hyperv_stimer0+0x1f/0x30
With last final touch
Kernel panic - not syncing: Fatal exception
See attached 5 full kernel panic.
[kernel-panic-1776450584-{c5334e28-e5e4-4083-b848-a1a5e0baab57}.txt](https://github.com/user-attachments/files/26838898/kernel-panic-1776450584-.c5334e28-e5e4-4083-b848-a1a5e0baab57.txt)
[kernel-panic-1776432691-{af22701c-2a85-41b9-9af3-e8c88a9b8fbc}.txt](https://github.com/user-attachments/files/26838894/kernel-panic-1776432691-.af22701c-2a85-41b9-9af3-e8c88a9b8fbc.txt)
[kernel-panic-1776431742-{fcc25161-0a96-404d-b25b-5db099211cd2}.txt](https://github.com/user-attachments/files/26838897/kernel-panic-1776431742-.fcc25161-0a96-404d-b25b-5db099211cd2.txt)
[kernel-panic-1776424046-{b19d1c24-dd55-4ed6-98f9-5d50af435cf3}.txt](https://github.com/user-attachments/files/26838895/kernel-panic-1776424046-.b19d1c24-dd55-4ed6-98f9-5d50af435cf3.txt)
[kernel-panic-1776417468-{59c1c4fe-87c8-4b2a-8a45-a35eeadcdb71}.txt](https://github.com/user-attachments/files/26838896/kernel-panic-1776417468-.59c1c4fe-87c8-4b2a-8a45-a35eeadcdb71.txt)
### Repro Steps
sudo apt install linux-tools-6.8.0-110-generic
/usr/lib/linux-tools/6.8.0-110-generic/perf stat
### Expected Behavior
The Linux kernel should not panic, and `perf stat` should complete.
### Actual Behavior
The Linux kernel encounter a fatal exception and panic, killing the running Ubuntu distribution and my `perf stat` command.
### Diagnostic Logs
_No response_
Contributor guide
Research direction
Reproduce the failure with the listed linux-tools perf stat command and a CPU-intensive program, then inspect the attached kernel panic logs. Start with the repeated trace through intel_update_topdown_event and the Hyper-V timer path. Done means the WSL distribution remains running and perf stat completes without a kernel panic.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux
- Domain
- operating-systems, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100