You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After attempting to update our net48-targeting application's builds from .NET SDK 7.0.404 to 8.0.101, we ran into previously valid application code consistently hanging in Release builds.
The change in behaviour is found in Case 3, and can be triggered with dotnet run -c Release -- 3, when changing the SDK version in global.json between 7.0.404 and 8.0.101.
The IL diff produced by the application on 7.0.404 and 8.0.101:
diff --git "a/C:\\Users\\mjones\\AppData\\Local\\Temp\\tmpC0BE.tmp" "b/C:\\Users\\mjones\\AppData\\Local\\Temp\\tmpC11D.tmp"
index da52341..b3a9ecd 100644
--- "a/C:\\Users\\mjones\\AppData\\Local\\Temp\\tmpC0BE.tmp"+++ "b/C:\\Users\\mjones\\AppData\\Local\\Temp\\tmpC11D.tmp"@@ -28,7 +28,10 @@
6D 72 65 00 00 ) // mre..
.custom instance void [mscorlib]System.Reflection.AssemblyConfigurationAttribute::.ctor(string) = ( 01 00 07 52 65 6C 65 61 73 65 00 00 ) // ...Release..
.custom instance void [mscorlib]System.Reflection.AssemblyFileVersionAttribute::.ctor(string) = ( 01 00 07 31 2E 30 2E 30 2E 30 00 00 ) // ...1.0.0.0..
- .custom instance void [mscorlib]System.Reflection.AssemblyInformationalVersionAttribute::.ctor(string) = ( 01 00 05 31 2E 30 2E 30 00 00 ) // ...1.0.0..+ .custom instance void [mscorlib]System.Reflection.AssemblyInformationalVersionAttribute::.ctor(string) = ( 01 00 2E 31 2E 30 2E 30 2B 34 64 62 63 62 31 30 // ...1.0.0+4dbcb10+ 36 36 64 66 36 31 34 34 62 30 63 35 37 34 63 38 // 66df6144b0c574c8+ 31 34 36 36 63 65 66 62 31 62 62 32 62 64 66 63 // 1466cefb1bb2bdfc+ 64 00 00 ) // d..
.custom instance void [mscorlib]System.Reflection.AssemblyProductAttribute::.ctor(string) = ( 01 00 10 6E 65 74 38 73 64 6B 2D 68 61 6E 67 2D // ...net8sdk-hang-
6D 72 65 00 00 ) // mre..
.custom instance void [mscorlib]System.Reflection.AssemblyTitleAttribute::.ctor(string) = ( 01 00 10 6E 65 74 38 73 64 6B 2D 68 61 6E 67 2D // ...net8sdk-hang-
@@ -37,13 +40,13 @@
.ver 1:0:0:0
}
.module 'net8sdk-hang-mre.exe'
-// MVID: {C4619B5E-BB80-47A9-8657-D99AE29EE9AC}+// MVID: {40427478-C9F6-4E7B-9A13-01E75142BE01}
.imagebase 0x00400000
.file alignment 0x00000200
.stackreserve 0x00100000
.subsystem 0x0003 // WINDOWS_CUI
.corflags 0x00000001 // ILONLY
-// Image base: 0x06FD0000+// Image base: 0x05200000
// =============== CLASS MEMBERS DECLARATION ===================
@@ -151,7 +154,7 @@
} // end of class net8sdk_hang_mre.Program
-.class interface public abstract auto ansi net8sdk_hang_mre.IFoo`1<T>+.class interface public abstract auto ansi beforefieldinit net8sdk_hang_mre.IFoo`1<T>
{
.method public hidebysig newslot abstract virtual
instance bool DoSomething() cil managed
@@ -160,11 +163,11 @@
} // end of class net8sdk_hang_mre.IFoo`1
-.class interface public abstract auto ansi net8sdk_hang_mre.IBaseParams+.class interface public abstract auto ansi beforefieldinit net8sdk_hang_mre.IBaseParams
{
} // end of class net8sdk_hang_mre.IBaseParams
-.class interface public abstract auto ansi net8sdk_hang_mre.IParams+.class interface public abstract auto ansi beforefieldinit net8sdk_hang_mre.IParams
implements net8sdk_hang_mre.IBaseParams
{
} // end of class net8sdk_hang_mre.IParams
Looking a bit deeper into this - it seems like this results from the changes in #69850.
I built the MRE using SDK version 8.0.101 with dotnet build -c Release net8sdk-hang-mre\net8sdk-hang-mre.csproj and then dumped the IL from the executable with ildasm. I've created a gist with this .il file alongside a patch that removes the beforefieldinit flag from interfaces.
When reassembling the IL with ilasm, case 3 hangs indefinitely with the unpatched executable but runs without issue when patched and reassembled.
Describe the bug
After attempting to update our
net48
-targeting application's builds from .NET SDK 7.0.404 to 8.0.101, we ran into previously valid application code consistently hanging in Release builds.To Reproduce
MRE Github Repo: https://github.com/mthjones/net8sdk-hang-mre/tree/main
The change in behaviour is found in Case 3, and can be triggered with
dotnet run -c Release -- 3
, when changing the SDK version inglobal.json
between 7.0.404 and 8.0.101.The IL diff produced by the application on 7.0.404 and 8.0.101:
Exceptions (if any)
None.
Further technical details
`dotnet --info` output
The text was updated successfully, but these errors were encountered: