LogicAndTrick / sledge

An open source alternative to Valve's Hammer Editor for the Goldsource engine. (No longer in development)
https://logicandtrick.github.io/sledge/
BSD 3-Clause "New" or "Revised" License
302 stars 84 forks source link

Crash due to AccessViolationException #227

Closed fnky closed 8 years ago

fnky commented 8 years ago

Bug

Using Sledge Editor 0.1.0.28 - The application crashes due to the exception System.AccessViolationException being thrown. This is thrown upon creating a new file.

I have also tried to run the program as administrator, but didn't work either.

Configuration

I used ZHLT 3.0 build tools and copied Half-Life (GoldSrc) game files from Steam installation (wads, sprites & models) without the game executable (as I debug on my host machine).

System Information

Microsoft Windows 10 Pro (64-bit)
Version 10.0.10586 Build 10586
Intel(R) Core(TM) i7-4750HQ CPU @ 2.00GHz, 1995 Mhz, 1 Core(s), 1 Logical Processor(s)

Note: Running on VirtualBox.

Error Log

.NET Runtime
Application: Sledge.Editor.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
   at OpenTK.Graphics.OpenGL.GL.GenBuffers(Int32, Int32 ByRef)
   at Sledge.Graphics.Arrays.VBO`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[Sledge.Editor.Rendering.Arrays.MapObjectVertex, Sledge.Editor, Version=0.1.0.28, Culture=neutral, PublicKeyToken=null]].Commit()
   at Sledge.Graphics.Arrays.VBO`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[Sledge.Editor.Rendering.Arrays.MapObjectVertex, Sledge.Editor, Version=0.1.0.28, Culture=neutral, PublicKeyToken=null]].Update(System.Collections.Generic.IEnumerable`1<System.__Canon>)
   at Sledge.Graphics.Arrays.VBO`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[Sledge.Editor.Rendering.Arrays.MapObjectVertex, Sledge.Editor, Version=0.1.0.28, Culture=neutral, PublicKeyToken=null]]..ctor(System.Collections.Generic.IEnumerable`1<System.__Canon>)
   at Sledge.Editor.Rendering.Renderers.ModernRenderer..ctor(Sledge.Editor.Documents.Document)
   at Sledge.Editor.Rendering.RenderManager..ctor(Sledge.Editor.Documents.Document)
   at Sledge.Editor.Documents.Document..ctor(System.String, Sledge.DataStructures.MapObjects.Map, Sledge.Settings.Models.Game)
   at Sledge.Editor.Editor.FileNew()

Exception Info: System.Reflection.TargetInvocationException
   at System.RuntimeMethodHandle.InvokeMethod(System.Object, System.Object[], System.Signature, Boolean)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(System.Object, System.Object[], System.Object[])
   at System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
   at Sledge.Common.Mediator.Mediator.ExecuteDefault(System.Object, System.String, System.Object)
   at Sledge.Editor.Editor.Notify(System.String, System.Object)

Exception Info: System.Reflection.TargetInvocationException
   at System.RuntimeMethodHandle.InvokeMethod(System.Object, System.Object[], System.Signature, Boolean)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(System.Object, System.Object[], System.Object[])
   at System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
   at Sledge.Common.Mediator.Mediator.Publish(System.String, System.Object)
   at Sledge.Editor.Menu.UpdatingToolStripMenuItem.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.ToolStripDropDown.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.ToolStripDropDown.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 Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(System.String[])
   at Sledge.Editor.SingleInstance.Start(System.Type)
   at Sledge.Editor.Program.Main()
Application Error
Faulting application name: Sledge.Editor.exe, version: 0.1.0.28, time stamp: 0x53d4afb2
Faulting module name: KERNELBASE.dll, version: 10.0.10586.0, time stamp: 0x5632da1c
Exception code: 0xe0434352
Fault offset: 0x000bd8a8
Faulting process ID: 0x1334
Faulting application start time: 0x01d159a5deb9702c
Faulting application path: C:\Program Files (x86)\Sledge Editor\Sledge.Editor.exe
Faulting module path: C:\Windows\SYSTEM32\KERNELBASE.dll
Report ID: 2db0355b-8d33-4c7e-84f6-ff5b69b90860
Faulting package full name: 
Faulting package-relative application ID: 
Windows Error Report
Fault bucket 94576025281, type 5
Event Name: CLR20r3
Response: Not available
Cab Id: 0

Problem signature:
P1: Sledge.Editor.exe
P2: 0.1.0.28
P3: 53d4afb2
P4: OpenTK
P5: 1.1.1475.5656
P6: 52d68b14
P7: 1153
P8: 0
P9: System.AccessViolationException
P10: 

Attached files:
C:\Users\cp\AppData\Local\Temp\WER98E.tmp.WERInternalMetadata.xml
C:\Users\cp\AppData\Local\Temp\WERF9A.tmp.appcompat.txt

These files may be available here:
C:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppCrash_Sledge.Editor.ex_969ba18ba7d023c27e2ba05ee83259c1936faeee_3d899fde_04370fd7

Analysis symbol: 
Rechecking for solution: 0
Report ID: 2db0355b-8d33-4c7e-84f6-ff5b69b90860
Report Status: 1
Hashed bucket: 6a015e5299fff755183f9bb0049a3c65

Reproduction

I do not know how to reproduce this problem. However, I run my system on VirtualBox and started a configuration with files referenced to Shared Folder over Network. I later moved the files to disk and reconfigurate, without luck.

LogicAndTrick commented 8 years ago

Thanks for the detailed bug report. This sort of thing is sometimes caused by the specific version of OpenGL not being supported. Try changing the renderer back down to the OpenGL 1 API in the settings. If that doesn't work, my guess would be that the VirtualBox GPU doesn't support the correct API to run the renderer.

Screenshot of renderer setting

fnky commented 8 years ago

The worked, thanks! I was about to figure out VirtualBox GPU settings and the renderer, just flew by me at some point. Keep up the great work :+1:

LogicAndTrick commented 8 years ago

Great! GPU support is one of the most difficult things to debug, so I'm glad that fixed the issue!