Bug 6511 - TextEditor causes NRE at first text input in CBinding
Summary: TextEditor causes NRE at first text input in CBinding
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C Binding ()
Version: Trunk
Hardware: PC Linux
: Low normal
Target Milestone: ---
Assignee: Atsushi Eno
URL:
Depends on:
Blocks:
 
Reported: 2012-08-12 19:55 UTC by Atsushi Eno
Modified: 2012-11-30 02:49 UTC (History)
2 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:
RESOLVED FIXED

Description Atsushi Eno 2012-08-12 19:55:51 UTC
Steps to repro:
- Create a new CBinding shared library project.
- Open main.c.
- At the end of the file (line 5), type 'a' character.

Expected:
- It simply enters 'a'.

Actual:
- An error dialog for the exception below shows up:

System.IndexOutOfRangeException: Array index is out of range.
  at Mono.TextEditor.GapBuffer.GetCharAt (Int32 offset) [0x00000] in /svn/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/GapBuffer.cs:83 
  at Mono.TextEditor.TextDocument.GetCharAt (Int32 offset) [0x00000] in /svn/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs:310 
  at Mono.TextEditor.TextEditorData.GetCharAt (Int32 offset) [0x00000] in /svn/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditorData.cs:1198 
  at MonoDevelop.MonoDroid.NdkBinding.CTextEditorExtension.ResetTriggerOffset (MonoDevelop.Ide.CodeCompletion.CodeCompletionContext completionContext) [0x00017] in /svn/md-addins/MonoDevelop.MonoDroid/MonoDevelop.MonoDroid.NdkBinding/Gui/CTextEditorExtension.cs:734 
  at MonoDevelop.MonoDroid.NdkBinding.CTextEditorExtension.HandleCodeCompletion (MonoDevelop.Ide.CodeCompletion.CodeCompletionContext completionContext, Char completionChar, System.Int32& triggerWordLength) [0x000d9] in /svn/md-addins/MonoDevelop.MonoDroid/MonoDevelop.MonoDroid.NdkBinding/Gui/CTextEditorExtension.cs:247 
  at MonoDevelop.Ide.Gui.Content.CompletionTextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x0010d] in /svn/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:126 
  at MonoDevelop.MonoDroid.NdkBinding.CTextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x0029b] in /svn/md-addins/MonoDevelop.MonoDroid/MonoDevelop.MonoDroid.NdkBinding/Gui/CTextEditorExtension.cs:222 
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00022] in /svn/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:109 
  at MonoDevelop.Ide.Gui.Content.CompletionTextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00066] in /svn/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:103 
  at CBinding.CTextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x0029b] in /svn/monodevelop/main/src/addins/CBinding/Gui/CTextEditorExtension.cs:222 
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00022] in /svn/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) [0x00022] in /svn/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) [0x00022] in /svn/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) [0x00022] in /svn/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:109 
  at MonoDevelop.SourceEditor.ExtensibleTextEditor.ExtensionKeyPress (Key key, UInt32 ch, ModifierType state) [0x0000a] in /svn/monodevelop/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs:236 

Another input causes the same error, but the error does not occur for the third input.
Comment 1 Mikayla Hutchinson [MSFT] 2012-08-13 10:31:40 UTC
This appears to be in MonoDevelop.MonoDroid.NdkBinding, not CBinding.
Comment 2 Mike Krüger 2012-11-30 02:49:39 UTC
fixed.

Happened in our CBinding as well (which is unmaintained atm :/ )