the Fiddler's picture

Multiple GLControls sample shutdown fails with KeyNotFoundException in rev 2209

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

The exception is generated in GraphicsContext.cs:202 and is potentially the result of the new, internal GraphicsContextBase class.

This occurs on Linux amd64 with Nvidia drivers. Can someone please test whether this also occurs on Windows (or any other Linux configuration?)


Comments

Comment viewing options

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

#1

I can test on Seven x86 and Vista x64

On Seven x86

Launching sample: "Multiple GLControls"
 
Detected configuration: Windows / .Net
DisplayDevice 0 (primary) supports 198 resolutions.
DisplayDevice 1 (secondary) supports 213 resolutions.
Creating default GraphicsMode (32, 16, 0, 0, 0, 2, False).
Creating GraphicsContext.
Loaded opengl32.dll: 1624178688
OpenGL will be bound to handle: 4918812
Setting pixel format... Device context: -1778309041
Selecting pixel format... 11
Creating temporary context for wgl extensions.
Load extensions for OpenTK.Platform.Windows.Wgl... 61 extensions loaded in 18 ms.
Load extensions for OpenTK.Platform.Windows.Wgl... 61 extensions loaded in 1 ms.
Falling back to GL2... success! (id: 131072)
Selecting pixel format (ARB)... success!
GraphicsMode: Index: 8, Color: 32 (8888), Depth: 24, Stencil: 0, Samples: 0, Accum: 64 (16161616), Buffers: 2, Stereo: False
IWindowInfo: Windows.WindowInfo: Handle 13763306, Parent (null)
GraphicsContextFlags: Default
Requested version: 1.0
OpenGL will be bound to handle: 13763306
Setting pixel format... 8
Falling back to GL2... success! (id: 196608)
Load extensions for OpenTK.Platform.Windows.Wgl... 61 extensions loaded in 2 ms.
Load extensions for OpenTK.Graphics.OpenGL.GL... 1900 extensions loaded in 308 ms.
[Warning] OpenGL context 196608 leaked. Did you forget to call IGraphicsContext.Dispose()?
[Warning] Failed to release device context -1778309041. Windows error: 0.
System.Reflection.TargetInvocationException: Une exception a été levée par la cible d'un appel. ---> System.NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.
   à OpenTK.GLControl.MakeCurrent() dans D:\Dev\opentk\Source\GLControl\GLControl.cs:ligne 211
   à Examples.WinForms.DerivedGLControl.set_ClearColor(Color value) dans D:\Dev\opentk\Source\Examples\OpenTK\GLControl\DerivedGLControl.cs:ligne 32
   à Examples.WinForms.MultipleGLControlsForm.InitializeComponent() dans D:\Dev\opentk\Source\Examples\OpenTK\GLControl\MultipleGLControls.Designer.cs:ligne 38
   à Examples.WinForms.MultipleGLControlsForm..ctor() dans D:\Dev\opentk\Source\Examples\OpenTK\GLControl\MultipleGLControls.cs:ligne 19
   à Examples.WinForms.MultipleGLControlsForm.Main() dans D:\Dev\opentk\Source\Examples\OpenTK\GLControl\MultipleGLControls.cs:ligne 24
   --- Fin de la trace de la pile d'exception interne ---
   à System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   à System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   à System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   à System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   à System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   à Examples.ExampleBrowser.RunSample(Control parent, ExampleInfo e) dans D:\Dev\opentk\Source\Examples\ExampleBrowser.cs:ligne 335
the Fiddler's picture

#2

Edit: thanks, will investigate.

the Fiddler's picture

#3

Status:open» confirmed
iliak's picture

#4

Works better :

Launching sample: "Multiple GLControls"
 
Creating GraphicsContext.
GraphicsMode: Index: 8, Color: 32 (8888), Depth: 24, Stencil: 0, Samples: 0, Accum: 64 (16161616), Buffers: 2, Stereo: False
IWindowInfo: Windows.WindowInfo: Handle 18088728, Parent (null)
GraphicsContextFlags: Default
Requested version: 1.0
OpenGL will be bound to handle: 18088728
Setting pixel format... 8
Falling back to GL2... success! (id: 262144)
Load extensions for OpenTK.Platform.Windows.Wgl... 61 extensions loaded in 5 ms.
Load extensions for OpenTK.Graphics.OpenGL.GL... 1900 extensions loaded in 40 ms.
Creating GraphicsContext.
GraphicsMode: Index: 8, Color: 32 (8888), Depth: 24, Stencil: 0, Samples: 0, Accum: 64 (16161616), Buffers: 2, Stereo: False
IWindowInfo: Windows.WindowInfo: Handle 16843570, Parent (null)
GraphicsContextFlags: Default
Requested version: 1.0
OpenGL will be bound to handle: 16843570
Setting pixel format... 8
Falling back to GL2... success! (id: 131073)
Sharing state with context OpenTK.Graphics.GraphicsContext
Load extensions for OpenTK.Platform.Windows.Wgl... 61 extensions loaded in 4 ms.
Load extensions for OpenTK.Graphics.OpenGL.GL... 1900 extensions loaded in 38 ms.
Disposing context 131073.
Disposing context 262144.
iliak's picture

#5

OpenGL extension sample broken :

Launching sample: "OpenGL Extensions"
 
System.Reflection.TargetInvocationException: Une exception a été levée par la cible d'un appel. ---> OpenTK.Graphics.GraphicsContextMissingException: No context is current in the calling thread (ThreadId: 9).
   à OpenTK.Graphics.OpenGL.ErrorHelper..ctor(IGraphicsContext context) dans D:\Dev\opentk\Source\OpenTK\Graphics\OpenGL\ErrorHelper.cs:ligne 61
   à OpenTK.Graphics.OpenGL.GL.GetString(StringName name) dans D:\Dev\opentk\Source\OpenTK\Graphics\OpenGL\GL.cs:ligne 49832
   à Examples.WinForms.Extensions.StartAsync(Object sender, EventArgs e) dans D:\Dev\opentk\Source\Examples\OpenTK\Test\Extensions.cs:ligne 61
   à System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
   à System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
   à System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   à System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   à System.Windows.Forms.Application.RunDialog(Form form)
   à System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   à System.Windows.Forms.Form.ShowDialog()
   à Examples.WinForms.Extensions.Main() dans D:\Dev\opentk\Source\Examples\OpenTK\Test\Extensions.cs:ligne 161
   --- Fin de la trace de la pile d'exception interne ---
   à System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   à System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   à System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   à System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   à System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   à Examples.ExampleBrowser.RunSample(Control parent, ExampleInfo e) dans D:\Dev\opentk\Source\Examples\ExampleBrowser.cs:ligne 335
the Fiddler's picture

#6

Thanks for testing.

SVN trunk is stricter when testing for the existence of GraphicsContext (which is probably the cause of the last error). It also contains a number of internal changes that reduce code duplication, which seem to have caused a number of regressions.

Will investigate.

the Fiddler's picture

#7

Status:confirmed» fixed

This should be finally fixed in rev. 2415.

the Fiddler's picture

#8

Version:0.9.x-dev» 1.0-beta-1
Status:fixed» closed

Closing issues fixed in 1.0 beta-1.