-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[Wasm][AOT] The AOT compiler fails silently when running on Windows #57141
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Tagging subscribers to 'arch-wasm': @lewing Issue DetailsDescriptionThe AOT compiler stops working at an unknown location, without any error message. Here's how to reproduce it:
With
The same command finishes properly when running under linux. ConfigurationRegression?Unsure Other information
|
I have tried to run it with valgrind on linux. No errors, just leaks.
|
I forgot to add to this issue, the debugger caught this, when attached:
I don't have symbols to provide though, as the build does not seem to provide them. |
I have opened #57320 for the debug symbols on windows |
@imhameed any thoughts on how to proceed here? |
Context: dotnet#57320 Setting `CMAKE_MSVC_RUNTIME_LIBRARY` to `MultiThreaded` in `Debug` configuration allows us to link with llvm built in `Release` config without symbols. That results in `-MT` option used for compilation and getting rid of errors like: error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MTd_StaticDebug' in monosgen-2.0.lib(...) Also sets `_ITERATOR_DEBUG_LEVEL` to get rid of errors like: error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in monosgen-2.0.lib(...) And finally removing _DEBUG define. Without removing this define the `-MT` option doesn't have an effect on the runtime selection and we still end up with `MTd_StaticDebug`. I am not sure about all implications of removing `_DEBUG` define. It works fine so far and produces executables with debug information, like `mono-aot-cross.exe` with `mono-aot-cross.pdb`. That allows us to debug bugs specific to windows, like dotnet#57141
I was able to debug it on Windows. It crashes like this:
The I have checked the output with Then I checked the stack sizes and stack size set for our windows executable is 1M. While on linux the default is 8M. I am going to set 8M stack size on windows too. OTOH it might be good idea to remove the recursion of |
Fix dotnet#57141 in windows build. Set the stack size (reserve) to 8MB, which is usually a default on linux. This way we should get similar behavior on windows.
Above PR fixes it for windows build. I think we might need to set it also for linux build, where we also produce windows executables, IIRC. I will check that. |
The windows executables for the nuget are built on windows, so #60265 should fix this issue. |
Fix #57141 in windows build. Set the stack size (reserve) to 8MB, which is usually a default on linux. This way we should get similar behavior on windows. > dumpbin.exe /headers artifacts\bin\mono\Browser.wasm.Debug\cross\browser-wasm\mono-aot-cross.exe|Select-String -Pattern stack 800000 size of stack reserve 1000 size of stack commit
Fix #57141 in windows build. Set the stack size (reserve) to 8MB, which is usually a default on linux. This way we should get similar behavior on windows.
Fix #57141 in windows build. Set the stack size (reserve) to 8MB, which is usually a default on linux. This way we should get similar behavior on windows. Co-authored-by: Radek Doulik <[email protected]>
Description
The AOT compiler stops working at an unknown location, without any error message.
aot-issue-assets.zip
Here's how to reproduce it:
With
-v
, the last two output lines are:The same command finishes properly when running under linux.
Configuration
6696065
Regression?
Unsure
Other information
The text was updated successfully, but these errors were encountered: