Bug 25690 - * Assertion: should not be reached at icall.c:1902
Summary: * Assertion: should not be reached at icall.c:1902
Alias: None
Product: Runtime
Classification: Mono
Component: Reflection ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-01-03 03:38 UTC by Marek Safar
Modified: 2015-01-03 06:48 UTC (History)
2 users (show)

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:

Description Marek Safar 2015-01-03 03:38:30 UTC
using System;
using System.Threading;
using System.Reflection;
using System.Reflection.Emit;
using System.IO;

namespace cons234234324

	class MainClass
		public static void Main(string[] args)
			var assembly = Thread.GetDomain ().DefineDynamicAssembly (new AssemblyName ("ASSEMBLY_NAME"), AssemblyBuilderAccess.RunAndSave, Path.GetTempPath ());
			var module = assembly.DefineDynamicModule ("Instance.exe");
			EnumBuilder enumBuilder = module.DefineEnum ("gggg",
				TypeAttributes.Public, typeof(int));
			enumBuilder.DefineLiteral ("TF", 4);

			enumBuilder.CreateType ();

			var fields = enumBuilder.GetFields (BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);

			for (int i = 0; i < fields.Length; ++i) {
				var m = fields[i].GetRawConstantValue ();

			var n0 = enumBuilder.GetEnumName (4);

When run mono fails with

* Assertion: should not be reached at icall.c:1902


  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Reflection.MonoField.GetRawConstantValue (System.Reflection.MonoField) <IL 0x0002d, 0xffffffff>
  at cons234234324.MainClass.Main (string[]) [0x0006e] in /Users/marek/Projects/c2/c2/Program.cs:25
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <IL 0x00050, 0xffffffff>
Comment 1 Zoltan Varga 2015-01-03 06:48:42 UTC
Fixed in master.