-
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
Specify callback calling convention for callbacks on Windows x86 causes crashes on Mono. #89571
Conversation
…dows x86. CoreCLR runtime get build using stdcall while Mono uses cdecl (default). If a native runtime function takes a reverse pivnoke callback, this difference will cause issues for Mono on Windows x86 since reverse pinvoke callbacks have stdcall on Windows x86, but callbacks have been prototyped to use the calling convention setup in build. Since CoreCLR already uses stdcall on Windows x86 this change won't change anything, while on Mono it will fixes the crashes observed in dotnet#8892.
Timeout seen in runtime (Build tvos-arm64 Release AllSubsets_Mono) occurs on other PR's as well, so unrelated to changes done in this PR. |
@davmason, mainly a nop change on all platforms except Mono Windows x86 since CoreCLR Windows x86 already uses stdcall as default calling convention for native code. Would you mind take a look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/azp run runtime-libraries-mono outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
Failures in runtime-libraries-mono outerloop (Build windows-x86 Release AllSubsets_Mono) test run after fix and re-enabled tests are not related (failure in System.Numerics.Tests.logTest.RunLargeValueLogTests, and System.Collections.Frozen.Tests.FrozenDictionary_Generic_Tests_ulong_ulong.CreateHugeDictionary_Success), so re-enabled tests seems to have been fixed by changes in this PR. |
Errors are infrastructure or known issues. |
Fixes #88992.
CoreCLR runtime build using stdcall while Mono uses cdecl (default for c/c++ source files) as default calling convention. If a native runtime function takes a reverse pinvoke managed callback, this difference will cause issues on Mono Windows x86 since reverse pinvoke callbacks uses stdcall on Windows x86, but native functions calling callbacks have been prototyped to use the "default" calling convention used by native runtime build.
PR also re-enable test suites previously disabled due to this issue as well as making sure native EventPipe tests suites build/run/ pass using Mono Windows x86.