Bug 125 - Failed assertion in reflection.c: condition `tb->generic_params' not met
Summary: Failed assertion in reflection.c: condition `tb->generic_params' not met
Alias: None
Product: Android
Classification: Xamarin
Component: Mono runtime / AOT Compiler ()
Version: 1.0
Hardware: PC Windows
: Normal critical
Target Milestone: ---
Assignee: Marek Habersack
Depends on:
Reported: 2011-07-31 14:58 UTC by Greg Shackles
Modified: 2014-04-30 14:48 UTC (History)
7 users (show)

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

repro project (549.08 KB, application/octet-stream)
2011-07-31 14:58 UTC, Greg Shackles
logcat output (3.69 KB, text/plain)
2011-07-31 14:58 UTC, Greg Shackles

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:

Description Greg Shackles 2011-07-31 14:58:21 UTC
Created attachment 42 [details]
repro project

In my app I have a version of the Mono C# compiler service ported to Android which generally works well, but I ran into a problem when trying to create new objects using classes I had just defined through the evaluator where the app will crash. The runtime error is:

F/mono    (  410): * Assertion at ../../../../mono/metadata/reflection.c:2672, condition `tb->generic_params' not met

It's possible there's a problem in the Android port of the compiler service, but I'm also guessing that the very least, this assertion is not something that should be possible to hit from Mono for Android in the first place.

Attached is the logcat output as well as a sample repro project.
Comment 1 Greg Shackles 2011-07-31 14:58:41 UTC
Created attachment 43 [details]
logcat output
Comment 2 Miguel de Icaza [MSFT] 2011-08-01 19:10:36 UTC
This is an unmanaged crash, which points to a runtime bug.

What commands do hyou use to reproduce this?
Comment 3 Greg Shackles 2011-08-01 19:23:45 UTC
I attached a sample project that should reproduce the error when you run it. It basically boils down to:


eval.Run("public class Foo { }");
eval.Run("var foo = new Foo();");


where eval is an instance of the Evaluator class in the C# compiler service.
Comment 4 Jonathan Pobst 2011-08-02 17:27:22 UTC
I can repro that it crashes, I just don't get the helpful error message that you get:

D/ReproApp(25762): Class defined
I/ActivityManager(   96): Process ReproApp.ReproApp (pid 25762) has died.

We'll likely need to sic one of our runtime guys at this.
Comment 5 Jonathan Pryor 2011-08-08 15:52:13 UTC
When I run on the Xoom, I also get the original message:

D/ReproApp(  930): Class defined
F/mono    (  930): * Assertion at ../../../../mono/metadata/reflection.c:2672, condition `tb->generic_params' not met
D/Zygote  (   89): Process 930 exited cleanly (1)

When I run on the N1, I don't see the assertion message (just as Jonathan Pobst doesn't see it).

(This is with Mono for Android 1.0.2.)
Comment 6 Rodrigo Kumpera 2011-08-19 20:10:55 UTC
This works on mono 2.11. Fixing it requires changes on a very sensitive part of the runtime which most of us are not confortable doing on a stable release.
Comment 7 Marek Habersack 2014-04-30 14:48:57 UTC
Tested the app with the current master, no crash. Rodrigo, I assume runtime has tests for whatever bug it was?