Skip to content

UWP Optimized code for ARM64 throws exception #116985

Closed
@jsonbailey

Description

@jsonbailey

Description

I have a UWP app that builds and run without issue in debug mode. When we attempt to run the release version with code optimization enabled and targeting ARM64 it throws an exception. If I target x64, there is no exception.

LDTest.zip

Reproduction Steps

Run the provided sample application with code optimization enabled and targeting ARM64.

Expected behavior

The optimized code should not trigger an exception and run like it does for other architectures.

Actual behavior

When it processes the WithGreeting method on an optimized build for ARM64 it throws an exception.

Unhandled exception at 0x00007FFA3A2AD520 (SharedLibrary.dll) in LDTest.exe: 0x00001007.

System.Private.SharedLibrary.Interop.Generated.dll!__Interop.api_ms_win_core_kernel32_legacy_l1_1_0_dll.PInvoke_RaiseFailFastException(Interop._EXCEPTION_RECORD* pExceptionRecord = 0x0000000000000000, System.IntPtr pContextRecord = 0x0000000000000007, uint dwFlags = 2248957584)
System.Private.CoreLib.dll!System.RuntimeExceptionHelpers.FailFast(string message, System.Exception exception, System.RuntimeExceptionHelpers.RhFailFastReason reason = Unknown, System.IntPtr pExAddress = 0x0000000000000007, System.IntPtr pExContext = 0x000000495cbfc930) Line 236
	at f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\RuntimeExceptionHelpers.cs(236)
System.Private.CoreLib.dll!System.RuntimeExceptionHelpers.RuntimeFailFast(System.RuntimeExceptionHelpers.RhFailFastReason reason, System.Exception exception, System.IntPtr pExAddress, System.IntPtr pExContext) Line 193
	at f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\RuntimeExceptionHelpers.cs(193)

Regression?

No response

Known Workarounds

Using a foreach loop and removing the Where method as shown in this PR https://github.com/launchdarkly/dotnet-sdk-internal/pull/42/files seems to prevent the error from happening.

Configuration

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions