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

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


Attachments

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

Stacktrace:

  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.

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.


Create a new report for Bug 25690 on Developer Community or GitHub if you have new information to add and do not yet see a matching report.

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments


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.

Related Links: