AccessViolationException on ToolTip that faults COMCTL32.dll - .NET 4.0

У нас возникла проблема с приложением Windows forms, которое завершается из-за необработанного исключения типа AccessViolationException, которое, как показывает трассировка стека, происходит в элементе управления ToolTip.

Ошибка возникает в разное время в приложении, и в настоящее время мы не можем надежно воспроизвести ее. На данном этапе она возникает только в производстве на Windows 7 и только у некоторых пользователей, но не у других - даже среди пользователей, которые используют приложение аналогичным образом. Похоже, что это связано с машиной, поэтому мы предприняли такие действия, как проверка актуальности графического драйвера.

В журнале событий всегда регистрируются 2 разные ошибки, одна относится к нашему приложению:

Application: .exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
Stack:
   at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr, IntPtr, Int32, IntPtr, IntPtr)
   at System.Windows.Forms.NativeWindow.DefWndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.ToolTip.WndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.ToolTip+ToolTipNativeWindow.WndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr, Int32, IntPtr, IntPtr)
   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 .Windows.Forms..Startup.Main(System.String[])

и одна к comctl32.dll:

Faulting application name: .exe, version: 7.13.0.2086, time stamp: 0x4ec5e710
Faulting module name: comctl32.dll, version: 5.82.7601.17514, time stamp: 0x4ce7b82c
Exception code: 0xc0000005
Fault offset: 0x00043286
Faulting process id: 0xcdc
Faulting application start time: 0x01cca96312446309
Faulting application path: C:\Program Files\\Client\.exe
Faulting module path: C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.17514_none_ec83dffa859149af\comctl32.dll
Report Id: b425143c-1575-11e1-bccf-6c626d955bf1

Первая трассировка стека меняется в зависимости от того, в каком месте рабочего процесса произошла ошибка, однако, первые 9 элементов в стеке всегда одинаковы, разница обычно заключается в вызове showDialog, который появляется между методом Main() и методом RunMessageLoop. Например:

Application: .exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
Stack:
   at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr, IntPtr, Int32, IntPtr, IntPtr)
   at System.Windows.Forms.NativeWindow.DefWndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.ToolTip.WndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.ToolTip+ToolTipNativeWindow.WndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr, Int32, IntPtr, IntPtr)
   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.RunDialog(System.Windows.Forms.Form)
   at System.Windows.Forms.Form.ShowDialog(System.Windows.Forms.IWin32Window)
   at System.Windows.Forms.Form.ShowDialog()
   at .Windows.Forms..ApplicationForm.(System.Object, System.EventArgs)
   at ...RaiseShowResultDialogNowEvent()
   at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry)
   at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(System.Object)
   at System.Threading.ExecutionContext.runTryCode(System.Object)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode, CleanupCode, System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry)
   at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
   at System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.ScrollableControl.WndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.Form.WndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.Control+ControlNativeWindow.OnMessage(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.Control+ControlNativeWindow.WndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr, Int32, IntPtr, IntPtr)
   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 .Windows.Forms..Portal.Startup.Main(System.String[])

---- Update ----

У меня была просьба включить часть кода из Main, я не хочу включать весь код, но вот выдержка:

  _
    Public Shared Function Main(ByVal args() As String) As Integer
        -- Perform startup validation, setup logging framework, etc
        ...
        Dim appLife as new ApplicationContext(myStartupForm)
        Application.Run(appLife)
        Return 0

    End Function

Некоторые дополнительные примечания:

Кто-нибудь знает, что может быть причиной этого?

Спасибо,

14
задан Sean 2 December 2011 в 04:50
поделиться