Jablo's picture

GetInteger( GetPName.PolygonMode, out iPolygonMode ); crashes

Using single int with out destroys the stack on following sample code:

int iPolygonMode;
GL.GetInteger( GetPName.PolygonMode, out iPolygonMode );
bool boFillMode = (((PolygonMode)iPolygonMode[0]) == PolygonMode.Fill);

This works fine:

int[] iPolygonMode = new int[1];
GL.GetInteger( GetPName.PolygonMode, iPolygonMode );
bool boFillMode = (((PolygonMode)iPolygonMode[0]) == PolygonMode.Fill);

Version 0.9.9-3 used.
There has been similar issues already.
May this is a bug too?


Comment viewing options

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

This could be a bug, yes. Please create an issue report with some more information on the crash: OS and processor (x86 or amd64?) as well as the exception text and stacktrace.

Edit: for the record, I haven't been able to reproduce this issue. The following code executes correctly here (Ubuntu 9.10, amd64, Mono 2.4.3, nvidia drivers):

                int m1;
                int[] m2 = new int[1];
                GL.GetInteger(GetPName.PolygonMode, out m1);
                GL.GetInteger(GetPName.PolygonMode, m2);
                if (m1 != m2[0])
                    throw new Exception();

If possible, please attach a small test case that reproduces the issue.

Edit 2: don't forget to mention which runtime and runtime version you are using! I have been using single out parameters for more than a year on both Mono and .Net, so this might manifest only under specific runtime versions.