Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Ensure we run the Crossgened test executable in R2R tests#11272

Merged
wtgodbe merged 2 commits into
dotnet:masterfrom
wtgodbe:CrossgenMove
Apr 29, 2017
Merged

Ensure we run the Crossgened test executable in R2R tests#11272
wtgodbe merged 2 commits into
dotnet:masterfrom
wtgodbe:CrossgenMove

Conversation

@wtgodbe
Copy link
Copy Markdown
Member

@wtgodbe wtgodbe commented Apr 27, 2017

CC @RussKeldorph @gkhanna79

This will fix the Crossgen test failures introduced by #10525. Have tested that a test .cmd with the expected outcome will pass locally, currently in the process of testing building the branch from scratch & running tests.

@wtgodbe
Copy link
Copy Markdown
Member Author

wtgodbe commented Apr 27, 2017

@dotnet-bot test Windows_NT Release pri1r2r

@wtgodbe
Copy link
Copy Markdown
Member Author

wtgodbe commented Apr 27, 2017

@dotnet-bot test Ubuntu Release pri1r2r

@wtgodbe
Copy link
Copy Markdown
Member Author

wtgodbe commented Apr 27, 2017

Tests seem to pass locally, will wait for them to pass in the CI as well.

@mazong1123
Copy link
Copy Markdown

mazong1123 commented Apr 27, 2017

Just be curious: the CI passed when I submit #10525 . Is this test not being added to CI at that time?

@wtgodbe
Copy link
Copy Markdown
Member Author

wtgodbe commented Apr 28, 2017

@mazong1123 that's correct, the R2R tests in the background. They only run in PR's if you request them (as I did above).

@gkhanna79
Copy link
Copy Markdown
Member

CI has test failures @wtgodbe for R2R.

@wtgodbe
Copy link
Copy Markdown
Member Author

wtgodbe commented Apr 28, 2017

Yeah, the Windows job had 1 test fail, which looks like a real issue that should be investigated - as for the Ubuntu job, it failed in trying to precompile ildasmrc.dll - it looks like similar failures have existed for a long time (about a month) - https://ci.dot.net/job/dotnet_coreclr/job/master/job/x64_release_ubuntu_pri1r2r_flow/. I'm guessing we need to either add a few .dll's to the exclusion list at https://github.com/dotnet/coreclr/blob/master/tests/skipCrossGenFiles.x64.txt, or rethink the way we do crossgening of Core_Root on non-windows.

@gkhanna79
Copy link
Copy Markdown
Member

This is the Windows failure:

17:21:19         Error: Could not load file or assembly 'CSharpPart, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
17:21:19         Error compiling CSharpPart.org: Could not find or load a specific file. (Exception from HRESULT: 0x80131621)
17:21:19         Error: compilation failed for "CSharpPart.org" (0x80131621)
17:21:19         
17:21:19   
17:21:19   Return code:      1
17:21:19   Raw output file:  

Does it fail for you locally? If it does, based upon the error message, it could be related to the engineering change you are making. Can you confirm, just for this test, if the original binary was not renamed to .org, does the test pass?

@gkhanna79
Copy link
Copy Markdown
Member

Ubuntu Failure is the following:

21:21:51 Unable to precompile /mnt/j/workspace/dotnet_coreclr/master/x64_release_ubuntu_pri1r2r_tst/bin/tests/Windows_NT.x64.Release/Tests/coreoverlay/superpmi-shim-simple.dll.
21:21:51 Microsoft (R) CoreCLR Native Image Generator - Version 4.5.22220.0
21:21:51 Copyright (c) Microsoft Corporation.  All rights reserved.
21:21:51 
21:21:51 Error compiling /mnt/j/workspace/dotnet_coreclr/master/x64_release_ubuntu_pri1r2r_tst/bin/tests/Windows_NT.x64.Release/Tests/coreoverlay/superpmi-shim-simple.dll: The module was expected to contain an assembly manifest. (Exception from HRESULT: 0x80131018)
21:21:51 Error: compilation failed for "/mnt/j/workspace/dotnet_coreclr/master/x64_release_ubuntu_pri1r2r_tst/bin/tests/Windows_NT.x64.Release/Tests/coreoverlay/superpmi-shim-simple.dll" (0x80131018)
21:21:51 Build step 'Execute shell' marked build as failure

The infrastructure appears to be crossgenning native binary and failing - can you confirm if that is the case?

@wtgodbe
Copy link
Copy Markdown
Member Author

wtgodbe commented Apr 28, 2017

@gkhanna79 where are you seeing the superpmi-shim-simple.dll failure? I only see ildasmrc.dll failing to precompile. Either way, this lines up with the other Ubuntu R2R failures that have been happening for the last month - we're trying to crossgen native binaries. I'll look into that.

As for the Windows failure, I've confirmed the same happens locally, though the directory looks as expected, and the .org file is present after running the .cmd. Also, if I modify the .cmd to use the original extensions from before this change, crossgen happens successfully, and I can rename the .ni.exe to '.exe' and have the test pass. Not sure what's special about that particular test...

@wtgodbe
Copy link
Copy Markdown
Member Author

wtgodbe commented Apr 28, 2017

Think I found the problem for non-Windows: https://github.com/dotnet/coreclr/blob/master/tests/runtest.sh#L410

The code for COR_E_ASSEMBLYEXPECTED is 0x80131018, which we do see in the error log output for the failed crossgen - I suspect that maybe up until a month ago, we printed 'COR_E_ASSEMBLYEXPECTED' in the logs, but now print the error code instead. I'll see what happens if I change that line to use the hex code instead.

@wtgodbe
Copy link
Copy Markdown
Member Author

wtgodbe commented Apr 28, 2017

I sent some jobs to the CI with the change I mentioned above, and we no longer fail with trying to precompile the native assemblies from before, but we do get the following failure trying to precompile System.Private.Corelib.dll:

13:02:19 Unable to precompile /mnt/j/workspace/dotnet_coreclr/master/x64_release_ubuntu_pri1r2r_tst_prtest/bin/tests/Windows_NT.x64.Release/Tests/coreoverlay/System.Private.CoreLib.dll.
13:02:19 Microsoft (R) CoreCLR Native Image Generator - Version 4.5.22220.0
13:02:19 Copyright (c) Microsoft Corporation. All rights reserved.
13:02:19
13:02:19 Could not load file or assembly '/mnt/j/workspace/dotnet_coreclr/master/x64_release_ubuntu_pri1r2r_tst_prtest/bin/tests/Windows_NT.x64.Release/Tests/coreoverlay/System.Private.CoreLib.dll'. An attempt was made to load a program with an incorrect format.
13:02:19 (Exception from HRESULT: 0x8007000B)
13:02:19 Error: compilation failed for "/mnt/j/workspace/dotnet_coreclr/master/x64_release_ubuntu_pri1r2r_tst_prtest/bin/tests/Windows_NT.x64.Release/Tests/coreoverlay/System.Private.CoreLib.dll" (0x8007000b)

I am, however, able to successfully precompile System.Private.Corelib.dll on my Ubuntu14.04 VM locally. @gkhanna79 any idea what's going on here?

@gkhanna79
Copy link
Copy Markdown
Member

Are you synced to latest when trying this?

@wtgodbe wtgodbe force-pushed the CrossgenMove branch 3 times, most recently from 884189f to 7d557fc Compare April 28, 2017 22:32
@wtgodbe
Copy link
Copy Markdown
Member Author

wtgodbe commented Apr 28, 2017

@dotnet-bot test Windows_NT Release pri1r2r

@wtgodbe
Copy link
Copy Markdown
Member Author

wtgodbe commented Apr 28, 2017

@dotnet-bot test Ubuntu Release pri1r2r

@wtgodbe
Copy link
Copy Markdown
Member Author

wtgodbe commented Apr 29, 2017

@dotnet-bot test Tizen armel Cross Release Build

Update if statement
@wtgodbe
Copy link
Copy Markdown
Member Author

wtgodbe commented Apr 29, 2017

@dotnet-bot test Ubuntu Release pri1r2r

@wtgodbe
Copy link
Copy Markdown
Member Author

wtgodbe commented Apr 29, 2017

@dotnet-bot test Windows_NT Release pri1r2r

@gkhanna79
Copy link
Copy Markdown
Member

20:15:53 FAILED   - baseservices/threading/interlocked/add/CheckAddInt/CheckAddInt.sh
20:15:53                BEGIN EXECUTION
20:15:53                /mnt/j/workspace/dotnet_coreclr/master/x64_release_ubuntu_pri1r2r_tst_prtest/bin/tests/Windows_NT.x64.Release/Tests/coreoverlay/corerun CheckAddInt.exe /start:2147483647 /add:100
20:15:53                Managed assembly not found: No such file or directory
20:15:53                Expected: 100
20:15:53                Actual: 255
20:15:53                END EXECUTION - FAILED

Were these passing earlier? How about you merge the PR and look into if this failure persists?

@wtgodbe
Copy link
Copy Markdown
Member Author

wtgodbe commented Apr 29, 2017

I haven't seen those failures before, and the build history for r2r jobs doesn't go back far enough to see if they were failing before the infra issue popped up. I'll merge this & keep an eye on mission control.

@wtgodbe wtgodbe merged commit a60bc9f into dotnet:master Apr 29, 2017
@karelz karelz modified the milestone: 2.0.0 Aug 28, 2017
MichalStrehovsky added a commit to MichalStrehovsky/coreclr that referenced this pull request Jul 8, 2019
dotnet#10525 regressed loading ni.exe files - after this change, the runtime no longer looks for the .ni.exe variants of .exe files because the .exe is considered trusted.

This regression was worked around in dotnet#11272 for crossgen testing, but we still have tests (such as tests\src\readytorun\tests) that are now not testing anything because we're silently falling back to JIT.

This makes corerun add both .exe and .ni.exe into the trusted assembly list.
MichalStrehovsky added a commit to MichalStrehovsky/runtime that referenced this pull request Feb 6, 2020
Reverts dotnet/coreclr#10525.

This broke probing for .ni.exe images. If we run `corerun foo.exe` for something that has a `foo.ni.exe`, we wouldn't pick up the native image because foo.exe is considered trusted and foo.ni.exe is not. This means we would fall back to JIT. But only if foo.exe is not in CORE_ROOT. If it is, it works...

The pull request broke crossgen testing that was eventually worked around in dotnet/coreclr#11272, but it's also breaking the tests in tests\src\readytorun\tests (we just didn't find out because they're falling back to JIT). We could work around there too, but this took half a day for me to investigate, so I don't want to leave the landmine there for someone else to lose a leg over (the fact that ni probing works if you put the exe and ni.exe into CORE_ROOT was a major timesink when troubleshooting).

I don't see much point in this change. It's fixing the case when someone copied something.exe to CORE_ROOT and then tries to `corerun some\other\version\of\something.exe`, but it doesn't fix the situation when the something.exe depends on dependency.dll - we would still pick up dependency.dll from CORE_ROOT, which is likely the wrong version. The only way to win this game is not to play it - don't put stuff in CORE_ROOT.
MichalStrehovsky added a commit to dotnet/runtime that referenced this pull request Feb 7, 2020
…" (#31848)

Reverts dotnet/coreclr#10525.

This broke probing for .ni.exe images. If we run `corerun foo.exe` for something that has a `foo.ni.exe`, we wouldn't pick up the native image because foo.exe is considered trusted and foo.ni.exe is not. This means we would fall back to JIT. But only if foo.exe is not in CORE_ROOT. If it is, it works...

The pull request broke crossgen testing that was eventually worked around in dotnet/coreclr#11272, but it's also breaking the tests in tests\src\readytorun\tests (we just didn't find out because they're falling back to JIT). We could work around there too, but this took half a day for me to investigate, so I don't want to leave the landmine there for someone else to lose a leg over (the fact that ni probing works if you put the exe and ni.exe into CORE_ROOT was a major timesink when troubleshooting).

I don't see much point in this change. It's fixing the case when someone copied something.exe to CORE_ROOT and then tries to `corerun some\other\version\of\something.exe`, but it doesn't fix the situation when the something.exe depends on dependency.dll - we would still pick up dependency.dll from CORE_ROOT, which is likely the wrong version. The only way to win this game is not to play it - don't put stuff in CORE_ROOT.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants