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
CallingConventionInfo (#126408) in the cDAC cannot reliably distinguish Apple ARM64 (macOS/iOS) from Linux ARM64, because RuntimeInfoOperatingSystem only has Unix — which covers both platforms.
Apple ARM64 has different stack alignment rules than Linux ARM64 (Apple uses natural alignment for primitives and 4-byte alignment for float HFAs on the stack, while Linux uses 8-byte alignment for everything). Applying the wrong rules produces incorrect argument offset calculations in ArgIterator.
Current State
IsAppleArm64ABI is hardcoded to false to avoid applying Apple-specific rules on Linux. This means Apple ARM64 stack layout may be slightly incorrect for value types passed on the stack.
Proposed Fix
Add a reliable Apple platform discriminator to IRuntimeInfo (or add a new global/data descriptor), such as:
RuntimeInfoOperatingSystem.Apple or RuntimeInfoOperatingSystem.MacOS
A boolean global IsApplePlatform
Inferring from the target's OS name string
Then update CallingConventionInfo to set IsAppleArm64ABI = true only when the target is confirmed to be an Apple platform.
Description
CallingConventionInfo(#126408) in the cDAC cannot reliably distinguish Apple ARM64 (macOS/iOS) from Linux ARM64, becauseRuntimeInfoOperatingSystemonly hasUnix— which covers both platforms.Apple ARM64 has different stack alignment rules than Linux ARM64 (Apple uses natural alignment for primitives and 4-byte alignment for float HFAs on the stack, while Linux uses 8-byte alignment for everything). Applying the wrong rules produces incorrect argument offset calculations in
ArgIterator.Current State
IsAppleArm64ABIis hardcoded tofalseto avoid applying Apple-specific rules on Linux. This means Apple ARM64 stack layout may be slightly incorrect for value types passed on the stack.Proposed Fix
Add a reliable Apple platform discriminator to
IRuntimeInfo(or add a new global/data descriptor), such as:RuntimeInfoOperatingSystem.AppleorRuntimeInfoOperatingSystem.MacOSIsApplePlatformThen update
CallingConventionInfoto setIsAppleArm64ABI = trueonly when the target is confirmed to be an Apple platform.Files
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/CallingConvention/CallingConventionInfo.cssrc/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IRuntimeInfo.csNote
This issue was created with AI assistance from Copilot.