Bug 3344 - [newresolver] editor crashes on completion in the middle of foreach (after "in ")
Summary: [newresolver] editor crashes on completion in the middle of foreach (after "i...
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding ()
Version: Trunk
Hardware: PC Windows
: --- major
Target Milestone: ---
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2012-02-10 00:50 UTC by Atsushi Eno
Modified: 2012-02-10 03:13 UTC (History)
1 user (show)

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


Attachments
the patch to my project (see description) (2.35 KB, application/octet-stream)
2012-02-10 00:50 UTC, Atsushi Eno
Details
sshot for the crasher error. (85.08 KB, image/png)
2012-02-10 00:50 UTC, Atsushi Eno
Details


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:
RESOLVED FIXED

Description Atsushi Eno 2012-02-10 00:50:07 UTC
Created attachment 1339 [details]
the patch to my project (see description)

(This is not going to be a great bug report without minimized test case, but it's still *sort of* reproducibe so I think this could still be of sort of help. If I got a chance to drill down and get a smaller case, I'll post updates.)

I'm trying some complicated code from my mono-reactive project and somehow found a crasher. It is reproducible by the following steps, but likely only when the code completion DB is *not* finished.

- git clone git://github.com/atsushieno/mono-reactive.git
- checkout cb742c3a
- apply the attached patch.
- Open mono-reactive.sln
- Open System.Reactive.Linq/Observable.cs
- go to line 1100, which is:  foreach (var r in rsub.OnNext (v);
- Delete "in " and retype it ("in ")
- MD crashes, with an error window I'm going to attach sshot next.

This also happens when I enter a new "foreach (var r in " within the delegate that begins with line 1080. (Though copy-pasting something next to "in" did not crash. The whitespace has to be entered manually to reproduce it.)
Comment 1 Atsushi Eno 2012-02-10 00:50:49 UTC
Created attachment 1340 [details]
sshot for the crasher error.
Comment 2 Atsushi Eno 2012-02-10 01:24:32 UTC
I could trim down the repro significantly. Enter "in " after "foreach (var r" at line 18 below:

--------
using System;
using System.Collections.Generic;

namespace MyApp
{
	public interface ISubject<T>
	{
	}
	
	public class Test<T,TRight,TLeft>
	{
		public void Foo (IObserver<T> observer)
		{
			var rightSubs = new List<ISubject<TRight>> ();
			var rightVals = new List<TRight> ();
			Observer.Create<TLeft> (v => {
				ISubject<TRight> rsub = new ReplaySubject<TRight> ();
				foreach (var r 
			}, () => sub.OnCompleted ());
		}
	}
}
Comment 3 Mike Krüger 2012-02-10 03:13:16 UTC
No wasn't a crash - was only a failed assertion. Since the resolver is now really lazy it does things twice sometimes.

I fixed the assertion.