Skip to content
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

[mono] Access Violation when running certain outerloop tests on Windows x86 #88992

Closed
akoeplinger opened this issue Jul 17, 2023 · 0 comments · Fixed by #89571
Closed

[mono] Access Violation when running certain outerloop tests on Windows x86 #88992

akoeplinger opened this issue Jul 17, 2023 · 0 comments · Fixed by #89571
Assignees
Milestone

Comments

@akoeplinger
Copy link
Member

This happens on e.g. System.Diagnostics.DiagnosticSource.Tests:

build.cmd mono+libs -c Release -arch x86
dotnet.cmd build /t:Test /p:RuntimeFlavor=mono /p:TargetArchitecture=x86 /p:TestScope=outerloop -c Release .\src\libraries\System.Diagnostics.DiagnosticSource\tests\ -f net8.0

The process crashes pretty much immediately, with exit code -1073741819:

  ===========================================================================================
    Discovering: System.Diagnostics.DiagnosticSource.Tests (method display = ClassAndMethod, method display options = None)
    Discovered:  System.Diagnostics.DiagnosticSource.Tests (found 30 of 261 test cases)
    Starting:    System.Diagnostics.DiagnosticSource.Tests (parallel test collections = on, max threads = 16)
  ----- end Thu 07/13/2023 18:11:08.71 ----- exit code -1073741819 ----------------------------------------------------------

In VS we see the access violation:
image

@akoeplinger akoeplinger added arch-x86 os-windows runtime-mono specific to the Mono runtime labels Jul 17, 2023
@akoeplinger akoeplinger added this to the Future milestone Jul 17, 2023
@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jul 17, 2023
@akoeplinger akoeplinger added area-Diagnostics-mono and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Jul 17, 2023
lateralusX added a commit to lateralusX/runtime that referenced this issue Jul 27, 2023
…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.
lateralusX added a commit to lateralusX/runtime that referenced this issue Jul 27, 2023
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jul 27, 2023
lateralusX added a commit that referenced this issue Aug 3, 2023
…es crashes on Mono. (#89571)

Fixes #88992. Explicit specify callback calling convention on Windows x86.

CoreCLR runtime build uses 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 #8892.
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Aug 3, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Sep 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants