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

Breaking R2R (crossgen2) input bubble promise results leads to corrupted execution #71131

Closed
vuplea opened this issue Jun 22, 2022 · 1 comment · Fixed by #73350
Closed

Breaking R2R (crossgen2) input bubble promise results leads to corrupted execution #71131

vuplea opened this issue Jun 22, 2022 · 1 comment · Fixed by #73350
Assignees
Milestone

Comments

@vuplea
Copy link

vuplea commented Jun 22, 2022

Description

In this discussion, it was mentioned that a mismatch between the reference assembly at crossgen2 time and the assembly at runtime should result in a fail-fast behavior.

The following repro results in a corrupted execution. A different scenario of ours also resulted in Access Violation.
Repro:

  • Have 6.0.6 runtime installed
  • Build this project and run from the published folder

Program.cs

HashSet<int> xs = new() { 3, 7, 17, 37, 79 };
foreach (var x in xs)
{
    Console.WriteLine(x);
}

csproj

<Project Sdk="Microsoft.NET.Sdk">
	<PropertyGroup>
		<OutputType>Exe</OutputType>
		<TargetFramework>net6.0</TargetFramework>
		<RuntimeFrameworkVersion>6.0.5</RuntimeFrameworkVersion>
		<ImplicitUsings>true</ImplicitUsings>
		<PublishDir>published</PublishDir>
		<PublishReadyToRun>True</PublishReadyToRun>
		<PublishReadyToRunCrossgen2ExtraArgs>--inputbubble</PublishReadyToRunCrossgen2ExtraArgs>
		<RuntimeIdentifier>win8-x64</RuntimeIdentifier>
		<SelfContained>false</SelfContained>
	</PropertyGroup>
	<Target Name="PublishAfterBuild" AfterTargets="Build">
		<CallTarget Targets="Publish" />
	</Target>
</Project>
  • Exception:
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
                  at System.Collections.Generic.HashSet`1.Enumerator..ctor(HashSet`1 hashSet)
                  at Program.<Main>$(String[] args) in C:\Users\user\source\repos\ConsoleAppCrossgen\ConsoleAppCrossgen\Program.cs:line 2
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jun 22, 2022
@davidwrighton
Copy link
Member

Sigh, it looks like the failfast is only available for composite images using input bubble, which is a truly rare scenario.

@davidwrighton davidwrighton self-assigned this Jul 7, 2022
@mangod9 mangod9 removed the untriaged New issue has not been triaged by the area owner label Jul 7, 2022
@mangod9 mangod9 added this to the 7.0.0 milestone Jul 7, 2022
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Aug 4, 2022
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Aug 8, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Sep 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants