In code I have to port from MS .NET to mono I observed several SIGILL crashes at points in code, where calls to external code are made within a try block followed by a finally but *without* a catch statement.

                try {
                        unrar.dosomething();
                        throw new Exception("test");
                }

                // no catch here

                finally
                {
                        unrar.close(); // calls unmanaged code
                        
                }

The unmanaged code called in unrar.dosomething() is C++ code compiled with exceptions enabled but it does not throw the exception, but the managed code that follows. The call to unrar.close() (which does not throw any exception) in the finally clause crashes with:

System.ExecutionEngineException: SIGILL
at (wrapper managed-to-native) NntpApp.nntp.rar.Unrar:RARCloseArchive (intptr)
  at NntpApp.nntp.rar.Unrar.Close () [0x00000]
at usenextapp.FilegroupPreview.ExtractFileFromRar (System.String path) [0x00000]

The SIGILL does not appear if I catch the exception and rethrow it in the finally clause

                Exception e=null;
                try {
                        unmanaged1();
                        throw new Exception("test");
                }

                catch(Exception ex)
                {
                        e= ex;
                }

                finally
                {
                        cleanup();
                        if (e!=null)
                                throw e;
                }

Any thoughts on that?

Christian Stümpel


_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Reply via email to