Bug 6239 - Right click at editor empty area causes MonoDevelop to crash
Summary: Right click at editor empty area causes MonoDevelop to crash
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C Binding ()
Version: 3.0.x
Hardware: PC Linux
: Low normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-07-23 08:53 UTC by sfc_0
Modified: 2012-11-30 03:06 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 sfc_0 2012-07-23 08:53:38 UTC
When I right click at any empty area in editor a dialog popups out and show this:
-----
Error while updating status of command: MonoDevelop.Refactoring.RefactoryCommands.GotoDeclaration
Details:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentOutOfRangeException: Cannot be negative, and should be less than length of string.
Parameter name: startIndex
  at System.String.LastIndexOfAny (System.Char[] anyOf, Int32 startIndex) [0x00000] in <filename unknown>:0 
  at CBinding.CTextEditorExtension.GetTokenAt (DocumentLocation location) [0x00000] in <filename unknown>:0 
  at CBinding.CTextEditorExtension.GetLanguageItemAt (DocumentLocation location) [0x00000] in <filename unknown>:0 
  at CBinding.CTextEditorExtension.CanGotoDeclaration (MonoDevelop.Components.Commands.CommandInfo item) [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Components.Commands.CommandUpdaterInfo.Run (System.Object cmdTarget, MonoDevelop.Components.Commands.CommandInfo info) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Components.Commands.CommandManager.GetCommandInfo (System.Object commandId, MonoDevelop.Components.Commands.CommandTargetRoute targetRoute) [0x00000] in <filename unknown>:0 
-----
  Then if I expand the "details" and move my cursor, MonoDevelop crashes; if I just click "OK", it runs as normal and won't appear again even if right click at any empty area. But every time I restart MonoDevelop, the same will occur.
  Using MonoDevelop 3.0.3.2 on Ubuntu 12.10 Alpha 2. Thanks for your time looking into this bug.
Comment 1 sfc_0 2012-07-23 08:56:15 UTC
Oh forgot one point: This only appears in a C project, C# project doesn't have this problem.
Comment 2 sfc_0 2012-07-23 09:46:05 UTC
More problem: it even randomly crashes when its window is not foreground and I move my cursor on it!
No any error dialog.
Comment 3 Mike Krüger 2012-11-30 03:06:56 UTC
fixed

(Atm we've no maintainer for the c binding - that's why it took a while)