flopoloco's picture

[GameWindow] GameWindow constructor may throw AccessViolationException

Project:The Open Toolkit library
Version:0.9.9-0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hello guys, sometimes OpenTK works fine, but sometimes crashes (the constructor of the base GameWindow class). It happens often... I can't know for sure if there's a problem with my system or OpenTK. Anyway I find it a good idea to report this issue so you will have the ability examine it.

Here's the debuglog from OpenTK's QuickStart solution (works fine):

Quote:

Detected configuration: Windows / .Net
DisplayDevice 0 (primary) supports 294 resolutions.
Creating default GraphicsMode (32, 16, 0, 0, 0, 2, False).
Device context: 33627324
Selecting pixel format... Native window driver: OpenTK.Platform.Windows.WinGLNative
Creating native window.
Initalizing WMInput driver.
Input window attached to parent Windows.WindowInfo: Handle 527036, Parent (null)
Window created: Windows.WindowInfo: Handle 527036, Parent (null)
Window creation succesful.
Creating GraphicsContext.
GraphicsMode: Index: 8, Color: 32 (8888), Depth: 24, Stencil: False, Samples: 0, Accum: 64 (16161616), Buffers: 2, Stereo: False
IWindowInfo: Windows.WindowInfo: Handle 527036, Parent (null)
Loaded opengl32.dll: 1502281728
OpenGL will be bound to handle: 527036
Setting pixel format... 8
Creating temporary context for wgl extensions.
Load extensions for OpenTK.Platform.Windows.Wgl... 50 extensions loaded in 9 ms.
Using WGL_ARB_create_context... success!
success! (id: 131072)
Load extensions for OpenTK.Platform.Windows.Wgl... 50 extensions loaded in 1 ms.
Load extensions for OpenTK.Graphics.GL... 1416 extensions loaded in 159 ms.
Load extensions for OpenTK.Graphics.Glu... 58 extensions loaded in 6 ms.
Window 527036 title changed to OpenTK Quick Start Sample.
Firing internal load event.
Firing internal resize event: New size: 800x600.
OpenGL driver information: GeForce GTX 295/PCI/SSE2, NVIDIA Corporation, 2.1.2
Entering main loop.

Here's the debuglog from my application (crashes):

Quote:

Detected configuration: Windows / .Net
DisplayDevice 0 (primary) supports 294 resolutions.
Creating default GraphicsMode (32, 16, 0, 0, 0, 2, False).
Device context: -587130630
Selecting pixel format... Native window driver: OpenTK.Platform.Windows.WinGLNative
Creating native window.
Initalizing WMInput driver.
Input window attached to parent Windows.WindowInfo: Handle 1967404, Parent (null)
Window created: Windows.WindowInfo: Handle 1967404, Parent (null)
Window creation succesful.
Creating GraphicsContext.
GraphicsMode: Index: 8, Color: 32 (8888), Depth: 24, Stencil: False, Samples: 0, Accum: 64 (16161616), Buffers: 2, Stereo: False
IWindowInfo: Windows.WindowInfo: Handle 1967404, Parent (null)
Loaded opengl32.dll: 1605632000
OpenGL will be bound to handle: 1967404
Setting pixel format... 8
Creating temporary context for wgl extensions.
Load extensions for OpenTK.Platform.Windows.Wgl... 50 extensions loaded in 9 ms.
Using WGL_ARB_create_context... success!
success! (id: 131072)
Load extensions for OpenTK.Platform.Windows.Wgl... 50 extensions loaded in 1 ms.
Load extensions for OpenTK.Graphics.GL... 1416 extensions loaded in 166 ms.
Load extensions for OpenTK.Graphics.Glu... 58 extensions loaded in 6 ms.
Window 1967404 title changed to OpenTK Game Window.
[Warning] OpenGL context 131072 leaked. Did you forget to call IGraphicsContext.Dispose()?

Here's also the SharpDevelop exception:

Quote:

SharpDevelop Version : 3.1.0.4077
.NET Version : 2.0.50727.4913
OS Version : Microsoft Windows NT 6.1.7068.0
Current culture : Greek (Greece) (el-GR)
Current UI language : en-US
Working Set Memory : 257836kb
GC Heap Memory : 92029kb

Exception thrown:
System.Runtime.InteropServices.COMException (0x80131301): Process was terminated. (Exception from HRESULT: 0x80131301)
at Debugger.Interop.CorDebug.ICorDebugProcess.Stop(UInt32 dwTimeoutIgnored)
at Debugger.Process.AsyncTerminate()
at Debugger.Process.Terminate()
at ICSharpCode.SharpDevelop.Services.WindowsDebugger.Stop()
at ICSharpCode.SharpDevelop.Project.Commands.StopDebuggingCommand.Run()
at ICSharpCode.Core.WinForms.ToolBarCommand.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.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)

---- Recent log messages:
14:55:48.588 [1] DEBUG - Debugger: Callback: LogMessage
14:55:48.588 [1] DEBUG - Debugger: Debugger event: OnLogMessage
14:55:48.588 [1] DEBUG - Debugger: Callback: LogMessage
14:55:48.588 [1] DEBUG - Debugger: Debugger event: OnLogMessage
14:55:48.596 [1] DEBUG - Debugger: Callback: LogMessage
14:55:48.596 [1] DEBUG - Debugger: Debugger event: OnLogMessage
14:55:48.598 [1] DEBUG - Debugger: Callback: LogMessage
14:55:48.598 [1] DEBUG - Debugger: Debugger event: OnLogMessage
14:55:48.611 [1] DEBUG - Debugger: Callback: LogMessage
14:55:48.611 [1] DEBUG - Debugger: Debugger event: OnLogMessage
14:55:48.773 [1] DEBUG - Debugger: Callback: LogMessage
14:55:48.773 [1] DEBUG - Debugger: Debugger event: OnLogMessage
14:55:48.774 [1] DEBUG - Debugger: Callback: LogMessage
14:55:48.774 [1] DEBUG - Debugger: Debugger event: OnLogMessage
14:55:48.781 [1] DEBUG - Debugger: Callback: LogMessage
14:55:48.781 [1] DEBUG - Debugger: Debugger event: OnLogMessage
14:55:48.787 [1] DEBUG - Debugger: Callback: LogMessage
14:55:48.787 [1] DEBUG - Debugger: Debugger event: OnLogMessage
14:55:48.789 [1] DEBUG - Debugger: Callback: CreateThread 6068
14:55:48.791 [1] DEBUG - Debugger: Callback: LogMessage
14:55:48.791 [1] DEBUG - Debugger: Debugger event: OnLogMessage
14:55:55.561 [1] DEBUG - ActiveContentChanged to ICSharpCode.SharpDevelop.Gui.CompilerMessageView
14:56:00.196 [1] INFO - Run command ICSharpCode.SharpDevelop.Project.Commands.StopDebuggingCommand
14:56:00.196 [1] INFO - Debugger Command: Stop
14:56:25.191 [1] ERROR - ThreadException caught
--> Exception:
System.Runtime.InteropServices.COMException (0x80131301): Process was terminated. (Exception from HRESULT: 0x80131301)
at Debugger.Interop.CorDebug.ICorDebugProcess.Stop(UInt32 dwTimeoutIgnored)
at Debugger.Process.AsyncTerminate()
at Debugger.Process.Terminate()
at ICSharpCode.SharpDevelop.Services.WindowsDebugger.Stop()
at ICSharpCode.SharpDevelop.Project.Commands.StopDebuggingCommand.Run()
at ICSharpCode.Core.WinForms.ToolBarCommand.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.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)

---- Post-error application state information:
Installed 3rd party AddIns:
Workbench.ActiveContent: ICSharpCode.SharpDevelop.Gui.CompilerMessageView
ProjectService.OpenSolution: [Solution: FileName=C:\Users\drag\Documents\SharpDevelop Projects\OpenTKDraw\OpenTKDraw.sln, HasProjects=True, ReadOnly=False]
ProjectService.CurrentProject: [CSharpProject: OpenTKDraw]

My system is:
- nVidia GTX295 (latest drivers)
- Windows 7 beta (build 7068)


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

#1

Thanks for the detailed bug report! This is a known issue with an unknown cause. It only happens on Nvidia drivers (not Ati, Intel, Mesa3d or VirtualBox).

If you are feeling adventurous, there is a chance that this is fixed in SVN trunk (just make sure you have a backup of your code, in case you need to rollback to 0.9.8 - trunk is very much a WIP at this time.)

the Fiddler's picture

#2

Status:open» confirmed
Inertia's picture

#3

Status:confirmed» open

Not sure if this is related, but the log from the crash requests a 64-Bit Accumulation buffer. Does the problem still occur when using a 32-Bit accumulation buffer?

the Fiddler's picture

#4

That's a quirk of the nvidia driver: OpenTK does not request any accumulation buffer, but the driver returns a mode with a 64-bit buffer. My only explanation is that this is for some obscure compatibility reasons, i.e. don't read too much into this result.

the Fiddler's picture

#5

Title:Problem in GameWindow constructor method (opentk-0.9.8)» [GameWindow] GameWindow constructor may throw AccessViolationException

Can anyone confirm this behavior still exists in 0.9.9-0?

the Fiddler's picture

#6

Status:open» closed

I cannot reproduce this issue with 0.9.9-0+ and Nvidia drivers from the 180.xx, 185.xx or 190.xx series. If encounter this, please reopen this issue.

the Fiddler's picture

#7

Version:0.9.8» 0.9.9-0