UIRibbon.dll crash in my Windows app

R

Robert Weatherford


I am developing a C# Windows Forms app that is using the UIRibbon dll through the Sunburst.WindowsForms.Ribbon package. I have been trying to track this seemingly random crash for months now, and I finally have a reproduceable way to make it happen. It seems to be happening deep inside UIRibbon.dll. The dll code is crashing on an == operator. The pointer reference (ecx) is not null, so it’s probably a “real” access violation. Without the source code for the dll, all I can see are symbols and x86 registers.

Before I started using UIRibbon through the Sunburst.WindowsForms.Ribbon, I was using a different WinForms ribbon library that was all managed. I didn’t like the library after spending countless days fiddling with their code to fix bugs, so I decided to migrate to something else. I should say that aside from these rare crashes, the ribbon is behaving just as it should in the app. The app is incredibly stable otherwise. It seems extremely unlikely that my app is somehow corrupting memory and always managing to hit UIRIbbon and nothing else. That was actually my first thought months ago when this first started. At this point, I am finding it difficult to believe it has something to do with the Sunburst.WindowsForms.Ribbon package, as it’s a very lightweight wrapper around the DLL. I am open to evidence to the contrary. The code is built on the Windows Ribbon for WinForms by Arik Poznanski project from several years ago.

Here’s how I can reproduce the problem 2 out of 3 times: Switch ribbon tabs and click a button which runs a blocking long-running command (2-3 seconds). While that is running, click on the original ribbon tab. When the command completes, both tabs are highlighted and the access violation occurs. I suspect blocking the UI thread is a necessary part of reproducing the bug, but that's just a hunch.


Here is the stack traces of the error:

Application: xxx.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: exception code c0000005, exception address 7BBBF088
Stack:
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG ByRef)
at System.Windows.Forms.Application+ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr, Int32, Int32)
at System.Windows.Forms.Application+ThreadContext.RunMessageLoopInner(Int32, System.Windows.Forms.ApplicationContext)
at System.Windows.Forms.Application+ThreadContext.RunMessageLoop(Int32, System.Windows.Forms.ApplicationContext)
at System.Windows.Forms.Application.Run(System.Windows.Forms.Form)
at Parastream.BMS.WinForms.Program.Main()


Exception thrown at 0x7BBBF088 (UIRibbon.dll) in xxx.exe: 0xC0000005: Access violation reading location 0x12EDE44C. occurred
UIRibbon.dll!operator==(struct _tagpropertykey const &,struct _tagpropertykey const &) Unknown
UIRibbon.dll!CControlUser::GetKnownResourceType(struct _tagpropertykey const *,enum tagEResourceType *) Unknown
UIRibbon.dll!CControlUser::CacheInvalidateUICommand(enum UI_INVALIDATIONS,struct _tagpropertykey const *) Unknown
UIRibbon.dll!COfficeSpaceUser::InvalidateUICommandInternal(unsigned int,enum UI_INVALIDATIONS,struct _tagpropertykey const *,enum INVALIDATIONEXCLUSION) Unknown
UIRibbon.dll!COfficeSpaceUser::OnUpdate(void) Unknown
UIRibbon.dll!COfficeSpaceUser::FrameListenerWndProc(struct HWND__ *,unsigned int,unsigned int,long,long *) Unknown
UIRibbon.dll!COfficeSpaceUser::s_FrameListenerWndProc(void *,struct HWND__ *,unsigned int,unsigned int,long,long *) Unknown
> UIRibbon.dll!WndBridge::RawWndProc(struct HWND__ *,unsigned int,unsigned int,long) Unknown
atlthunk.dll!64821836() Unknown
atlthunk.dll![Frames below may be incorrect and/or missing, no symbols loaded for atlthunk.dll] Unknown
[External Code]
xxx.exe!xxx.Program.Main() Line 25 C#
[External Code]


Please note that this bug has been looked at by the Visual Studio development team, which was ultimately forwarded to John Qiao, who directed me here:

John Qiao [MSFT] 6 hours ago

Hi Robertw,

Thanks for your feedback!

Where did you download this Sunburst.WindowsForms.Ribbon package? If you downloaded it from https://github.com/SunburstApps/Sunburst.WindowsForms.Ribbon, we suggest you post this issue in here: https://github.com/SunburstApps/Sunburst.WindowsForms.Ribbon/issues for the better response.

If this issue is related to Windows, please post it at Results in Windows - Microsoft Community for the better response.



Continue reading...
 

Similar threads

G
Replies
0
Views
31
GisleVanem
G
D
Replies
0
Views
15
Duncan MacMichael
D
S
Replies
0
Views
529
Sumit Suphaloes
S
Back
Top Bottom