AccessViolationException только для VISTA - PullRequest
0 голосов
/ 16 января 2011

У меня есть приложение WPF / Winforms, которое отлично работает на XP, а также на Win 7. Но на Vista ТОЛЬКО иногда - может быть 20-30% времени, когда я вижу это:

Любая помощь очень ценится

Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
Stack:
   at MS.Win32.PresentationCore.UnsafeNativeMethods+WICImagingFactory.CreateDecoderFromStream(IntPtr, IntPtr, System.Guid ByRef, UInt32, IntPtr ByRef)
   at System.Windows.Media.Imaging.BitmapDecoder.SetupDecoderFromUriOrStream(System.Uri, System.IO.Stream, System.Windows.Media.Imaging.BitmapCacheOption, System.Guid ByRef, Boolean ByRef, System.IO.Stream ByRef, System.IO.UnmanagedMemoryStream ByRef, Microsoft.Win32.SafeHandles.SafeFileHandle ByRef)
   at System.Windows.Media.Imaging.BitmapDecoder.CreateFromUriOrStream(System.Uri, System.Uri, System.IO.Stream, System.Windows.Media.Imaging.BitmapCreateOptions, System.Windows.Media.Imaging.BitmapCacheOption, System.Net.Cache.RequestCachePolicy, Boolean)
   at System.Windows.Media.Imaging.BitmapImage.FinalizeCreation()
   at System.Windows.Media.Imaging.BitmapImage.EndInit()
   at System.Windows.Forms.Integration.Convert.ToSystemWindowsMediaImagingBitmapImage(System.Drawing.Image)
   at System.Windows.Forms.Integration.ElementHostPropertyMap.UpdateBackgroundImage(System.Windows.Forms.Integration.ElementHost)
   at System.Windows.Forms.Integration.ElementHostPropertyMap.BackgroundPropertyTranslator(System.Object, System.String, System.Object)
   at System.Windows.Forms.Integration.PropertyMap.RunTranslator(System.Windows.Forms.Integration.PropertyTranslator, System.Object, System.String, System.Object)
   at System.Windows.Forms.Integration.PropertyMap.OnPropertyChanged(System.Object, System.String, System.Object)
   at System.Windows.Forms.Integration.ElementHost.OnPropertyChanged(System.String, System.Object)
   at System.Windows.Forms.Integration.ElementHost.UpdateBackground()
   at System.Windows.Forms.Integration.ElementHost.OnVisibleChanged(System.EventArgs)
   at System.Windows.Forms.Control.OnParentVisibleChanged(System.EventArgs)
   at System.Windows.Forms.Control.OnVisibleChanged(System.EventArgs)
   at System.Windows.Forms.ScrollableControl.OnVisibleChanged(System.EventArgs)
   at System.Windows.Forms.Control.OnParentVisibleChanged(System.EventArgs)
   at System.Windows.Forms.Control.OnVisibleChanged(System.EventArgs)
   at System.Windows.Forms.ScrollableControl.OnVisibleChanged(System.EventArgs)
   at System.Windows.Forms.Control.OnParentVisibleChanged(System.EventArgs)
   at System.Windows.Forms.Control.OnVisibleChanged(System.EventArgs)
   at System.Windows.Forms.ScrollableControl.OnVisibleChanged(System.EventArgs)
   at System.Windows.Forms.Form.OnVisibleChanged(System.EventArgs)
   at System.Windows.Forms.Control.SetVisibleCore(Boolean)
   at System.Windows.Forms.Form.SetVisibleCore(Boolean)
   at System.Windows.Forms.Control.set_Visible(Boolean)
   at WeifenLuo.WinFormsUI.Docking.DockContentHandler.SetVisible()
   at WeifenLuo.WinFormsUI.Docking.DockPane.set_ActiveContent(WeifenLuo.WinFormsUI.Docking.IDockContent)
   at WeifenLuo.WinFormsUI.Docking.DockContentHandler.Activate()
   at WeifenLuo.WinFormsUI.Docking.DockContentHandler.Show(WeifenLuo.WinFormsUI.Docking.DockPanel, WeifenLuo.WinFormsUI.Docking.DockState)
   at WeifenLuo.WinFormsUI.Docking.DockContent.Show(WeifenLuo.WinFormsUI.Docking.DockPanel, WeifenLuo.WinFormsUI.Docking.DockState)
   at MyApp.MainForm.OpenVisualSqlDesigner(Boolean, ToolkitUI.Model.Table)
   at MyApp.Commands.TableCommands.VisualDesignerCommand.Execute()
   at MyApp.Commands.CommandToolstripMenuItem.OnClick(System.EventArgs)
   at System.Windows.Forms.ToolStripItem.HandleClick(System.EventArgs)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(System.Windows.Forms.MouseEventArgs)
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(System.EventArgs, System.Windows.Forms.ToolStripItemEventType)
   at System.Windows.Forms.ToolStripItem.FireEvent(System.EventArgs, System.Windows.Forms.ToolStripItemEventType)
   at System.Windows.Forms.ToolStrip.OnMouseUp(System.Windows.Forms.MouseEventArgs)
   at System.Windows.Forms.Control.WmMouseUp(System.Windows.Forms.Message ByRef, System.Windows.Forms.MouseButtons, Int32)
   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.ToolStrip.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 System.Windows.Forms.Application.Run(System.Windows.Forms.Form)

Ответы [ 3 ]

1 голос
/ 16 января 2011

WIC, то, что вы видите в верхней части трассировки стека, является базовой библиотекой изображений для WPF. Это COM-компонент, написанный на C ++. не необычно для неуправляемого кода для бомбардировки с помощью AccessViolation. Вы могли бы извлечь дополнительную информацию из трассировки стека, включив отладку неуправляемого кода и включив Microsoft Symbol Server.

Тем не менее, шансы не поставить какую-либо вмятину в эту проблему. Единственными ручками, которые вы можете настроить, является само изображение, оно может быть повреждено таким образом, что делает код бомбой. И убедитесь, что на машине установлен пакет обновления 1. Кроме того, вам понадобится помощь службы поддержки Microsoft. Им понадобится мини-дамп программы сбоя и изображение, вызывающее проблему.

1 голос
/ 16 января 2011

Похоже, это исключение произошло, когда приложение пыталось создать BitmapImage. Может ли быть, что ваша система блокирует или блокирует доступ к определенному файлу, необходимому для загрузки изображения?

0 голосов
/ 17 января 2011

Большое спасибо - и очень полезно. Включение отладки неуправляемого кода привело меня к проблеме "Это указывает на то, что память повреждена в другом месте". Поскольку я не слишком задумывался о памяти, я знал, что это был один из внешних dll, на которые ссылались. Оказывается, корень проблемы - ICSharpCode.TextEditor.dll, и обновление до последней версии устранило ее !!!

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...