[Mono-bugs] [Bug 42405][Nor] New - mcs silently crashes when not using block brackets in an empty method
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
Mon, 5 May 2003 18:26:31 -0400 (EDT)
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by awuest@swissonline.ch.
http://bugzilla.ximian.com/show_bug.cgi?id=42405
--- shadow/42405 Mon May 5 18:26:31 2003
+++ shadow/42405.tmp.15153 Mon May 5 18:26:31 2003
@@ -0,0 +1,85 @@
+Bug#: 42405
+Product: Mono/MCS
+Version: unspecified
+OS: other
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: Misc
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: awuest@swissonline.ch
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: mcs silently crashes when not using block brackets in an empty method
+
+Description of Problem:
+
+mcs 0.23 crashes without further problem report or failure message, when
+one does not use "{}" (empty!) after an empty method, instead of just an
+";". I think it is best to look at the code I provided to understand what I
+mean. Normally, you do not need empty methods, but if, for instance, you
+only want to call the base class constructor in a derived class, but not
+want to do anything else in the constructor of the derived class, an empty
+method would be enough, but, you have to provide a "{}" just that the
+compiler gets it right, which is not that nice. But even less nicer is,
+that mcs just silently crashes, without sporting any failure information,
+or on which line the problem is located. It just terminates without
+saying "compilation succeeded".
+
+To make it clear: this bug is not restricted to base class calls, but
+mainly seems to appear everywhere, where no empty brackets ({}) but only a
+";" is used after the method signature (of course I am not talking about
+things like delegates and so on here).
+
+As I have already wrote in a similar report, it is extremely difficult to
+find such a bug in a large program (and as before, I had to remove
+step-by-step every single class or its content until reaching the culprit
+itself, which made a lot of failed
+recompiles again..)
+
+Steps to reproduce the problem:
+1. Compile
+
+abstract public class View {
+ public View(object connectToModel) {
+ // here would be some sensible code of course
+ }
+}
+
+public class BinaryView:View {
+
+ // does not work
+ public BinaryView(object connectToModel):base(connectToModel);
+
+ // does work
+ // public BinaryView(object connectToModel):base(connectToModel) {}
+}
+
+public class Controller {
+ public static void Main() {}
+}
+
+
+Actual Results:
+
+mcs plainly terminates without further notice, i.e. it does not report any
+line number or similar, nor throws a segfault or some other system failure.
+
+
+Expected Results:
+
+compilation succeeded
+
+
+How often does this happen?
+
+everytime
+
+
+Additional Information:
+
+none