Bug 12590 - System.ArgumentException: endOffset > Length
Summary: System.ArgumentException: endOffset > Length
Status: VERIFIED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding ()
Version: unspecified
Hardware: PC Mac OS
: Normal normal
Target Milestone: master
Assignee: Mike Krüger
URL:
: 13254 ()
Depends on:
Blocks:
 
Reported: 2013-06-07 04:53 UTC by Marek Safar
Modified: 2014-01-24 03:31 UTC (History)
4 users (show)

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

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

Description Marek Safar 2013-06-07 04:53:29 UTC
System.ArgumentException: endOffset > Length
  at Mono.TextEditor.TextDocument.GetTextBetween (Int32 startOffset, Int32 endOffset) [0x00062] in /Users/builder/data/lanes/monodevelop-lion-master/15c1606c/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs:272 
  at MonoDevelop.Ide.Gui.Content.DocumentStateTracker`1[MonoDevelop.CSharp.Formatting.CSharpIndentEngine].UpdateEngine (Int32 position) [0x00120] in /Users/builder/data/lanes/monodevelop-lion-master/15c1606c/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/DocumentStateTracker.cs:127 
  at MonoDevelop.CSharp.Formatting.CSharpTextEditorIndentation.HandleTextReplaced (System.Object sender, Mono.TextEditor.DocumentChangeEventArgs e) [0x0000d] in /Users/builder/data/lanes/monodevelop-lion-master/15c1606c/source/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs:213 
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_DocumentChangeEventArgs (object,Mono.TextEditor.DocumentChangeEventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_DocumentChangeEventArgs (object,Mono.TextEditor.DocumentChangeEventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_DocumentChangeEventArgs (object,Mono.TextEditor.DocumentChangeEventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_DocumentChangeEventArgs (object,Mono.TextEditor.DocumentChangeEventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_DocumentChangeEventArgs (object,Mono.TextEditor.DocumentChangeEventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_DocumentChangeEventArgs (object,Mono.TextEditor.DocumentChangeEventArgs)
  at Mono.TextEditor.TextDocument.OnTextReplaced (Mono.TextEditor.DocumentChangeEventArgs args) [0x0000b] in /Users/builder/data/lanes/monodevelop-lion-master/15c1606c/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs:412 
  at Mono.TextEditor.TextDocument.Replace (Int32 offset, Int32 count, System.String value, AnchorMovementType anchorMovementType) [0x00135] in /Users/builder/data/lanes/monodevelop-lion-master/15c1606c/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs:253 
  at Mono.TextEditor.TextDocument.Replace (Int32 offset, Int32 count, System.String value) [0x00000] in /Users/builder/data/lanes/monodevelop-lion-master/15c1606c/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs:218 
  at Mono.TextEditor.TextEditorData.Replace (Int32 offset, Int32 count, System.String value) [0x00009] in /Users/builder/data/lanes/monodevelop-lion-master/15c1606c/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditorData.cs:440 
  at Mono.TextEditor.TextEditorData.Remove (Int32 offset, Int32 count) [0x00000] in /Users/builder/data/lanes/monodevelop-lion-master/15c1606c/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditorData.cs:381 
  at Mono.TextEditor.TextEditorData.FixVirtualIndentation () [0x00078] in /Users/builder/data/lanes/monodevelop-lion-master/15c1606c/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditorData.cs:524 
  at MonoDevelop.CSharp.Formatting.CSharpTextEditorIndentation.DoReSmartIndent (Int32 cursor) [0x001a6] in /Users/builder/data/lanes/monodevelop-lion-master/15c1606c/source/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs:971 
  at MonoDevelop.CSharp.Formatting.CSharpTextEditorIndentation.DoReSmartIndent () [0x00000] in /Users/builder/data/lanes/monodevelop-lion-master/15c1606c/source/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs:930 
  at MonoDevelop.CSharp.Formatting.CSharpTextEditorIndentation.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x006f0] in /Users/builder/data/lanes/monodevelop-lion-master/15c1606c/source/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs:629 
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00013] in /Users/builder/data/lanes/monodevelop-lion-master/15c1606c/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:109 
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00013] in /Users/builder/data/lanes/monodevelop-lion-master/15c1606c/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:109 
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00013] in /Users/builder/data/lanes/monodevelop-lion-master/15c1606c/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:109 
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00013] in /Users/builder/data/lanes/monodevelop-lion-master/15c1606c/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:109 
  at MonoDevelop.Debugger.ExceptionCaughtTextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x0005f] in /Users/builder/data/lanes/monodevelop-lion-master/15c1606c/source/monodevelop/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs:439 
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00013] in /Users/builder/data/lanes/monodevelop-lion-master/15c1606c/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:109 
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00013] in /Users/builder/data/lanes/monodevelop-lion-master/15c1606c/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:109 
  at MonoDevelop.SourceEditor.ExtensibleTextEditor.ExtensionKeyPress (Key key, UInt32 ch, ModifierType state) [0x00007] in /Users/builder/data/lanes/monodevelop-lion-master/15c1606c/source/monodevelop/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs:240
Comment 1 Mike Krüger 2013-06-07 06:31:17 UTC
Should've been fixed - but a use case would be nice.
Comment 2 Mike Krüger 2013-07-16 01:44:30 UTC
*** Bug 13254 has been marked as a duplicate of this bug. ***
Comment 3 Stas Kalashnikov 2013-08-03 14:17:40 UTC
Xamarin Studio 4.0.10, reproducible on Mac & Windows.

1. Open any C# source file in any project.
2. Cmd + A (Ctrl + A on Windows) to select all text in the file.
3. Type "text" and press Enter twice.
4. Exception dialog appears: "Error in text editor extension chain", "System.ArgumentException: endOffset > Length".
Comment 4 Prashant manu 2014-01-24 03:31:42 UTC
We have followed steps mention in comment 3, and we are not getting error.

XS 4.2.3 (build 154)
Hence closing this issue.