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

Failed to cross compile on WSL2 #7635

Closed
1 of 2 tasks
CliffHan opened this issue Nov 3, 2021 · 3 comments
Closed
1 of 2 tasks

Failed to cross compile on WSL2 #7635

CliffHan opened this issue Nov 3, 2021 · 3 comments

Comments

@CliffHan
Copy link

CliffHan commented Nov 3, 2021

Version

Microsoft Windows [Version 10.0.22000.282]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.10.16

Distro Version

Ubuntu 20.04

Other Software

snapdragon-llvm-3.5.2.4-compiler-linux64

Repro Steps

Run custom build script.

Expected Behavior

Build should be fine since compilation succeeded with same code on another computer with same hardware under native Ubuntu 20.04.

Actual Behavior

Got a "Segmentation fault" and build broken with scons reported "Error 139"

Diagnostic Logs

Here's some log I got with "dmesg".

[ 1972.933940] arm-ar[1753] vsyscall attempted with vsyscall=none ip:ffffffffff600400 cs:33 sp:7ffd91602908 ax:ffffffffff600400 si:4c5823 di:0
[ 1972.934039] arm-ar[1753]: segfault at ffffffffff600400 ip ffffffffff600400 sp 00007ffd91602908 error 15
[ 1972.934113] Code: Unable to access opcode bytes at RIP 0xffffffffff6003d6.
[ 1972.934117] potentially unexpected fatal signal 11.
[ 1972.934119] CPU: 1 PID: 1753 Comm: arm-ar Not tainted 5.10.16.3-microsoft-standard-WSL2 #1
[ 1972.934294] RIP: 0033:0xffffffffff600400
[ 1972.934297] Code: Unable to access opcode bytes at RIP 0xffffffffff6003d6.
[ 1972.934299] RSP: 002b:00007ffd91602908 EFLAGS: 00010202
[ 1972.934302] RAX: ffffffffff600400 RBX: 00007ffd91602ab0 RCX: 000000000000002f
[ 1972.934304] RDX: 0000000000000000 RSI: 00000000004c5823 RDI: 0000000000000000
[ 1972.934306] RBP: 000000000000004a R08: 0000000000000001 R09: 00000000006f06d0
[ 1972.934308] R10: 0000000001eb8620 R11: 0000000000000010 R12: 00000000004c5822
[ 1972.934310] R13: 0000000001eb5280 R14: 0000000001eb81f0 R15: 0000000000000000
[ 1972.934312] FS:  0000000001ead860 GS:  0000000000000000
@CliffHan
Copy link
Author

CliffHan commented Nov 3, 2021

To be honest, I don't know much about how the "cross compiler" interacts with "kernel". So I'm not sure if this is a bug or just because I got some wrong configuration. But same code compiles fine under native Ubuntu 20.04, I think the behavior should be the same under WSL2.

@CliffHan
Copy link
Author

CliffHan commented Nov 3, 2021

I just updated my kernel to 5.10.60.1-microsoft-standard-WSL2 and this problem still happens

[   41.549021] arm-ar[494] vsyscall attempted with vsyscall=none ip:ffffffffff600400 cs:33 sp:7fff00c26bb8 ax:ffffffffff600400 si:4c5823 di:0
[   41.549023] arm-ar[494]: segfault at ffffffffff600400 ip ffffffffff600400 sp 00007fff00c26bb8 error 15
[   41.549025] Code: Unable to access opcode bytes at RIP 0xffffffffff6003d6.
[   41.549030] potentially unexpected fatal signal 11.
[   41.549031] CPU: 3 PID: 494 Comm: arm-ar Not tainted 5.10.60.1-microsoft-standard-WSL2 #1
[   41.549036] RIP: 0033:0xffffffffff600400
[   41.549037] Code: Unable to access opcode bytes at RIP 0xffffffffff6003d6.
[   41.549038] RSP: 002b:00007fff00c26bb8 EFLAGS: 00010206
[   41.549040] RAX: ffffffffff600400 RBX: 00007fff00c26d60 RCX: 000000000000002f
[   41.549041] RDX: 0000000000000000 RSI: 00000000004c5823 RDI: 0000000000000000
[   41.549043] RBP: 0000000000000064 R08: 0000000000000001 R09: 00000000006f06d0
[   41.549044] R10: 00000000009b4830 R11: 0000000000000010 R12: 00000000004c5822
[   41.549045] R13: 00000000009b1490 R14: 00000000009b4400 R15: 0000000000000000
[   41.549047] FS:  00000000009a8860 GS:  0000000000000000

@CliffHan
Copy link
Author

CliffHan commented Nov 3, 2021

Finally......
I found this: #4694
and it works

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

No branches or pull requests

1 participant