-
Notifications
You must be signed in to change notification settings - Fork 822
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
SEGFAULT on WSL for simple binary that doesn't SEGFAULT on std. Ubuntu or with valgrind #2546
Comments
- Adding mutable global rather than use a closure for `vec_size`. - Manually granting libraries ability to execute on stack in WSL. See: microsoft/WSL#286 https://stackoverflow.com/q/39136040/1068170 microsoft/WSL#916 https://gist.github.com/dhermes/f448415b9160b785f503a7361fe40d51 microsoft/WSL#2546
- Adding mutable global rather than use a closure for `vec_size`. - Manually granting libraries ability to execute on stack in WSL. See: microsoft/WSL#286 https://stackoverflow.com/q/39136040/1068170 microsoft/WSL#916 https://gist.github.com/dhermes/f448415b9160b785f503a7361fe40d51 microsoft/WSL#2546
@therealkenc Has this been resolved? I noticed the |
Ah. In 2017 this likely got skipped because the OP did not have any CLI steps visible, and with no repro visible the likelihood of someone clicking through a link was "small". The closed status was just cleaning up because I did a |
See flang-compiler/flang#298 As of this, the build fails for a different reason: ``` F90-S-0439-An internal subprogram cannot be passed as argument - vec_size (.../bezier/src/fortran/curve.f90: 837) 0 inform, 0 warnings, 1 severes, 0 fatal for compute_length ``` Support for passing the function closure (i.e. the "internal subprogram") has been problematic before when using `gfortran` on Windows Subsystem for Linux (WSL): microsoft/WSL#2546
Can it be that the issue is with the (lack of support for) executable stack that is used by gfrortran to pass inner functions (closures) as parameters? gfortran creates a trampoline to call inner function when it is passed as an argument. The trampoline instructions are placed on the stack. Hence, they need executable stack. |
Plausible. |
@therealkenc Would you like me to generate assembly and print it out? (I can do it in WSL vs. a "real" Ubuntu install to compare?) |
What could be done is check whether the use case runs on 19041 WSL2. If it works the issue is sort of destined for fixed-in-wsl2 tag. In WSL1 |
The repro does take on WSL2. This one is for all intents dupe #2553. |
Awesome! Thanks. (I am just about to buy a new PC and I think I won't even make an Ubuntu partition on it because of the richness of the WSL experience.) |
This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request. Thank you! |
>ver ... Microsoft Windows [Version 10.0.15063]
gfortran
(see gist). The Fortran uses a closure and it seems there is a bad reference to the procedure with the closure (or to the enclosed reference).valgrind
/ what should be happening instead: it should not SEGFAULT (it doesn't on "normal" Ubuntu)Context: This is a minimal reproduction from a more involved error experienced when calling into QUADPACK for a numerical library.
The text was updated successfully, but these errors were encountered: