Bug 318904 (MONO76002) - Assertion failure in reflection.c : line 835 (method_encode_clauses) while running Boo compiler
Summary: Assertion failure in reflection.c : line 835 (method_encode_clauses) while ru...
Status: RESOLVED MOVED
Alias: MONO76002
Product: Mono: Runtime
Classification: Mono
Component: misc (show other bugs)
Version: 1.1
Hardware: Other All
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Mono Bugs
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-07 02:59 UTC by Brion Vibber
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Short C# program using System.Reflection.Emit to reproduce the problem case (761 bytes, text/plain)
2005-09-07 03:35 UTC, Thomas Wiest
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 19:29:37 UTC


---- Reported by brion@pobox.com 2005-09-06 19:59:43 MST ----

Description of Problem:
I've found that when compiling a certain code fragment with the Boo 
compiler or interpreter, an internal assertion in the Mono runtime fails 
and crashes the compiler. This can cause MonoDevelop to crash/hang if 
compiling within the IDE.


Steps to reproduce the problem:
1. Fetch and untar the Boo 0.6 binary release:
http://dist.codehaus.org/boo/distributions/boo-0.6.0.1858.tar.gz
2. cd bin; mono booish.exe
3. Type into the interpreter (second line should be indented, third blank; 
chars at line start are the interpreter prompt):
>>> try:
...     print "foo"
... 


Actual Results:
** ERROR **: file reflection.c: line 835 (method_encode_clauses): assertion 
failed: (ex_info->handlers)
aborting...
Abort trap


Expected Results:
The runtime should not crash, and Boo should report a syntax error like 
this:
ERROR: Internal compiler error: Incorrect code generation for exception 
block.


How often does this happen? 
Every time.


Additional Information:
Tested with Mono from current SVN on Ubuntu Linux (Hoary/x86) and the 1.1.8 
packages on Mac OS X 10.4.2 and Windows XP SP2 with same results.

.NET 1.1 runtime on Windows XP SP2 runs correctly.



---- Additional Comments From brion@pobox.com 2005-09-06 20:35:41 MST ----

Created an attachment (id=168471)
Short C# program using System.Reflection.Emit to reproduce the problem case




---- Additional Comments From brion@pobox.com 2005-09-06 20:41:34 MST ----

Attached C# program reproduces the problem: it attempts to emit an 
exception block without any catch blocks in it. On Mono this produces 
the assertion failure reported above.

On .NET 1.1 this throws an exception:
Unhandled Exception: System.InvalidOperationException: Incorrect code 
generation for exception block.
   at System.Reflection.Emit.ILGenerator.EndExceptionBlock()
   at ReflectionCrasher.Main()

MSDN docs for ILGenerator.EndExceptionBlock indicate it should throw 
this exception if "the end exception block occurs in an unexpected 
place in the code stream":
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/
cpref/html/frlrfSystemReflectionEmitILGeneratorMethodsTopic.asp

An exception can be caught by a compiler and an internal error 
reported, but the assertion just kills the runtime immediately.




---- Additional Comments From vargaz@gmail.com 2005-09-07 08:21:35 MST ----

The Boo compiler should detect semantic errors like this instead of
depending on the runtime to do it.


*** This bug has been marked as a duplicate of https://bugzilla.novell.com/show_bug.cgi?id=MONO74923 ***

Imported an attachment (id=168471)

This bug was marked DUPLICATE in the database it was moved from.
    Changing resolution to "MOVED"