Windows Version
Microsoft Windows [Version 10.0.26200.8117]
WSL Version
2.6.3.0
Are you using WSL 1 or WSL 2?
Kernel Version
6.6.87.2-1
Distro Version
Ubuntu 22.04
Other Software
gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Repro Steps
//junk.c
#include <stdio.h>
int main(){
int x = 67;
printf("%d\n", x);
return (x);
}
in powershell compile + run this code via...
wsl bash -c "gcc ./junk.c -o x86.out && ./x86.out"
do the same in wsl directly via...
gcc ./junk.c -o x86.out; ./x86.out
Expected Behavior
the powershell call should mirror the result from running directly in WSL....
username@DESKTOP-UFFE7QC:/mnt/c/Users/Chris/Documents/Quartus/Prototype/RISC-V-Capstone/Modules$ gcc ./junk.c -o x86.out; ./x86.out
67
Actual Behavior
instead an error is thrown after the compilation + program run is completed...
PS C:\Users\Chris\Documents\Quartus\Prototype\RISC-V-Capstone\Modules> wsl bash -c "gcc ./junk.c -o x86.out && ./x86.out"
67
User not found.
Error code: Wsl/WSL_E_USER_NOT_FOUND
The compilation and program running appear to finish without any errors, the error messages come at some point after the program completion but before WSL exits.
Diagnostic Logs
Replacing ' x = 67' with any other number (at least from what I have tested) does not result in this error being thrown.
PS C:\Users\Chris\Documents\Quartus\Prototype\RISC-V-Capstone\Modules> wsl bash -c "gcc ./junk.c -o x86.out && ./x86.out"
11
PS C:\Users\Chris\Documents\Quartus\Prototype\RISC-V-Capstone\Modules> wsl bash -c "gcc ./junk.c -o x86.out && ./x86.out"
67
User not found.
Error code: Wsl/WSL_E_USER_NOT_FOUND
PS C:\Users\Chris\Documents\Quartus\Prototype\RISC-V-Capstone\Modules> wsl bash -c "gcc ./junk.c -o x86.out && ./x86.out"
670
PS C:\Users\Chris\Documents\Quartus\Prototype\RISC-V-Capstone\Modules> wsl bash -c "gcc ./junk.c -o x86.out && ./x86.out"
1
PS C:\Users\Chris\Documents\Quartus\Prototype\RISC-V-Capstone\Modules> wsl bash -c "gcc ./junk.c -o x86.out && ./x86.out"
32
I see this same behavior observed on both my desktop and my laptop both running the same WSL and Windows version.
No, this is not a joke.
Windows Version
Microsoft Windows [Version 10.0.26200.8117]
WSL Version
2.6.3.0
Are you using WSL 1 or WSL 2?
Kernel Version
6.6.87.2-1
Distro Version
Ubuntu 22.04
Other Software
Repro Steps
//junk.c
#include <stdio.h>
int main(){
}
in powershell compile + run this code via...
wsl bash -c "gcc ./junk.c -o x86.out && ./x86.out"
do the same in wsl directly via...
gcc ./junk.c -o x86.out; ./x86.out
Expected Behavior
the powershell call should mirror the result from running directly in WSL....
username@DESKTOP-UFFE7QC:/mnt/c/Users/Chris/Documents/Quartus/Prototype/RISC-V-Capstone/Modules$ gcc ./junk.c -o x86.out; ./x86.out
67
Actual Behavior
instead an error is thrown after the compilation + program run is completed...
PS C:\Users\Chris\Documents\Quartus\Prototype\RISC-V-Capstone\Modules> wsl bash -c "gcc ./junk.c -o x86.out && ./x86.out"
67
User not found.
Error code: Wsl/WSL_E_USER_NOT_FOUND
The compilation and program running appear to finish without any errors, the error messages come at some point after the program completion but before WSL exits.
Diagnostic Logs
Replacing ' x = 67' with any other number (at least from what I have tested) does not result in this error being thrown.
PS C:\Users\Chris\Documents\Quartus\Prototype\RISC-V-Capstone\Modules> wsl bash -c "gcc ./junk.c -o x86.out && ./x86.out"
11
PS C:\Users\Chris\Documents\Quartus\Prototype\RISC-V-Capstone\Modules> wsl bash -c "gcc ./junk.c -o x86.out && ./x86.out"
67
User not found.
Error code: Wsl/WSL_E_USER_NOT_FOUND
PS C:\Users\Chris\Documents\Quartus\Prototype\RISC-V-Capstone\Modules> wsl bash -c "gcc ./junk.c -o x86.out && ./x86.out"
670
PS C:\Users\Chris\Documents\Quartus\Prototype\RISC-V-Capstone\Modules> wsl bash -c "gcc ./junk.c -o x86.out && ./x86.out"
1
PS C:\Users\Chris\Documents\Quartus\Prototype\RISC-V-Capstone\Modules> wsl bash -c "gcc ./junk.c -o x86.out && ./x86.out"
32
I see this same behavior observed on both my desktop and my laptop both running the same WSL and Windows version.
No, this is not a joke.