[Mono-bugs] [Bug 555006] New: If the code catches exception during type ctor causes crash

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Nov 12 13:54:59 EST 2009


http://bugzilla.novell.com/show_bug.cgi?id=555006


           Summary: If the code catches exception during type ctor causes
                    crash
    Classification: Mono
           Product: Mono: Runtime
           Version: 2.4.x
          Platform: 64bit
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: interop
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: zahirtezcan at yahoo.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Created an attachment (id=327218)
 --> (http://bugzilla.novell.com/attachment.cgi?id=327218)
Can be used to run whether crash occurs or not

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5)
Gecko/20091106 Shiretoko/3.5.5

I am using OpenTK library for 3D rendering interop. By 0.9.x releases they
decided to support EGL libraries. But, since this library is for embedded
development i dont use it. 
During initialization of OpenTK (like creating a GameWindow) it checks whether
EGL is supported or not. This is done via a proxy class (i.e Egl) for interop.
It has several functions with DllImport attribute. The support check call is
done via Egl.IsSupported property. This property tries to get the current
context by a call to GetCurrentContext. If no exception occurs it counts as
supported and returns true. Else it catches the exception and returns false. 
In windows with visual studio 2008 this is no problem. But with mono this
regularly crashes.

Reproducible: Always

Steps to Reproduce:
1.Compile the attached file with latest opentk version (www.opentk.com)
2.run it
3.it is supposed to crash
Actual Results:  
Module loaded: texturebuffer, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null.
Module loaded: OpenTK, Version=0.9.9.3, Culture=neutral,
PublicKeyToken=bad199fe84eb3df4.
Module loaded: System, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089.
Module loaded: System.Drawing, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a.

Module loaded: System.Configuration, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a.
Module loaded: System.Xml, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089.
Stacktrace:

  at OpenTK.Platform.Egl.Egl.get_IsSupported () <0xffffffff>
  at OpenTK.Platform.Egl.Egl.get_IsSupported () <0x00014>
  at OpenTK.Platform.Factory..cctor () <0x00117>
  at (wrapper runtime-invoke) object.runtime_invoke_void
(object,intptr,intptr,intptr) <0xffffffff>
  at OpenTK.Graphics.GraphicsMode..cctor () <0xffffffff>
  at OpenTK.Graphics.GraphicsMode..cctor () <0x00038>
  at (wrapper runtime-invoke) object.runtime_invoke_void
(object,intptr,intptr,intptr) <0xffffffff>
  at OpenTK.GameWindow..ctor () <0xffffffff>
  at OpenTK.GameWindow..ctor () <0x0002c>
  at texturebuffer.MyWindow..ctor () [0x00000] in
/home/xahir/projects/texturebuffer/texturebuffer/Program.cs:1
  at texturebuffer.Program.Main (string[]) [0x00000] in
/home/xahir/projects/texturebuffer/texturebuffer/Program.cs:1
  at (wrapper runtime-invoke) texturebuffer.Program.runtime_invoke_void_object
(object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

    /usr/bin/mono() [0x47acaf]
    /usr/bin/mono() [0x4acfff]
    /lib/libpthread.so.0(+0xee80) [0x7fd96ef58e80]
    /usr/bin/mono() [0x48c2f2]
    /usr/bin/mono() [0x48c6d9]
    /usr/bin/mono() [0x48c93f]
    /usr/bin/mono() [0x4941a6]
    /usr/bin/mono() [0x4292d7]
    /usr/bin/mono() [0x442296]
    /usr/bin/mono() [0x41d31f]
    /usr/bin/mono() [0x41ea17]
    /usr/bin/mono() [0x41e803]
    /usr/bin/mono() [0x4819ed]
    [0x41fe6168]

=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================


Thread 3 exited.

Thread 2 exited.

Thread 1 exited.

Process 1 exited.

Target exited.

Expected Results:  
A window with bluish color to open

I have tested with OpenTK version 0.9.9-3 and 1.0 beta both of them crashes. I
tried to reproduce such case with static constructors but no success. I have
both monodevelop 2.0 and monodevelop 2.2 RC(svn checkout), and both neither of
them helps.

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list