Bug 57780 - [aot] Could not inflate generic type (regression)
Summary: [aot] Could not inflate generic type (regression)
Alias: None
Product: iOS
Classification: Xamarin
Component: Mono runtime / AOT compiler ()
Version: XI 10.12 (d15-3)
Hardware: Macintosh Mac OS
: Highest blocker
Target Milestone: 15.3
Assignee: Zoltan Varga
Depends on:
Reported: 2017-06-27 02:25 UTC by Frank A. Krueger
Modified: 2017-08-02 09:38 UTC (History)
11 users (show)

Tags: Shiproom
Is this bug a regression?: Yes
Last known good build: 10.10.x

Repro that uses Roslyn to parse some text (11.10 KB, application/zip)
2017-06-27 18:41 UTC, Frank A. Krueger

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 Frank A. Krueger 2017-06-27 02:25:00 UTC
Sometime between

mtouch (d15-2: d2270eec)


mtouch (d15-3: 104e7b43)

We started getting this error while using Roslyn on device:

Could not inflate generic type due to VAR 1 (T2_BOOL) cannot be expanded in this context with 1 instantiations assembly:<no_image> type:<unknown type> member:<none>

    at <unknown> <0xffffffff>
    at System.Collections.Generic.Stack`1<T_INST>.Pop () <0x000cf>
    at Microsoft.CodeAnalysis.GreenNode.ProcessStack (System.IO.TextWriter,System.Collections.Generic.Stack`1<System.ValueTuple`3<Microsoft.CodeAnalysis.GreenNode, bool, bool>>) <0x00037>
    at Microsoft.CodeAnalysis.GreenNode.WriteTo (System.IO.TextWriter,bool,bool) <0x00103>
    at Microsoft.CodeAnalysis.GreenNode.ToString () <0x00083>
    at Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.DocumentationCommentParser.ParseXmlAttributes (Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.XmlNameSyntax&,Microsoft.CodeAnalysis.Syntax.InternalSyntax.SyntaxListBuilder`1<Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.XmlAttributeSyntax>) <0x0008f>
    at Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.DocumentationCommentParser.ParseXmlElement () <0x000fb>

This does not happen if we use
Comment 1 Zoltan Varga 2017-06-27 17:53:32 UTC
How can we reproduce this ?
Comment 2 Frank A. Krueger 2017-06-27 18:41:27 UTC
Created attachment 23147 [details]
Repro that uses Roslyn to parse some text
Comment 3 Frank A. Krueger 2017-06-27 18:42:56 UTC
I have attached a repro project. Look in ViewController.cs to see Roslyn parsing some code.

The repro is simple:

1. New iOS project
2. Reference Roslyn 2.0
3. Use the C# syntax parser
Comment 4 Zoltan Varga 2017-06-29 18:24:57 UTC
Can't reproduce this with Does this happen in debug or release mode ?
Comment 6 Frank A. Krueger 2017-06-29 21:02:50 UTC
I just re-read your comment:

Yes, it WORKS on

Comment 8 Zoltan Varga 2017-06-29 22:50:46 UTC
Can't reproduce even with
Can anybody else reproduce ?
Comment 9 Zoltan Varga 2017-06-30 23:30:44 UTC
using System;
using System.Collections.Generic;
using System.Threading;

class GreenNode {

class Tests {
	public static void Main () {
		var stack = new Stack<(GreenNode node, bool leading, bool trailing)>();
		var n = new GreenNode ();
		stack.Push ((n, true, true));
		while (stack.Count > 0) {
			stack.Pop ();

Comment 10 Zoltan Varga 2017-07-01 01:11:44 UTC
Comment 11 Zoltan Varga 2017-07-02 06:12:47 UTC
Should be fixed in mono master 86ccab69974eeec897abcefca7f5ec243bf0496a. The fix probably needs to be backported.
Comment 13 Luis Aguilera 2017-07-03 15:20:50 UTC
@zoltan, would you please backport this fix to mono 2017-04?
Comment 14 Zoltan Varga 2017-07-03 15:56:25 UTC
Done 3d531ba62551abca0ca0d679ae0d4e8a31cf1b67.
Comment 15 Rolf Bjarne Kvinge [MSFT] 2017-07-05 07:00:27 UTC
d15-3 PR: https://github.com/xamarin/xamarin-macios/pull/2292
Comment 16 Adrian Murphy 2017-07-05 21:34:28 UTC
Marking fixed, above PR has been merged.
Comment 21 xamarin-release-manager 2017-07-12 12:18:12 UTC
Fixed in d15-3 branch

Author: Luis Aguilera
Commit: bf350ba5ca9ee96a4f65ee87f93ee8d1f8bce1ed (xamarin/xamarin-macios)
Comment 22 xamarin-release-manager 2017-07-12 12:55:13 UTC
Fixed in version (d15-3)

Pull Request #2292 merged by: Luis Aguilera

Author: rolfbjarne
Commit: bf350ba5ca9ee96a4f65ee87f93ee8d1f8bce1ed (xamarin/xamarin-macios)
Comment 23 xamarin-release-manager 2017-07-12 13:00:18 UTC
Fixed in version (d15-3)

Pull Request #2292 merged by: Luis Aguilera

Author: rolfbjarne
Commit: bf350ba5ca9ee96a4f65ee87f93ee8d1f8bce1ed (xamarin/xamarin-macios)