Bug 4184 - C# method optional argument is decimal type, C# compiler aborted.
Summary: C# method optional argument is decimal type, C# compiler aborted.
Status: RESOLVED FIXED
Alias: None
Product: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: unspecified
Hardware: All Linux
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2012-04-02 08:59 UTC by skyivben
Modified: 2012-04-03 03:54 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description skyivben 2012-04-02 08:59:49 UTC
Description of Problem:
C# method optional argument is decimal type, C# compiler aborted.

Steps to reproduce the problem:
1. $ cat Tester.cs:
static class Tester
{
  static void Main() { }
  static void Test(decimal value = 0) { }
}

2. $ /opt/mono-2.10.9/bin/dmcs Tester.cs

Actual Results:
we can't encode valuetypes, we should have never reached this line
Stacktrace:

  at (wrapper managed-to-native) System.Reflection.Emit.TypeBuilder.create_runtime_class (System.Reflection.Emit.TypeBuilder,System.Reflection.Emit.TypeBuilder) <0xffffffff>
  at System.Reflection.Emit.TypeBuilder.CreateType () <0x0043f>
  at Mono.CSharp.TypeContainer.CloseType () <0x001c3>
  at Mono.CSharp.ModuleContainer.CloseType () <0x00072>
  at Mono.CSharp.Driver.Compile () <0x00535>
  at Mono.CSharp.Driver.Main (string[]) <0x000c3>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_int_object (object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

        /opt/mono-2.10.9/bin/mono() [0x492121]
        /lib64/libpthread.so.0(+0xfd00) [0x7f011a116d00]
        /lib64/libc.so.6(gsignal+0x35) [0x7f0119dabd95]
        /lib64/libc.so.6(abort+0x17b) [0x7f0119dad2ab]
        /opt/mono-2.10.9/bin/mono() [0x5ca1ae]
        /opt/mono-2.10.9/bin/mono() [0x5ca26a]
        /opt/mono-2.10.9/bin/mono() [0x569ca9]
        /opt/mono-2.10.9/bin/mono() [0x570ddb]
        /opt/mono-2.10.9/bin/mono() [0x571794]
        /opt/mono-2.10.9/bin/mono() [0x57698e]
        /opt/mono-2.10.9/bin/mono() [0x58054f]
        [0x41fedcdc]

Debug info from gdb:


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

Aborted


Expected Results:
Compile finish.

How often does this happen? 
Always.

Additional Information:
OS: openSUSE 12.1
Comment 1 Marek Safar 2012-04-02 11:18:15 UTC
Already fixed in master and Mono 2.11
Comment 2 skyivben 2012-04-02 20:17:43 UTC
------------------------------------------
static class Tester
{
  static void Main() { }
  static void Test(decimal value = 0m) { }
}
------------------------------------------
This C# source file can comipled by dmcs.
Comment 3 skyivben 2012-04-02 20:50:31 UTC
Marek Safar: Already fixed in master and Mono 2.11
--------------------------------------------------
Thank you for your reply.
What is master?
Is this bug still in mono 2.10.6, 2.10.8 and 2.10.9 ?
I'm sorry for my bad English.
Comment 4 Marek Safar 2012-04-03 03:28:15 UTC
master is the latest mono code from github.

Mono 2.10.* has not been fixed. Upgrade to Mono 2.11
Comment 5 skyivben 2012-04-03 03:54:35 UTC
Reply to Marek Safar:
Thank you very much.