Bug 927 - smcs crashing mono runtime while compiling
Summary: smcs crashing mono runtime while compiling
Status: VERIFIED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 4.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: 6.4 (async)
Assignee: Bugzilla
URL:
: 926 ()
Depends on:
Blocks:
 
Reported: 2011-09-20 09:06 UTC by Nicklas Petersson
Modified: 2013-07-08 14:20 UTC (History)
5 users (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 Developer Community or GitHub 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:
VERIFIED FIXED

Comment 2 Sebastien Pouliot 2011-09-20 09:25:10 UTC
*** Bug 926 has been marked as a duplicate of this bug. ***
Comment 3 Sebastien Pouliot 2011-09-20 10:24:01 UTC
Thanks for the test case! I can duplicate the crash locally using it.
Comment 6 Sebastien Pouliot 2011-09-20 20:05:04 UTC
I got a (much) smaller repro case. Adding our compiler and SRE runtime exports on c.c.

$ cat 927.cs 
// note: it would works if 'A' was not a generic type
public abstract class A<T>  {

	private struct S {
	}
	
	private S? s;
}

$ /Developer/MonoTouch/usr/bin/smcs 927.cs -t:library
927.cs(6,20): warning CS0169: The private field `A<T>._originalValue' is never used
* Assertion at ../../../../../mono/mono/metadata/class.c:1738, condition `class->image->dynamic || field->offset > 0' not met

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 () <0x003bf>
  at Mono.CSharp.TypeContainer.CloseType () <0x0019b>
  at Mono.CSharp.ModuleContainer.CloseType () <0x00080>
  at Mono.CSharp.Driver.Compile () <0x0047e>
  at Mono.CSharp.Driver.Main (string[]) <0x000af>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_int_object (object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

	0   mono                                0x000d5242 0x0 + 873026
	1   mono                                0x00138490 0x0 + 1279120
	2   libSystem.B.dylib                   0x9197605b _sigtramp + 43
	3   ???                                 0xffffffff 0x0 + 4294967295
	4   libSystem.B.dylib                   0x91a035a5 raise + 26
	5   libSystem.B.dylib                   0x91a196e4 abort + 93
	6   mono                                0x002834b9 0x0 + 2634937
	7   mono                                0x0028352f 0x0 + 2635055
	8   mono                                0x0014b724 0x0 + 1357604
	9   mono                                0x0014aff6 0x0 + 1355766
	10  mono                                0x0015334e 0x0 + 1389390
	11  mono                                0x0014b0a3 0x0 + 1355939
	12  mono                                0x0014b227 0x0 + 1356327
	13  mono                                0x0021a7f4 0x0 + 2205684
	14  mono                                0x0021b900 0x0 + 2210048
	15  ???                                 0x02be7974 0x0 + 46037364
	16  ???                                 0x02be7088 0x0 + 46035080
	17  ???                                 0x02be69fc 0x0 + 46033404
	18  ???                                 0x02be66b9 0x0 + 46032569
	19  ???                                 0x012c8ee7 0x0 + 19697383
	20  ???                                 0x0062ada8 0x0 + 6466984
	21  ???                                 0x0062b1a6 0x0 + 6468006
	22  mono                                0x0000f27b 0x0 + 62075
	23  mono                                0x001ee832 0x0 + 2025522
	24  mono                                0x001f10ec 0x0 + 2035948
	25  mono                                0x001f047a 0x0 + 2032762
	26  mono                                0x000a5e02 0x0 + 679426
	27  mono                                0x000a6039 0x0 + 679993
	28  mono                                0x000a8158 0x0 + 688472
	29  mono                                0x00001f62 0x0 + 8034
	30  mono                                0x00001fc1 0x0 + 8129
	31  mono                                0x00001d41 0x0 + 7489

Debug info from gdb:

/tmp/mono-gdb-commands.dFkJZi:1: Error in sourced command file:
unable to debug self

=================================================================
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.
=================================================================

/Developer/MonoTouch/usr/bin/smcs: line 3: 52841 Abort trap              MONO_PATH=/Developer/MonoTouch/usr/lib/mono/2.1 /Developer/MonoTouch/usr/bin/mono /Developer/MonoTouch/usr/lib/mono/2.1/smcs.exe "$@"
Comment 8 Rolf Bjarne Kvinge [MSFT] 2011-11-29 07:38:26 UTC
I can not reproduce with mcs from 2.10.6, only using smcs from MonoTouch (which also reports itself as v2.10.6 btw).
Comment 10 Rolf Bjarne Kvinge [MSFT] 2013-06-24 18:41:11 UTC
This is fixed in any 6.3+ release.
Comment 11 Akhilesh kumar 2013-07-08 14:20:14 UTC
Today we have checked this issue on following builds :

XS 4.0.9 (build 15)
MT 6.3.7.177
Mono 3.0.12

Now we can able to Compile attached sample (attachment 444 [details]) successfully without any error.
 
Please suggest us if we have to check something else in this issue.

Closing this issue. Changing its status to verified.