Exception during edit with syntax errors

SyntaxEditor for Windows Forms Forum

Posted 17 years ago by Adam Dickinson
Version: 4.0.0239
Platform: .NET 2.0
Environment: Windows XP (32-bit)
Avatar
Hello once again. First off, let me just say that I love your product and the excellent support you provide. I don't think you guys hear that enough. Anyways, on with the show...

I found a crash in my own application that is reproducible in the SDI Editor.

Steps to reproduce:

1) Using the C# Add-on, type the following in any function. Subtract(...) works just fine:

int val = Add( Double( 4 ) 3 );
You'll notice that the '3' and the last ')' produce syntax errors (red squiggy line) due to a missing comma.

2) Put the caret between "Add(" and "Double".

3) Press the enter key a bunch of times in quick succession. Sometimes you have to press it more times than others, presumably because of the threading. I've also gotten it to happen by mixing in Tab, Backspace, and Undo with the enter keypresses.

Result:

NullReferenceException
"Object reference not set to an instance of an object."

Callstack:
ActiproSoftware.SyntaxEditor.Net20.dll!bk.b(int A_0 = 56, int A_1 = 1506) + 0x1ec bytes
ActiproSoftware.SyntaxEditor.Net20.dll!ActiproSoftware.SyntaxEditor.DisplayLineCollection.e(int A_0 = 56) + 0x585 bytes
ActiproSoftware.SyntaxEditor.Net20.dll!ActiproSoftware.SyntaxEditor.EditorView.a(System.Windows.Forms.PaintEventArgs A_0 = {ClipRectangle = {X=0,Y=0,Width=812,Height=469}}, System.Drawing.Rectangle A_1 = {X = 75 Y = 1 Width = 720 Height = 17}, ActiproSoftware.SyntaxEditor.DocumentLine A_2 = {ActiproSoftware.SyntaxEditor.DocumentLine}, ActiproSoftware.SyntaxEditor.DisplayLine A_3 = {ActiproSoftware.SyntaxEditor.DisplayLine}, ActiproSoftware.SyntaxEditor.EditPositionRange A_4 = {StartPosition={Line=98,Character=4},EndPosition={Line=98,Character=4}}, ref int A_5 = 0) + 0x81d bytes
ActiproSoftware.SyntaxEditor.Net20.dll!ActiproSoftware.SyntaxEditor.EditorView.OnRender(System.Windows.Forms.PaintEventArgs e = {ClipRectangle = {X=0,Y=0,Width=812,Height=469}}) + 0x1629 bytes
ActiproSoftware.WinUICore.Net20.dll!ActiproSoftware.WinUICore.UIElement.Render(System.Windows.Forms.PaintEventArgs e = {ClipRectangle = {X=0,Y=0,Width=812,Height=469}}) + 0x20 bytes
ActiproSoftware.WinUICore.Net20.dll!ActiproSoftware.WinUICore.UIControl.OnRenderChildElements(System.Windows.Forms.PaintEventArgs e = {ClipRectangle = {X=0,Y=0,Width=812,Height=469}}) + 0x114 bytes
ActiproSoftware.WinUICore.Net20.dll!ActiproSoftware.WinUICore.UIControl.Render(System.Windows.Forms.PaintEventArgs e = {ClipRectangle = {X=0,Y=0,Width=812,Height=469}}) + 0x2c bytes
ActiproSoftware.WinUICore.Net20.dll!ActiproSoftware.WinUICore.UIControl.a(System.Windows.Forms.PaintEventArgs A_0 = {ClipRectangle = {X=0,Y=0,Width=812,Height=469}}) + 0x5a3 bytes
ActiproSoftware.WinUICore.Net20.dll!ActiproSoftware.WinUICore.UIControl.OnPaint(System.Windows.Forms.PaintEventArgs e = {ClipRectangle = {X=0,Y=0,Width=812,Height=469}}) + 0x1d bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.PaintWithErrorHandling(System.Windows.Forms.PaintEventArgs e = {ClipRectangle = {X=0,Y=0,Width=812,Height=469}}, short layer, bool disposeEventArgs = false) + 0x5b bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.WmPaint(ref System.Windows.Forms.Message m) + 0x480 bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m) + 0x2e7 bytes
System.Windows.Forms.dll!System.Windows.Forms.ScrollableControl.WndProc(ref System.Windows.Forms.Message m) + 0x45 bytes
ActiproSoftware.SyntaxEditor.Net20.dll!ActiproSoftware.SyntaxEditor.SyntaxEditor.WndProc(ref System.Windows.Forms.Message m = {msg=0xf (WM_PAINT) hwnd=0x1e0b78 wparam=0x0 lparam=0x0 result=0x0}) + 0x4c bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) + 0xd bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m) + 0xd6 bytes
System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(System.IntPtr hWnd, int msg = 15, System.IntPtr wparam, System.IntPtr lparam) + 0x75 bytes
...

In my application, my exception callstacks are a bit different, but the top 2 are always the same as the one above: bk.b(Int32 A_0, Int32 A_1) and ActiproSoftware.SyntaxEditor.DisplayLineCollection.e(Int32 A_0)

Pressing Enter:
at bk.b(Int32 A_0, Int32 A_1)
at ActiproSoftware.SyntaxEditor.DisplayLineCollection.e(Int32 A_0)
at ActiproSoftware.SyntaxEditor.EditorView.l()
at ActiproSoftware.SyntaxEditor.SyntaxEditor.d(Object A_0, DocumentModificationEventArgs A_1)
at ActiproSoftware.SyntaxEditor.Document.b(DocumentModificationEventArgs A_0)
at ActiproSoftware.SyntaxEditor.Document.a(DocumentModification A_0, Boolean A_1)
at ActiproSoftware.SyntaxEditor.Document.a(DocumentModificationType A_0, Int32 A_1, Int32 A_2, String A_3, DocumentModificationOptions A_4)
at ActiproSoftware.SyntaxEditor.Document.ReplaceText(DocumentModificationType type, Int32 offset, Int32 length, String text, DocumentModificationOptions options)
at ActiproSoftware.SyntaxEditor.EditorView.a(DocumentModificationType A_0, String A_1, DocumentModificationOptions A_2)
at ActiproSoftware.SyntaxEditor.EditorView.ReplaceSelectedText(DocumentModificationType type, String text, DocumentModificationOptions options)
at ActiproSoftware.SyntaxEditor.Commands.InsertLineBreakCommand.Execute(EditCommandContext context)
at ActiproSoftware.SyntaxEditor.MacroRecording.a(EditCommand A_0, EditCommandContext A_1)
at ActiproSoftware.SyntaxEditor.EditorView.a(EditCommand A_0, Boolean A_1)
at ActiproSoftware.SyntaxEditor.SyntaxEditor.a(EditorView A_0, Keys A_1, Char A_2, Boolean A_3)
at ActiproSoftware.SyntaxEditor.SyntaxEditor.OnKeyDown(KeyEventArgs e)
...

Pressing Delete:
at bk.b(Int32 A_0, Int32 A_1)
at ActiproSoftware.SyntaxEditor.DisplayLineCollection.e(Int32 A_0)
at ActiproSoftware.SyntaxEditor.EditorView.l()
at ActiproSoftware.SyntaxEditor.SyntaxEditor.d(Object A_0, DocumentModificationEventArgs A_1)
at ActiproSoftware.SyntaxEditor.Document.b(DocumentModificationEventArgs A_0)
at ActiproSoftware.SyntaxEditor.Document.a(DocumentModification A_0, Boolean A_1)
at ActiproSoftware.SyntaxEditor.Document.a(DocumentModificationType A_0, Int32 A_1, Int32 A_2, String A_3, DocumentModificationOptions A_4)
at ActiproSoftware.SyntaxEditor.Document.ReplaceText(DocumentModificationType type, Int32 offset, Int32 length, String text, DocumentModificationOptions options)
at ActiproSoftware.SyntaxEditor.EditorView.a(DocumentModificationType A_0, String A_1, DocumentModificationOptions A_2)
at ActiproSoftware.SyntaxEditor.EditorView.DeleteSelectedText(DocumentModificationType type, DocumentModificationOptions options)
at ActiproSoftware.SyntaxEditor.Commands.DeleteCommand.Execute(EditCommandContext context)
at ActiproSoftware.SyntaxEditor.MacroRecording.a(EditCommand A_0, EditCommandContext A_1)
at ActiproSoftware.SyntaxEditor.EditorView.a(EditCommand A_0, Boolean A_1)
at ActiproSoftware.SyntaxEditor.EditorView.RaiseEditCommand(EditCommand command)
at ActiproSoftware.SyntaxEditor.EditorView.Delete()
...

Comments (2)

Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Thanks for the comments Adam!

Actually I think this is the same issue as was just posted this evening by Erik:
http://www.actiprosoftware.com/Support/Forums/ViewForumTopic.aspx?ForumTopicID=2137

The stack trace matches up exactly with where the fix was made there and it seems like the same scenario. It is fixed for the upcoming release (maybe tomorrow).


Actipro Software Support

Posted 17 years ago by Adam Dickinson
Avatar
That's good to hear. Thank you so much!
The latest build of this product (v24.1.0) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.