Bug 59642 - [Automation]EnterText() method is crashing VSFM when text to be entered is curly brace(“{”)
Summary: [Automation]EnterText() method is crashing VSFM when text to be entered is c...
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor (show other bugs)
Version: 7.2 (d15-4)
Hardware: PC Mac OS
: Normal normal
Target Milestone: 15.5
Assignee: Vsevolod Kukol
Depends on:
Reported: 2017-09-21 12:32 UTC by Swati Gangrade
Modified: 2017-11-15 22:15 UTC (History)
4 users (show)

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

IDE, Test Script Logs (13.73 KB, application/x-zip-compressed)
2017-09-21 12:32 UTC, Swati Gangrade
monoDevelopProperties.xml (95.83 KB, text/xml)
2017-09-21 15:09 UTC, Swati Gangrade

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 Swati Gangrade 2017-09-21 12:32:22 UTC
Created attachment 24853 [details]
IDE, Test Script Logs

Executed On:

• Visual Studio Enterprise 2017 for Mac (Preview) Version 7.2 Preview (7.2 build 617)
• Mono (2017-06/7d788778005) (64-bit)
• NuGet Version:
• Xamarin.Android Version: (Visual Studio Enterprise)
• Xamarin.iOS Version: (Visual Studio Enterprise)
• Xamarin.Mac Version: (Visual Studio Enterprise)
• Operating System Mac OS X 10.12.1

Detailed Build Gist: https://gist.github.com/gangrade-swati/6caef213c809f9a61eb0c4349cb84f4c

Note- This issue is occurred during automation test script execution while entering curly brace("{") as text in ExterText()method

1. Create File->New->iOS->App->Single View App->
2. Open AppDelegate.cd
3. Enter successMessage(); in line no.23 i.e above return true; statement within FinishedLaunching(UIApplication application, NSDictionary launchOptions) method
4. Add code 
public void successMessage(){System.Consoel.WriteLine(“Deployed Successful”);}
Expected Result:
Text should be entered 

Actual Result:
VSFM is getting crashed 

Note- Same issue is occurring on Jenkins :

using Search>Go to line > Goto line end and then Insert new line. this method is failing in some cases because of mono exception “Error while reading monodoc file.” 

Jenkins Report: http://xqa.blob.core.windows.net/gist/TestReport-6dbda2cbd9ff4939af654e835ccdaf22.txt

Jenkins Execution in IDE logs- http://xqa.blob.core.windows.net/gist/LaunchAndRunTvOSTabbedAppOnSimulator.Ide.log.170918191208-00bb537c323549d1b314dfe762828f53.txt


Frequency of Reproduction:


Screen-Cast Link:


IDE Logs and Debug output attached.

Comment 1 Swati Gangrade 2017-09-21 15:09:23 UTC
Created attachment 24855 [details]
Comment 2 Swati Gangrade 2017-09-21 16:04:52 UTC
Comment on attachment 24855 [details]

Please ignore this monoDevelopProperties.xml file attachment
Comment 3 Mike Krüger 2017-09-22 07:47:47 UTC
I can't reproduce it on my side yet.

The monodoc error is unrelated. It's a managed exception which is handled. That can't lead to a crash like you  saw and doesn't happen on return.

But I'll investigate that further - after updating my system. My mono is a bit older than the one you used for testing.
Comment 4 Manish Sinha 2017-09-22 13:49:29 UTC
The Ide.log http://xqa.blob.core.windows.net/gist/LaunchAndRunTvOSTabbedAppOnSimulator.Ide.log.170918191208-00bb537c323549d1b314dfe762828f53.txt


> ERROR[2017-09-18 19:11:51Z]: An unhandled exception has occured. Terminating Visual Studio? False
> System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
>  at System.Collections.Generic.Dictionary`2+Enumerator[TKey,TValue].MoveNext () [0x000d3] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono- x64/external/corert/src/System.Private.CoreLib/src/System/Collections/Generic/Dictionary.cs:912 
>   at Xwt.GtkBackend.CustomCanvas.OnSizeAllocated (Gdk.Rectangle allocation) [0x000d3] in /Users/builder/data/lanes/432/7fd7107d/source/monodevelop/main/external/xwt/Xwt.Gtk/Xwt.GtkBackend/CanvasBackend.cs:144 
>  at Gtk.Widget.sizeallocated_cb (System.IntPtr widget, System.IntPtr allocation) [0x00016] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/gtk-sharp-None/gtk/generated/Widget.cs:1736
Comment 5 Mike Krüger 2017-09-25 10:22:21 UTC
Ok that seems to be inside xwt. @sevo: can you take a look at that ?
Comment 6 Alan McGovern 2017-09-26 14:30:49 UTC
The error in comment 4 is likely to be unrelated. It's been a master regression for a few months now and has has no noticable impact on the IDE.
Comment 7 Vsevolod Kukol 2017-09-27 18:12:33 UTC
The Xwt Exception doesn't seem to be related to this issue, however I've got a fix for it here: https://github.com/mono/xwt/pull/729

According to the attached log (https://bugzilla.xamarin.com/attachment.cgi?id=24853) it's crashing during the IMContext.Reset() call (here: https://github.com/mono/monodevelop/blob/master/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs#L625) which raises the PreeditChanged event with some invalid state. I've created a PR (https://github.com/mono/monodevelop/pull/3102) which fixes the crasher, but I'm not sure if it's enough to just reset the internal string there. @Mkrueger can you review?
Comment 8 Vsevolod Kukol 2017-09-28 07:42:17 UTC
Ok, I've run the  LaunchAndRunTvOSTabbedAppOnSimulator test locally and can confirm both. It crashes without and passes with my patch.
Comment 10 xamarin-release-manager 2017-10-05 16:58:46 UTC
Fixed in version (d15-5)

Author: Vsevolod Kukol
Commit: 5b1d2796b0e26798c42b71810db8a9483cad94e2 (mono/monodevelop)
Comment 11 Swati Gangrade 2017-11-10 13:05:15 UTC
Bug is retested and verified in below build 
- Visual Studio Community 2017 for Mac (Preview) Version 7.3 Preview (7.3 build 708)
- Mono (2017-06/c6605763a36) (64-bit)
- Xamarin.iOS Version: (Visual Studio Community)
- Xamarin.Android Version: (Visual Studio Community)
- Xamarin.Mac Version: (Visual Studio Community)

Detailed Build Info - https://gist.github.com/GLjackyvaswani/ab7aa99bd24cc3fedf708a08d00ca2e9

Screencast for reference- https://www.screencast.com/users/v-swgang/folders/Default/media/e10a1e71-c82b-44ac-8645-d24d886bd522

Note - the bug seems to be fixed after installation of 3rd party tool "clickclick"
@Manish Would you please confirm the expected behavior?

According to your confirmation please mark it as Verified
Comment 12 Manish Sinha 2017-11-15 22:15:32 UTC
If this issue resurfaces please reopen the bug