We have many Oxygene WPF projects that run fine on Elements 12.0.0.2909 VS2022 except for one. Curiously, the project works fine if ran without the debugger or on an older version of Oxygene (10.0.0.2457).
The debugger failure occurs right when the dispatcher pushes the first frame of the main window. Even more strange is we are able to show a login prompt that occurs during the Window “Loaded” event handler. We’re able to see the first frame of the main window appear but we are immediately met with an error:
Managed Debugging Assistant 'FatalExecutionEngineError' : 'The runtime has encountered a fatal error. The address of the error was at 0x05bbdac9, on thread 0x5790. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.'
I’ve scoured our code for any Interop or unsafe code. The only code I can find is shared with a few other projects that run just fine. Regardless, it doesn’t explain why the solution works in Elements 10.
I wish we could recreate this in a smaller project as this is quite a monolith we are working on. Any assistance is greatly appreciated. Let me know if I can provide more information to help.
Message sent thanks.
Just for posterity my colleague was able to find some more information using peverify:
peverify AIX1000InstrumentManager.exe /IL /VERBOSE
Microsoft (R) .NET Framework PE Verifier. Version 4.0.30319.0
Copyright (c) Microsoft Corporation. All rights reserved.
[IL]: Error: [C:\repos\gsd\tb\thunderbolt-software-dev\InstrumentGUI\AIX1000\bin\Debug\AIX1000InstrumentManager.exe : AIX1000InstrumentGUI.UserControls.UCHome+<ShowWorklistTimingDiagram>d__0::MoveNext][mdToken=0x6000643][offset 0x000001D1][found address of value 'System.Nullable`1[System.ValueTuple`2[System.Collections.Generic.List`1[Essy.Thunderbolt.DataModel.WorklistTimeSlot],System.TimeSpan]]'][expected readonly address of value 'System.ValueTuple`2[System.Collections.Generic.List`1[Essy.Thunderbolt.DataModel.WorklistTimeSlot],System.TimeSpan]'] Unexpected type on the stack.
[IL]: Error: [C:\repos\gsd\tb\thunderbolt-software-dev\InstrumentGUI\AIX1000\bin\Debug\AIX1000InstrumentManager.exe : AIX1000InstrumentGUI.UserControls.UCHome+<ShowWorklistTimingDiagram>d__0::MoveNext][mdToken=0x6000643][offset 0x00000208][found address of value 'System.Nullable`1[System.ValueTuple`2[System.Collections.Generic.List`1[Essy.Thunderbolt.DataModel.WorklistTimeSlot],System.TimeSpan]]'][expected readonly address of value 'System.ValueTuple`2[System.Collections.Generic.List`1[Essy.Thunderbolt.DataModel.WorklistTimeSlot],System.TimeSpan]'] Unexpected type on the stack.
[IL]: Error: [C:\repos\gsd\tb\thunderbolt-software-dev\InstrumentGUI\AIX1000\bin\Debug\AIX1000InstrumentManager.exe : AIX1000InstrumentGUI.ViewModels.ClassicThunderboltRacksTabViewModel::.ctor][mdToken=0x6000cbf][offset 0x00000018][found <uninitialized> ref ('this' ptr) 'AIX1000InstrumentGUI.ViewModels.ClassicThunderboltRacksTabViewModel'][expected ref 'System.Object'] Unexpected type on the stack.
[IL]: Error: [C:\repos\gsd\tb\thunderbolt-software-dev\InstrumentGUI\AIX1000\bin\Debug\AIX1000InstrumentManager.exe : AIX1000InstrumentGUI.ViewModels.ClassicThunderboltRacksTabViewModel::.ctor][mdToken=0x6000cbf][offset 0x00000018][found <uninitialized> ref ('this' ptr) 'AIX1000InstrumentGUI.ViewModels.ClassicThunderboltRacksTabViewModel'] Uninitialized item on stack.
[IL]: Error: [C:\repos\gsd\tb\thunderbolt-software-dev\InstrumentGUI\AIX1000\bin\Debug\AIX1000InstrumentManager.exe : AIX1000InstrumentGUI.ViewModels.SlideInRacksThunderBoltRacksTabViewModel::.ctor][mdToken=0x6000d29][offset 0x00000018][found <uninitialized> ref ('this' ptr) 'AIX1000InstrumentGUI.ViewModels.SlideInRacksThunderBoltRacksTabViewModel'][expected ref 'System.Object'] Unexpected type on the stack.
[IL]: Error: [C:\repos\gsd\tb\thunderbolt-software-dev\InstrumentGUI\AIX1000\bin\Debug\AIX1000InstrumentManager.exe : AIX1000InstrumentGUI.ViewModels.SlideInRacksThunderBoltRacksTabViewModel::.ctor][mdToken=0x6000d29][offset 0x00000018][found <uninitialized> ref ('this' ptr) 'AIX1000InstrumentGUI.ViewModels.SlideInRacksThunderBoltRacksTabViewModel'] Uninitialized item on stack.
6 Error(s) Verifying AIX1000InstrumentManager.exe