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

Strange SIMD(AVX2) related SIGILL crash #12661

Closed
1 of 2 tasks
TGJek opened this issue Mar 6, 2025 · 6 comments
Closed
1 of 2 tasks

Strange SIMD(AVX2) related SIGILL crash #12661

TGJek opened this issue Mar 6, 2025 · 6 comments

Comments

@TGJek
Copy link

TGJek commented Mar 6, 2025

Windows Version

Microsoft Windows [Version 10.0.22631.4890]

WSL Version

2.4.11.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.167.4 (Custom kernel built by myself)

Distro Version

Arch Linux

Other Software

ccache version 4.10.2

Repro Steps

Compile ccache(If CMake can compile a AVX2 testing program, then CMake will configure ccache with AVX2 support)
and run ccache.
when the ccache is execute AVX2 instruction:
shell: ccache illegal hardware instruction SIGILL

Expected Behavior

User can successfully compiling program with ccache.

Actual Behavior

ccache exited by SIGILL.

Diagnostic Logs

My laptop's CPU is "12th Gen Intel(R) Core(TM) i9-12900H" which have AVX2 support.
but in WSL2 cat /proc/cpuinfo have no AVX2 flag, and I used some cpu utility that calling cpuid instruction to get cpu information in WSL2, the utility program show me the CPU have AVX2 support.

The bug is discovered when a few weeks ago I'm building a embedding linux distro, when I'm using buildroot to building the linux distro(my buildroot config have a "use ccache" option), the buildroot building process stopped with ccache crashed by illegal instruction.
I disable ccache as a workaround at that time, and I'm ignoring the crashing ccache.

Today I'm compiling some program that defaultly use ccache to compile(if ccache found on system), and when building the program, the ccache crash again, I debug for 1 hours to discovering this bug.

Copy link

github-actions bot commented Mar 6, 2025

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'.
Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs

Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The script will output the path of the log file once done.

If this is a networking issue, please use collect-networking-logs.ps1, following the instructions here

Once completed please upload the output files to this Github issue.

Click here for more info on logging
If you choose to email these logs instead of attaching to the bug, please send them to wsl-gh-logs@microsoft.com with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.

@zcobol
Copy link

zcobol commented Mar 7, 2025

@TGJek does this happens with the default WSL kernel also? The information in the /proc/cpuinfo is dynamically generated every time the file is read, so it's weird that other apps (which probably use the same CPUID instruction) report avx/avx2 support while /proc/cpuinfo is missing this information.

@TGJek
Copy link
Author

TGJek commented Mar 7, 2025

@zcobol
Yes, this happens with the default WSL kernel too.

System information

uname -a

Image

cat /proc/cpuinfo

Image

Running ccache

Running ccache(compiled with avx2 support)

Image

debugger backtrace

Image

Running ccache(compiled without av2 support)

Image

@OneBlue
Copy link
Collaborator

OneBlue commented Mar 7, 2025

/logs

Copy link
Contributor

Hello! Could you please provide more logs to help us better diagnose your issue?

To collect WSL logs, download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The scipt will output the path of the log file once done.

Once completed please upload the output files to this Github issue.

Click here for more info on logging

If you choose to email these logs instead of attaching to the bug, please send them to wsl-gh-logs@microsoft.com with the number of the github issue in the subject, and in the message a link to your comment in the github issue.

Thank you!

Copy link
Contributor

This issue has been automatically closed since it has not had any author activity for the past 7 days. If you're still experiencing this issue please re-file it as a new issue.

Thank you!

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

No branches or pull requests

3 participants