Skip to content

Fix Runtime_76194 test - #78760

Merged
EgorBo merged 14 commits into
dotnet:mainfrom
EgorBo:fix-76194-test
Dec 6, 2022
Merged

Fix Runtime_76194 test#78760
EgorBo merged 14 commits into
dotnet:mainfrom
EgorBo:fix-76194-test

Conversation

@EgorBo

Copy link
Copy Markdown
Member

Should fix#78758

cc @jakobbotsch

@ghostghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Nov 23, 2022
@ghostghost assigned EgorBoNov 23, 2022
@ghost

Copy link
Copy Markdown

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Issue Details

Should fix #78758

cc @jakobbotsch

Author:EgorBo
Assignees:-
Labels:

area-CodeGen-coreclr

Milestone:-

@EgorBo

Copy link
Copy Markdown
MemberAuthor

/azp list

@azure-pipelines

This comment was marked as outdated.

@EgorBo

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-coreclr outerloop

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Comment threadsrc/tests/JIT/Regression/JitBlue/Runtime_76194/Runtime_76194.cs Outdated
@EgorBo

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-coreclr outerloop

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@EgorBo

Copy link
Copy Markdown
MemberAuthor

mmap(null, 2 * PageSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);

returns -1 on Linux_musl arm with errno 22 which should be EINVAL

EINVAL
We don't like addr, length, or offset (e.g., they are too large, or not aligned on a page boundary).
EINVAL
(since Linux 2.6.12) length was 0.
EINVAL
flags contained neither MAP_PRIVATE or MAP_SHARED, or contained both of these values.

Log: https://helixre107v0xdeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-78760-merge-876e510b87fc47e5bb/JIT.Regression/1/console.affca64c.log?helixlogtype=result

Test: https://github.com/dotnet/runtime/blob/ce5929a75b4f7272dcc1000b16a13e45e0d4d997/src/tests/JIT/Regression/JitBlue/Runtime_76194/Runtime_76194.cs

@jkotas@jakobbotsch does it ring a bell to you by any chance what could be the reason?
I mean in theory the test is expected to reserve 2 pages (in a loop of 100 iterations)

@jakobbotsch

Copy link
Copy Markdown
Member

I think the problem might be that the value of MAP_ANONYMOUS is different depending on the standard lib. I can see that we define MAP_ANONYMOUS = 0x10 in our own sources:

https://source.dot.net/#System.IO.MemoryMappedFiles/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MMap.cs,89e5b8f2195492e1

Likely you can pinvoke this SystemNative version and it will handle the conversions for us?

@jakobbotsch

Copy link
Copy Markdown
Member

This also explains why we only were seeing this issue in outerloop runs.

@jkotas

Copy link
Copy Markdown
Member

Likely you can pinvoke this SystemNative version and it will handle the conversions for us?

If the tests need native dependencies, we typically create a test local native dependency for the tests that does what the test needs.

@EgorBo

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-coreclr outerloop

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Comment threadsrc/tests/JIT/Regression/JitBlue/Runtime_76194/CrossplatVirtualAlloc.cpp Outdated
Comment threadsrc/tests/JIT/Regression/JitBlue/Runtime_76194/CrossplatVirtualAlloc.cpp Outdated
EgorBoand others added 3 commits December 5, 2022 10:33
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
@EgorBo

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-coreclr outerloop

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@EgorBo

Copy link
Copy Markdown
MemberAuthor

@dotnet/jit-contrib @jkotas PTAL, this unblocks outerloop CI

Comment threadsrc/tests/JIT/Regression/JitBlue/Runtime_76194/Runtime_76194.csproj Outdated
Comment threadsrc/tests/JIT/Regression/JitBlue/Runtime_76194/CrossplatVirtualAlloc.cpp Outdated
@EgorBo

EgorBo commented Dec 5, 2022

Copy link
Copy Markdown
MemberAuthor

Had to disable the test for some mono targets: Wasm, Android, iOS where other tests with native libs are also ignored.

@EgorBo

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-coreclr outerloop

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@EgorBo
EgorBo merged commit 2b52095 into dotnet:mainDec 6, 2022
@EgorBo
EgorBo deleted the fix-76194-test branch December 6, 2022 16:40
@EgorBo

Copy link
Copy Markdown
MemberAuthor

Failures are #79170 and #79255

@ghostghost locked as resolved and limited conversation to collaborators Jan 5, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Runtime_76194 fails on ARM32

3 participants

@EgorBo@jakobbotsch@jkotas