Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Test failure Loader\\classloader\\Casting\\Functionpointer\\Functionpointer.cmd #81106

Closed
JulieLeeMSFT opened this issue Jan 24, 2023 · 12 comments · Fixed by #81122
Closed

Test failure Loader\\classloader\\Casting\\Functionpointer\\Functionpointer.cmd #81106

JulieLeeMSFT opened this issue Jan 24, 2023 · 12 comments · Fixed by #81122
Assignees
Labels
area-VM-coreclr blocking-outerloop Blocking the 'runtime-coreclr outerloop' and 'runtime-libraries-coreclr outerloop' runs disabled-test The test is disabled in source code against the issue
Milestone

Comments

@JulieLeeMSFT
Copy link
Member

Failed in Run: runtime-coreclr outerloop 20230124.1 and many ohter outerloop runs

Failed tests:

R2R-CG2 linux x64 Checked no_tiered_compilation @ Ubuntu.1804.Amd64.Open
R2R-CG2 windows x86 Checked no_tiered_compilation @ Windows.10.Amd64.Open
R2R-CG2 linux x64 Checked no_tiered_compilation @ (Alpine.314.Amd64.Open)Ubuntu.1804.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.14-helix-amd64
R2R-CG2 linux x64 Checked @ Ubuntu.1804.Amd64.Open
R2R-CG2 windows x86 Checked @ Windows.10.Amd64.Open
R2R-CG2 windows x64 Checked @ Windows.10.Amd64.Open
R2R-CG2 linux arm64 Checked no_tiered_compilation @ (Ubuntu.1804.Arm64.Open)Ubuntu.1804.Armarch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-helix-arm64v8
R2R-CG2 linux arm64 Checked @ (Ubuntu.1804.Arm64.Open)Ubuntu.1804.Armarch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-helix-arm64v8
R2R-CG2 windows arm Checked no_tiered_compilation @ Windows.11.Arm64.Open
R2R-CG2 linux x64 Checked @ (Alpine.314.Amd64.Open)Ubuntu.1804.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.14-helix-amd64
R2R-CG2 linux x64 Checked @ (Alpine.314.Amd64.Open)Ubuntu.1804.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.14-helix-amd64
R2R-CG2 windows x64 Checked no_tiered_compilation @ Windows.10.Amd64.Open
R2R-CG2 windows arm Checked @ Windows.11.Arm64.Open
R2R-CG2 windows arm64 Checked no_tiered_compilation @ Windows.11.Arm64.Open
R2R-CG2 linux arm64 Checked @ (Alpine.314.Arm64.Open)Ubuntu.1804.ArmArch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.14-helix-arm64v8
R2R-CG2 osx x64 Checked @ OSX.1200.Amd64.Open
R2R-CG2 osx x64 Checked no_tiered_compilation @ OSX.1200.Amd64.Open
R2R-CG2 windows arm64 Checked @ Windows.11.Arm64.Open
  - Loader\classloader\Casting\Functionpointer\Functionpointer.cmd [FAIL]

Error message:

      Process terminated. Assertion failed.
      Duplicate node name emitted to file
      Symbol DelayLoadHelperImport(DelayLoad_Helper) -> SignaturePointer_NewArraySignature: __Array<__FnPtr<Int32<>>> has already been written to the output object file C:\h\w\950D07E7\w\AF0A0977\e\Loader\classloader\Casting\Functionpointer\Functionpointer.dll with symbol ILCompiler.DependencyAnalysis.ReadyToRunObjectWriter+NodeInfo
         at ILCompiler.DependencyAnalysis.ReadyToRunObjectWriter.EmitObjectData(R2RPEBuilder r2rPeBuilder, ObjectData data, Int32 nodeIndex, String name, ObjectNodeSection section) in /_/src/coreclr/tools/aot/ILCompiler.ReadyToRun/CodeGen/ReadyToRunObjectWriter.cs:line 500
         at ILCompiler.DependencyAnalysis.ReadyToRunObjectWriter.EmitPortableExecutable() in /_/src/coreclr/tools/aot/ILCompiler.ReadyToRun/CodeGen/ReadyToRunObjectWriter.cs:line 296
         at ILCompiler.DependencyAnalysis.ReadyToRunObjectWriter.EmitObject(String objectFilePath, EcmaModule componentModule, IEnumerable`1 inputFiles, IEnumerable`1 nodes, NodeFactory factory, Boolean generateMapFile, Boolean generateMapCsvFile, Boolean generatePdbFile, String pdbPath, Boolean generatePerfMapFile, String perfMapPath, Int32 perfMapFormatVersion, Boolean generateProfileFile, CallChainProfile callChainProfile, Int32 customPESectionAlignment) in /_/src/coreclr/tools/aot/ILCompiler.ReadyToRun/CodeGen/ReadyToRunObjectWriter.cs:line 547
         at ILCompiler.ReadyToRunCodegenCompilation.Compile(String outputFile) in /_/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs:line 356
         at ILCompiler.Program.RunSingleCompilation(Dictionary`2 inFilePaths, InstructionSetSupport instructionSetSupport, String compositeRootPath, Dictionary`2 unrootedInputFilePaths, HashSet`1 versionBubbleModulesHash, ReadyToRunCompilerContext typeSystemContext) in /_/src/coreclr/tools/aot/crossgen2/Program.cs:line 616
         at ILCompiler.Program.Run() in /_/src/coreclr/tools/aot/crossgen2/Program.cs:line 289
         at ILCompiler.Crossgen2RootCommand.<>c__DisplayClass187_0.<.ctor>b__0(InvocationContext context) in /_/src/coreclr/tools/aot/crossgen2/Crossgen2RootCommand.cs:line 293
         at System.CommandLine.Invocation.AnonymousCommandHandler.Invoke(InvocationContext context)
         at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
         at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
         at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<BuildInvocationChain>b__0(InvocationContext invocationContext, Func`2 _)
         at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_2.<BuildInvocationChain>b__3(InvocationContext c)
         at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseParseErrorReporting>b__0>d.MoveNext()
         at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
         at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<UseParseErrorReporting>b__0(InvocationContext context, Func`2 next)
         at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_2.<BuildInvocationChain>b__3(InvocationContext c)
         at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass11_0.<<UseHelp>b__0>d.MoveNext()
         at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
         at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass11_0.<UseHelp>b__0(InvocationContext context, Func`2 next)
         at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_2.<BuildInvocationChain>b__3(InvocationContext c)
         at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseVersionOption>b__0>d.MoveNext()
         at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
         at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<UseVersionOption>b__0(InvocationContext context, Func`2 next)
         at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_1.<BuildInvocationChain>b__2(InvocationContext ctx, Func`2 next)
         at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_1.<BuildInvocationChain>b__2(InvocationContext ctx, Func`2 next)
         at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_1.<BuildInvocationChain>b__2(InvocationContext ctx, Func`2 next)
         at System.CommandLine.Invocation.InvocationPipeline.<Invoke>g__FullInvocationChain|3_0(InvocationContext context)
         at System.CommandLine.Invocation.InvocationPipeline.Invoke(IConsole console)
         at System.CommandLine.Parsing.ParseResultExtensions.Invoke(ParseResult parseResult, IConsole console)
         at System.CommandLine.Parsing.ParserExtensions.Invoke(Parser parser, String[] args, IConsole console)
         at ILCompiler.Program.Main(String[] args) in /_/src/coreclr/tools/aot/crossgen2/Program.cs:line 892

Stack trace:

           at Loader_classloader._Casting_Functionpointer_Functionpointer_._Casting_Functionpointer_Functionpointer_cmd()
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
           at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
@JulieLeeMSFT JulieLeeMSFT added area-VM-coreclr blocking-outerloop Blocking the 'runtime-coreclr outerloop' and 'runtime-libraries-coreclr outerloop' runs labels Jan 24, 2023
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jan 24, 2023
@JulieLeeMSFT
Copy link
Member Author

@mangod9, PTAL. It is blocking outerloop for many tests.

@mangod9
Copy link
Member

mangod9 commented Jan 24, 2023

@trylek is there any recent change which would cause these failures?

@trylek trylek assigned trylek and unassigned mangod9 Jan 24, 2023
@trylek
Copy link
Member

trylek commented Jan 24, 2023

I'm not aware of any particular recent suspicious change, however the function pointers are a relatively new feature that continues to proliferate through the framework; this type of error can be randomly triggered by adding some new code to SPC or other assembly i.o.w. by ambient growth of the code base. I have reassigned the bug to myself, I'm going to prioritize investigating it, this type of bug is usually relatively easy to track down and fix, the problem is just that there's some aspect of the function pointer type (e.g. calling convention or other flags) that is not serialized into the internal node name.

@trylek
Copy link
Member

trylek commented Jan 24, 2023

For the recent change that would cause these failures, I guess it's this one:

#80855

@JulieLeeMSFT
Copy link
Member Author

@fanyang-mono, your PR is causing failures that is affecting many of outerloop runs. Please take a look with a high priority.
cc @SamMonoRT.

For the recent change that would cause these failures, I guess it's this one:

#80855

@JulieLeeMSFT JulieLeeMSFT assigned fanyang-mono and unassigned trylek Jan 24, 2023
@SamMonoRT
Copy link
Member

@JulieLeeMSFT - I believe this is a new test added as part of @fanyang-mono PR -- should we disable those for CoreCLR to get the outerloop unblocked ?

@fanyang-mono
Copy link
Member

@JulieLeeMSFT According to the error message, it seems to me that CoreCLR is not handling the testing scenarios that I added in my PR properly. As Sam mentioned earlier, we could disable the newly added test to make the CI lane passes. But further investigation on CoreCLR side is needed.

Also, what does R2R_CG2 mean?

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jan 24, 2023
@JulieLeeMSFT
Copy link
Member Author

@fanyang-mono and @SamMonoRT, I see that @trylek has a fix. Thanks all.

@JulieLeeMSFT JulieLeeMSFT added this to the 8.0.0 milestone Jan 24, 2023
@JulieLeeMSFT JulieLeeMSFT removed the untriaged New issue has not been triaged by the area owner label Jan 24, 2023
@SamMonoRT
Copy link
Member

@trylek @JulieLeeMSFT -- Please note, the original PR which added this test was also approved for backport to 7.0 via #80927 --- I'm not certain if your fix needs to be backported (or added to original backport PR) ?

@JulieLeeMSFT JulieLeeMSFT assigned trylek and unassigned fanyang-mono Jan 24, 2023
@trylek
Copy link
Member

trylek commented Jan 24, 2023

@SamMonoRT - well, if the test gets backported to 7.0, it will certainly start to fail in Crossgen2 builds because of this bug. For now I assume this means that the Crossgen2 fix also needs to request backport to 7.0, please let me know if you think otherwise.

@trylek
Copy link
Member

trylek commented Jan 24, 2023

@fanyang-mono - for R2R-CG2, that's supposed to mean "ReadyToRun-Crossgen2", in other words, both the framework and the individual test assemblies get compiled by Crossgen2 prior to execution (the framework gets crossgenned on the AzDO build machine, the test apps get crossgenned on the final execution machines in Helix); this is also the only way we test Crossgen2 execution on arm / arm64, when we Crossgen2 the framework in the lab, we do that on x64 hardware using cross-compilation.

@SamMonoRT
Copy link
Member

@SamMonoRT - well, if the test gets backported to 7.0, it will certainly start to fail in Crossgen2 builds because of this bug. For now I assume this means that the Crossgen2 fix also needs to request backport to 7.0, please let me know if you think otherwise.

Yes, we should backport your fix to 7.0. The merging window is closed at the moment. I'll add a note to that PR, so Carlos is aware and can merge both of them together.

@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Jan 27, 2023
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jan 27, 2023
@fanyang-mono fanyang-mono added the disabled-test The test is disabled in source code against the issue label Jan 27, 2023
trylek added a commit to trylek/runtime that referenced this issue Jan 30, 2023
This fixes the recently introduced issue dotnet#81106 tracking Crossgen2
crash due to not being able to distinguish two function pointers
differing only by calling convention (one of the pointers is Static
and the other is Static | UnmanagedCallingConvention).

Thanks

Tomas
@ghost ghost added in-pr There is an active PR which will close this issue when it is merged and removed in-pr There is an active PR which will close this issue when it is merged labels Jan 31, 2023
trylek added a commit that referenced this issue Jan 31, 2023
…81122)

This fixes the recently introduced issue #81106 tracking Crossgen2
crash due to not being able to distinguish two function pointers
differing only by calling convention (one of the pointers is Static
and the other is Static | UnmanagedCallingConvention).

This change also removes the issues.targets exclusion for the
new function pointer test that Fan Yang had to add to unblock
merging in the test in the first place.

Thanks

Tomas

* Delete superfluous comment per Michal's PR feedback
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Jan 31, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Mar 3, 2023
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
area-VM-coreclr blocking-outerloop Blocking the 'runtime-coreclr outerloop' and 'runtime-libraries-coreclr outerloop' runs disabled-test The test is disabled in source code against the issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants