Reputation: 220
I am working on upgrading an older C# .NET Framework 2.0 desktop application to newer .NET Framework 4.8.
The application uses System.Windows.Forms and crashes within a given work-flow at the same point.
Application Development in Visual Studio Professional 2022.
In .NET 2.0 build the crash occurs ~20% of the time (Users seemed to be ok with restart/retry work-around).
In .NET 4.8 build the crash occurs ~95% of the time.
It has been a really long time for me debugging Win32 DLL null-pointer exceptions (15+ years), and I am looking for a general guide to help me debug and correct this issue. I'm not a fan of memory issues ( possible memory corruption ).
A class of type System.Windows.Forms.UserControl provides a Grid to Add Rows; then selects ComboBox pull-down on each row cell. Crash occurs after selecting (3 in image) 2nd cell pull-down value.
Exception thrown at 0x00007FF908BC500C (user32.dll) in App.exe: 0xC0000005: Access violation reading location 0x0000000000000000.
user32.dll!xxxCBInternalUpdateEditWindow(struct tagCBox *,struct HDC__ *)
user32.dll!xxxCBCommandHandler(struct tagCBox *,unsigned long,struct HWND__ *)
user32.dll!ComboBoxWndProcWorker(struct tagWND *,unsigned int,unsigned __int64,__int64,unsigned long)
user32.dll!ComboBoxWndProcW(struct HWND__ *,unsigned int,unsigned __int64,__int64)
user32.dll!UserCallWinProcCheckWow(struct _ACTIVATION_CONTEXT *,__int64 (*)(struct tagWND *,unsigned int,unsigned __int64,__int64),struct HWND__ *,enum _WM_VALUE,unsigned __int64,__int64,void *,int)
user32.dll!CallWindowProcW()
[Managed to Native Transition]
System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.DefWndProc(ref System.Windows.Forms.Message m)
System.Windows.Forms.dll!System.Windows.Forms.Control.WmCommand(ref System.Windows.Forms.Message m)
System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m)
System.Windows.Forms.dll!System.Windows.Forms.ComboBox.WndProc(ref System.Windows.Forms.Message m)
System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(System.IntPtr hWnd, int msg = 0x00000111, System.IntPtr wparam, System.IntPtr lparam)
[Native to Managed Transition]
user32.dll!UserCallWinProcCheckWow(struct _ACTIVATION_CONTEXT *,__int64 (*)(struct tagWND *,unsigned int,unsigned __int64,__int64),struct HWND__ *,enum _WM_VALUE,unsigned __int64,__int64,void *,int)
user32.dll!SendMessageWorker(struct tagWND *,unsigned int,unsigned __int64,__int64,int)
user32.dll!SendMessageW()
user32.dll!xxxLBButtonUp(struct tagLBIV *,unsigned int)
user32.dll!xxxTrackMouse(struct tagLBIV *,unsigned int,struct tagPOINT)
user32.dll!ListBoxWndProcWorker()
user32.dll!ComboListBoxWndProcW(struct HWND__ *,unsigned int,unsigned __int64,__int64)
user32.dll!UserCallWinProcCheckWow(struct _ACTIVATION_CONTEXT *,__int64 (*)(struct tagWND *,unsigned int,unsigned __int64,__int64),struct HWND__ *,enum _WM_VALUE,unsigned __int64,__int64,void *,int)
user32.dll!CallWindowProcW()
System.Windows.Forms.ni.dll!00007ff8dade0e8d()
[Managed to Native Transition]
System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.DefWndProc(ref System.Windows.Forms.Message m)
System.Windows.Forms.dll!System.Windows.Forms.ComboBox.ComboBoxChildNativeWindow.WndProc(ref System.Windows.Forms.Message m)
System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(System.IntPtr hWnd, int msg = 0x00000202, System.IntPtr wparam, System.IntPtr lparam)
[Native to Managed Transition]
user32.dll!UserCallWinProcCheckWow(struct _ACTIVATION_CONTEXT *,__int64 (*)(struct tagWND *,unsigned int,unsigned __int64,__int64),struct HWND__ *,enum _WM_VALUE,unsigned __int64,__int64,void *,int)
user32.dll!DispatchMessageWorker()
System.Windows.Forms.ni.dll!00007ff8dae6a339()
[Managed to Native Transition]
System.Windows.Forms.dll!System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(System.IntPtr dwComponentID, int reason = 0x00000004, int pvLoopData = 0x00000000)
System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(int reason = 0x00000004, System.Windows.Forms.ApplicationContext context = {System.Windows.Forms.Application.ModalApplicationContext})
System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoop(int reason, System.Windows.Forms.ApplicationContext context)
System.Windows.Forms.dll!System.Windows.Forms.Form.ShowDialog(System.Windows.Forms.IWin32Window owner)
....Comps.iProcedureModule.ShowDialog()
Note that I know this is vague and hard for anyone to resolve here.
Upvotes: 0
Views: 117