What might cause a System.AccessViolationException when displaying an inspector in Outlook?

Add-in Express™ Support Service
That's what is more important than anything else

What might cause a System.AccessViolationException when displaying an inspector in Outlook?
 
Martin Bayly




Posts: 41
Joined: 2007-10-05
Standard: AddinExpress.OL.2005, Version=5.2.1192.2005, Culture=neutral, PublicKeyToken=e69a7e0f3592d2b8
Outlook version: 12.0.0.6514

We have a customer who has been experiencing Outlook crashes when using our addin.

Our exception handling is catching the following exception:


2010-03-19 17:10:38,718 [1] ERROR Taglocity.AddinModule [(null)] - Error from ADX handlers (Forms Manager)
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at AddinExpress.Extensions.x811242d1f1741667.SendMessage(IntPtr hWnd, Int32 Msg, IntPtr wParam, IntPtr lParam)
   at AddinExpress.OL.ADXOlFormsManager.DoInspectorFormShow(ADXOlFormsCollectionItem Item, x0b7892f339cc9d10 InspectorArgs, Boolean WithoutFormCreating, x4c1317b8ab97eddc Cause)


The following exception is shown in our ADX forms log (note this is from a different instance of the same issue hence the times don't match.


Exceptions:
===========

Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Exception time: 23-03-2010 9:30:51
AppWindow.WndProc(f; 0; 0)

Log:
===========

23-03-2010 9:30:51	1	 | 
23-03-2010 9:30:51	1	 | Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
23-03-2010 9:30:51	1	 | Exception time: 23-03-2010 9:30:51
23-03-2010 9:30:51	1	 | 
23-03-2010 9:30:42	1	
23-03-2010 9:30:42	1	{-Event IInspectorEvents_10.Deactivate
23-03-2010 9:30:42	1	{+Event IInspectorEvents_10.Deactivate
23-03-2010 9:30:42	1	
23-03-2010 9:30:41	1	
23-03-2010 9:30:41	1	{-Event IInspectorEvents_10.Activate
23-03-2010 9:30:41	1	----Skip AdxOlShow Form.IsHiddenByDeveloper = False
23-03-2010 9:30:41	1	----Skip AdxOlShow Form.Visible = True
23-03-2010 9:30:41	1	----Skip AdxOlShow Form is not null = True
23-03-2010 9:30:41	1	----WithoutFormCreating = True
23-03-2010 9:30:41	1	----FindInspectorForm
23-03-2010 9:30:41	1	----Not IsWordMail
23-03-2010 9:30:41	1	----SetInspectorAppWindowProperty
23-03-2010 9:30:41	1	--DoInspectorFormShow
23-03-2010 9:30:41	1	--DoInspectorActivate
23-03-2010 9:30:41	1	--InitializeServiceForms
23-03-2010 9:30:41	1	--Before getiing parentFolderEntryID
23-03-2010 9:30:41	1	--Before getiing parentFullFolderName
23-03-2010 9:30:41	1	--SetInspectorMode
23-03-2010 9:30:41	1	----mailInspectorType = xd1fa05894bebebb2, E15FE
23-03-2010 9:30:41	1	--InitMailInspectorType
23-03-2010 9:30:41	1	--itemObj.Parent.Class = 2
23-03-2010 9:30:41	1	--this.itemObj != null
23-03-2010 9:30:41	1	--GetInspectorCurrentItem
23-03-2010 9:30:41	1	--ADXOlInspectorArguments: x945026c97b3199f7, ItemObjIsNull=True, Handle = E15FE
23-03-2010 9:30:41	1	--OlInspectorEvents_BaseLogic.DoInspectorActivate
23-03-2010 9:30:41	1	{+Event IInspectorEvents_10.Activate
23-03-2010 9:30:41	1	
23-03-2010 9:30:36	1	
23-03-2010 9:30:36	1	{-Event IInspectorEvents_10.Deactivate
23-03-2010 9:30:36	1	{+Event IInspectorEvents_10.Deactivate
23-03-2010 9:30:36	1	
23-03-2010 9:30:33	1	
23-03-2010 9:30:33	1	{-Event IInspectorEvents_10.BeforeMove
23-03-2010 9:30:33	1	{+Event IInspectorEvents_10.BeforeMove
23-03-2010 9:30:33	1	
23-03-2010 9:30:31	7	xc295241d58f927d6.Dispose
23-03-2010 9:30:31	7	xc295241d58f927d6.StopWatch = true
23-03-2010 9:30:31	7	xc295241d58f927d6.SetStopWatch to True
23-03-2010 9:30:31	7	ShowChildWindowWatchObject.StopWatch
23-03-2010 9:30:31	7	
23-03-2010 9:30:31	7	{-Event x52eca185c4f4fd75.SendMessageSync
23-03-2010 9:30:31	7	----****> WaitForSingleObject mutex = System.Threading.Mutex [end  ] x52eca185c4f4fd75
23-03-2010 9:30:31	7	----@@@ _mutex.ReleaseMutex() x52eca185c4f4fd75
23-03-2010 9:30:31	1	------------
23-03-2010 9:30:31	1	------------{-Event ADXForm[][6176E].Show
23-03-2010 9:30:31	1	--------------*!* It is not WebViewPane
23-03-2010 9:30:31	1	--------------SetHTMLDocumentTitle
23-03-2010 9:30:31	1	--------------OnActivated
23-03-2010 9:30:31	1	--------------Injected
23-03-2010 9:30:31	1	----------------AdxRefresh
23-03-2010 9:30:31	1	---------------->>> NewWindowProcPointer = 26449EA
23-03-2010 9:30:31	1	---------------->>> SetNewWindowProc[FormHandle:6176E][WindowHandle:9169E]
23-03-2010 9:30:31	1	----------------> > SetCurrentProcToOldWindowProc = 47BA7803
23-03-2010 9:30:31	1	----------------> > SetCurrentProcToOldWindowProc[FormHandle:6176E][WindowHandle:9169E]
23-03-2010 9:30:31	1	--------------ADXForm[][6176E].AdxInject
23-03-2010 9:30:31	1	--------------*!* x55052e932fd92e53.Get_PixelPerInch
23-03-2010 9:30:31	1	--------------*!* x851b7ad722deef4e.Get_PixelPerInch
23-03-2010 9:30:31	1	--------------*!* xa53958b683eeccd5.Get_PixelPerInch
23-03-2010 9:30:31	1	------------{+Event ADXForm[][6176E].Show
23-03-2010 9:30:31	1	------------
23-03-2010 9:30:31	1	------------Update Inspector Item properties
23-03-2010 9:30:31	1	----------ADXOlForm.AdxOlShow
23-03-2010 9:30:31	1	------------OutlookUtils.GetFolderItems
23-03-2010 9:30:31	1	------------NewRefObj InspectorArgs.ParentFolderObj
23-03-2010 9:30:31	1	------------NewRefObj InspectorArgs.InspectorObj
23-03-2010 9:30:31	1	------------DisposeOutlookObjects
23-03-2010 9:30:31	1	----------InitializeForm
23-03-2010 9:30:31	1	----------*!* It is not WebViewPane
23-03-2010 9:30:31	1	----------SetHTMLDocumentTitle
23-03-2010 9:30:31	1	----------*!* It is not WebViewPane
23-03-2010 9:30:31	1	----------SetHTMLDocumentTitle
23-03-2010 9:30:31	1	----------*!* It is not WebViewPane
23-03-2010 9:30:31	1	----------SetHTMLDocumentTitle
23-03-2010 9:30:31	1	----------GetForm
23-03-2010 9:30:31	1	----------FindInspectorForm
23-03-2010 9:30:31	1	----------Not IsWordMail
23-03-2010 9:30:31	1	----------SetInspectorAppWindowProperty
23-03-2010 9:30:31	1	--------DoInspectorFormShow
23-03-2010 9:30:31	1	--------DoInspectorWindowShow
23-03-2010 9:30:31	1	--------InitializeServiceForms
23-03-2010 9:30:31	1	--------Before getiing parentFolderEntryID
23-03-2010 9:30:31	1	--------Before getiing parentFullFolderName
23-03-2010 9:30:31	1	--------SetInspectorMode
23-03-2010 9:30:31	1	----------mailInspectorType = xd1fa05894bebebb2, E15FE
23-03-2010 9:30:31	1	--------InitMailInspectorType
23-03-2010 9:30:31	1	--------itemObj.Parent.Class = 2
23-03-2010 9:30:31	1	--------this.itemObj != null
23-03-2010 9:30:31	1	--------GetInspectorCurrentItem
23-03-2010 9:30:31	1	--------ADXOlInspectorArguments: x1ee5743594a60ac7, ItemObjIsNull=True, Handle = E15FE
23-03-2010 9:30:31	1	--------not OutsideInspectorHandle
23-03-2010 9:30:31	1	----------inspectorEvents._outsideNotWordInspector = False
23-03-2010 9:30:31	1	--------OutsideInspectorHandle
23-03-2010 9:30:31	1	--------{-LOCK in WatchEngine.Add
23-03-2010 9:30:31	1	--------{+LOCK in WatchEngine.Add
23-03-2010 9:30:31	1	--------WatchEngine.Add
23-03-2010 9:30:31	1	--------xd2b7e57ec141d40f.create
23-03-2010 9:30:31	1	------Event OnCommonInspectorWindowShow 12
23-03-2010 9:30:31	1	----Event OnCommonReceiverWindowShow: E15FE
23-03-2010 9:30:31	1	----
23-03-2010 9:30:31	1	----{-Event IInspectorEvents_10.Activate
23-03-2010 9:30:31	1	--------Skip AdxOlShow Form is not null = False
23-03-2010 9:30:31	1	--------WithoutFormCreating = True
23-03-2010 9:30:31	1	--------FindInspectorForm
23-03-2010 9:30:31	1	--------Not IsWordMail
23-03-2010 9:30:31	1	--------SetInspectorAppWindowProperty
23-03-2010 9:30:31	1	------DoInspectorFormShow
23-03-2010 9:30:31	1	------DoInspectorActivate
23-03-2010 9:30:31	1	------InitializeServiceForms
23-03-2010 9:30:31	1	------Before getiing parentFolderEntryID
23-03-2010 9:30:31	1	------Before getiing parentFullFolderName
23-03-2010 9:30:31	1	------SetInspectorMode
23-03-2010 9:30:31	1	--------mailInspectorType = xd1fa05894bebebb2, E15FE
23-03-2010 9:30:31	1	------InitMailInspectorType
23-03-2010 9:30:31	1	------itemObj.Parent.Class = 2
23-03-2010 9:30:31	1	------this.itemObj != null
23-03-2010 9:30:31	1	------GetInspectorCurrentItem
23-03-2010 9:30:31	1	------ADXOlInspectorArguments: x945026c97b3199f7, ItemObjIsNull=True, Handle = E15FE
23-03-2010 9:30:31	1	------OlInspectorEvents_BaseLogic.DoInspectorActivate
23-03-2010 9:30:31	1	----{+Event IInspectorEvents_10.Activate
23-03-2010 9:30:31	1	----
23-03-2010 9:30:31	7	----**** WaitForSingleObject mutex = System.Threading.Mutex [wait  ] x52eca185c4f4fd75 sec = 0, res = True
23-03-2010 9:30:31	7	----@@@ _mutex.WaitOne() x52eca185c4f4fd75
23-03-2010 9:30:31	7	----<**** WaitForSingleObject mutex = System.Threading.Mutex [begin  ] x52eca185c4f4fd75
23-03-2010 9:30:31	7	{+Event x52eca185c4f4fd75.SendMessageSync
23-03-2010 9:30:31	7	



From what we can see in our own diagnostics logging, this is happening when the customer tries to display an Outlook inspector. We have an ADX form region at the bottom of the inspector.

The customer also occassionally gets errors like the following:

System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'TagTextBoxSelector'.
at System.Windows.Forms.Control.CreateHandle()
at System.Windows.Forms.TextBoxBase.CreateHandle()
at System.Windows.Forms.Control.get_Handle()
at System.Windows.Forms.Control.WmParentNotify(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.TextBoxBase.WndProc(Message& m)
at System.Windows.Forms.RichTextBox.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

The object 'TagTextBoxSelector' is a .NET control that we have on an Explorer command bar, Explorer form region and inspector form region. We can't really tell from our exception logging which one of these is having problems.

From looking through these forums, one potential issue which might cause the System.AccessViolationException, could be releasing COM objects that are owned by ADX. However, I have analyzed our code, and I cannot find any such instances.

Do you know of any other reasons that might cause this exception?

Thanks
Martin
Posted 23 Mar, 2010 19:27:03 Top
Andrei Smolin


Add-in Express team


Posts: 17122
Joined: 2006-05-11
Hi Martin,

We need to dig in this. Can you send us a project to test as well as instructions on how to reproduce this issue?

Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 24 Mar, 2010 06:35:04 Top