fsprojects / zarchive-fsharpbinding

Archive of F# Language Bindings for Open Editors

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Indentation Tracker sometimes calculates out of bounds

7sharp9 opened this issue · comments

I have several hundred reports of the following stack trace:

at System.String.Substring (Int32 startIndex) [0x00026] in /private/tmp/source-mono-mac-3.12.0-branch-32/bockbuild-mono-3.12.0-branch/profiles/mono-mac-xamarin/build-root/mono-3.12.0/mcs/class/corlib/System/String.cs:435 
  at MonoDevelop.FSharp.FSharpIndentationTracker.getIndentString (Int32 lineNumber, Int32 column) [0x00099] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-5.7-branch/0bc7d355/source/monodevelop/main/external/fsharpbinding/monodevelop/MonoDevelop.FSharpBinding/Services/FSharpIndentationTracker.fs:46 
  at MonoDevelop.FSharp.FSharpIndentationTracker.Mono-TextEditor-IIndentationTracker-GetIndentationString (Int32 lineNumber, Int32 column) [0x00000] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-5.7-branch/0bc7d355/source/monodevelop/main/external/fsharpbinding/monodevelop/MonoDevelop.FSharpBinding/Services/FSharpIndentationTracker.fs:50 
  at Mono.TextEditor.TextEditorData.GetIndentationString (Int32 lineNumber, Int32 column) [0x00009] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-5.7-branch/0bc7d355/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditorData.cs:1148 
  at Mono.TextEditor.TextEditorData.FixVirtualIndentation (Int32 lineNumber) [0x0004b] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-5.7-branch/0bc7d355/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditorData.cs:587 
  at Mono.TextEditor.ClipboardActions.PastePlainText (Mono.TextEditor.TextEditorData data, Int32 offset, System.String text, Boolean preserveSelection, System.Byte[] copyData) [0x0018c] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-5.7-branch/0bc7d355/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Actions/ClipboardActions.cs:419 
  at Mono.TextEditor.ClipboardActions+<PasteFrom>c__AnonStorey0.<>m__0 (Gtk.Clipboard clp, Gtk.SelectionData selectionData) [0x00510] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-5.7-branch/0bc7d355/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Actions/ClipboardActions.cs:369 
  at GtkSharp.ClipboardReceivedFuncWrapper.NativeCallback (IntPtr clipboard, IntPtr selection_data, IntPtr data) [0x0003f] in /private/tmp/source-mono-mac-3.12.0-branch-32/bockbuild-mono-3.12.0-branch/profiles/mono-mac-xamarin/build-root/gtk-sharp-2.12.21/gtk/generated/GtkSharp.ClipboardReceivedFuncNative.cs:54 

startIndex on the substring needs to be checked for correctness looking at the ST.

@rojepp Heres the stack trace from one of the indentation tracker errors. Looks like pasting causes out of bounds on the substring.

@7sharp9 Several hundred? Wow. :) I'll take a look, at least within a couple of days.

335 logged, I dont think they are catastrophic but merely unhanded exceptions, they all look to originate from the clipboard anyway.

I'm having trouble reproducing. Out of those 335, someone should have provided some nice repro steps?

Easy fix, then ;-)

Possibly this is an artefact of pre 5.7.0/1 upstream issues.

Im currently on a different branch so I haven't had chance to look at them.

Let me know if you find a repro.

@7sharp9 I'm betting it is safe to close this after todays commit.