You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Windows build number: Microsoft Windows [Version 10.0.19042.804]
Your Distribution version: Ubuntu 20.04
Whether the issue is on WSL 2 and/or WSL 1: WSL 2
Steps to reproduce
With the distribution GCC installed (in this case GCC 9 it seems), compile the following C program using the GCC -m32 flag in WSL2:
Once compiled, change directory to /mnt/c or equivalent for your system in WSL and run the compiled program. It should print the failure message. For example:
The specific situation that this occurred in was compiling GoogleTest unit tests for code used in a 32-bit embedded system. To replicate the 32-bit environment of the embedded system, the unit tests were compiled with -m32. When running the tests with the --gtest_output=xml:testresults.xml option, it was failing with an "Unable to open file" error for the results file, which happened to be a Windows filesystem path.
Environment
Steps to reproduce
With the distribution GCC installed (in this case GCC 9 it seems), compile the following C program using the GCC
-m32
flag in WSL2:Source: https://gist.github.com/doxxx/e93136c1a95582ad92da96723fd1c073
Compile command:
gcc -m32 wsl-stat-failure.c
Once compiled, change directory to
/mnt/c
or equivalent for your system in WSL and run the compiled program. It should print the failure message. For example:Strace log for the failure: https://gist.github.com/doxxx/f205cf8f6b4ad7daa327af7ddb224f20
For comparison, change directories to a non-Windows filesystem like
/tmp
and run it again. It should print the success message. For example:When compiled without the
-m32
flag, thestat
call succeeds for a Windows filesystem path. Strace log for the success with 64-bit process: https://gist.github.com/doxxx/56352ea3a647f25e77dfad240f265325WSL logs: https://aka.ms/AAbd8pm
Expected behavior
The
stat
call should succeed in 32-bit processes when provided with a valid Windows filesystem path.Actual behavior
The
stat
call fails in a 32-bit process when provided with a valid Windows filesystem path.The text was updated successfully, but these errors were encountered: