NullReferenceException

SyntaxEditor for Windows Forms Forum

Posted 2 years ago by hehui - manager, foxtable
Version: 22.1.0
Platform: .NET 4.0
Environment: Windows 10 (64-bit)
Avatar

This error often happens. I can meet it many times a day:

System.NullReferenceException
HResult=0x80004003
Message=object reference is not set to an instance of the object.
Source=ActiproSoftware.Text.Addons.DotNet.WinForms
StackTrace:
at ActiproSoftware.Internal.HB.EI3(EwS , ITypeDefinition , TypeMemberDeclaration )
at ActiproSoftware.Internal.HB.TdH(dT , ITypeDefinition , MethodDeclaration )
at ActiproSoftware.Internal.HB.QI7(ITypeDefinition , MethodDeclaration )
at ActiproSoftware.Internal.Rn.kiy(L4 , IAstNode )
at ActiproSoftware.Internal.Rn.Jif(L4 , IAstNode )
at ActiproSoftware.Internal.Rn.Ai6(L4 , IResolverResultSet )
at ActiproSoftware.Internal.L4.AEA(IDotNetContextLocation )
At ActiproSoftware.Internal.Rn.Resolve(IResolverRequest )
at ActiproSoftware.Internal.nwQ.Resolve()
at ActiproSoftware.Text.Languages.VB.Implementation.VBCompletionProvider.RequestSession(IEditorView view, Boolean canCommitWithoutPopup)
.......

Comments (5)

Posted 2 years ago by hehui - manager, foxtable
Avatar

Sometimes there is no error prompt, but the program loses response.

Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

I'm sorry you're having trouble.  I tried deobfuscating the stack trace with the stack above, but it didn't work.  Can you confirm which WinForms SyntaxEditor version you are on, and which platform (.NET Framework or .NET Core version) you use?  Also please make sure you paste the stack trace without any changes or additional formatting in case that is part of the problem.

Can you tell us exactly what minimal document text we need to make this happen, and any editing after that document text is set?  You should be able to reproduce it with the same steps each time.  We are about to publish a maintenance release any day now and would like to have this resolved before that release.  Giving us steps to reproduce it would be the fastest way to get this resolved.  While the stack trace (if we can deobfuscate it) may help narrow things down, being able to make the issue occur here is pretty essential.

[Modified 2 years ago]


Actipro Software Support

Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

As a followup, I believe I was able to manually figure out the method this occurs in (SourceFileLoader.InitializeTypeMemberBase).  We really need to be able to reproduce it and debug it to fix the issue though.  Kindly give us steps to reproduce it as soon as possible.  We will delay the maintenance release today to wait for your reply.  Thanks for your help.


Actipro Software Support

Posted 2 years ago by hehui - manager, foxtable
Avatar

Sorry, it's hard for me to reproduce this error, because it appears randomly and has a certain probability.

Just now, I found a similar error:
 
System.NullReferenceException
HResult=0x80004003
Message=object reference is not set to an instance of the object.
Source=ActiproSoftware.Text.Addons.DotNet.WinForms
StackTrace:
At ActiproSoftware.Internal.HB.EI3(EwS , ITypeDefinition , TypeMemberDeclaration )
At ActiproSoftware.Internal.HB.TdH(dT , ITypeDefinition , MethodDeclaration )
At ActiproSoftware.Internal.HB.QI7(ITypeDefinition , MethodDeclaration )
At ActiproSoftware.Internal.Rn.kiy(L4 , IAstNode )
At ActiproSoftware.Internal.Rn.Jif(L4 , IAstNode )
At ActiproSoftware.Internal.Rn.DbE(L4 , IAstNode , VariableDeclarator , String , Expression , Boolean )
At ActiproSoftware.Internal.Rn.rbi(L4 , IAstNode , IAstNode , Nullable`1 , String )
At ActiproSoftware.Internal.Rn.bic(L4 , ISimpleName )
At ActiproSoftware.Internal.Rn.Mb0(L4 , ISimpleName )
At ActiproSoftware.Internal.Rn.kb5(L4 , ISimpleName )
At ActiproSoftware.Internal.Rn.kb1(L4 , Expression )
At ActiproSoftware.Internal.Rn.Hba(L4 , MemberAccess )
At ActiproSoftware.Internal.Rn.kb1(L4 , Expression )
At ActiproSoftware.Internal.Rn.Ibo(L4 , InvocationExpression )
At ActiproSoftware.Internal.Rn.kb1(L4 , Expression )
At ActiproSoftware.Internal.Rn.Resolve(IResolverRequest )
At ActiproSoftware.Internal.nwQ.Resolve()
At ActiproSoftware.Text.Languages.VB.Implementation.VBParameterInfoProvider.RequestSession(IEditorView view)
At ActiproSoftware.Text.Languages.DotNet.Implementation.DotNetParameterInfoProviderBase.TQb(IEditorView , Boolean )
At ActiproSoftware.Text.Languages.VB.Implementation.VBParameterInfoProvider.OnDocumentTextChanged(SyntaxEditor editor, EditorSnapshotChangedEventArgs e)
At ActiproSoftware.Text.Languages.VB.Implementation.VBParameterInfoProvider.ActiproSoftware.UI.WinForms.Controls.SyntaxEditor.IEditorDocumentTextChangeEventSink.NotifyDocumentTextChanged(SyntaxEditor editor, EditorSnapshotChangedEventArgs e)
At ActiproSoftware.UI.WinForms.Controls.SyntaxEditor.SyntaxEditor.OnDocumentTextChanged(EditorSnapshotChangedEventArgs e)
At ActiproSoftware.UI.WinForms.Controls.SyntaxEditor.SyntaxEditor.CAp(EditorSnapshotChangedEventArgs )
At ActiproSoftware.UI.WinForms.Controls.SyntaxEditor.SyntaxEditor.JAe(TextSnapshotChangedEventArgs )
At ActiproSoftware.UI.WinForms.Controls.SyntaxEditor.SyntaxEditor.KAc(Object , TextSnapshotChangedEventArgs )
At ActiproSoftware.UI.WinForms.Controls.SyntaxEditor.SyntaxEditor.<>c.dSz(SyntaxEditor instance, Object source, TextSnapshotChangedEventArgs eventArgs)
At ActiproSoftware.Text.Utility.WeakEventListener`2.OnEvent(Object source, TEventArgs eventArgs)
At ActiproSoftware.Text.Implementation.TextDocumentBase.OnTextChanged(TextSnapshotChangedEventArgs e)
At ActiproSoftware.Text.Implementation.CodeDocument.OnTextChanged(TextSnapshotChangedEventArgs e)
At ActiproSoftware.Text.Implementation.TextDocumentBase.cfQ(Wd , Action`1 )
At ActiproSoftware.Internal.Wd.Apply()
At ActiproSoftware.UI.WinForms.Controls.SyntaxEditor.Primitives.EditorView.ReplaceSelectedText(ITextChangeType type, String text, IEditorViewTextChangeOptions options)
At ActiproSoftware.UI.WinForms.Controls.SyntaxEditor.EditActions.TypingAction.Execute(IEditorView view)
At ActiproSoftware.UI.WinForms.Controls.SyntaxEditor.Primitives.EditorView.ExecuteEditAction(IEditAction action)
At ActiproSoftware.UI.WinForms.Controls.SyntaxEditor.Primitives.EditorView.PerformTyping(String text)
At ActiproSoftware.UI.WinForms.Controls.SyntaxEditor.Primitives.EditorView.m8v(TextCompositionEventArgs )
At ActiproSoftware.UI.WinForms.Controls.SyntaxEditor.SyntaxEditor.W5D(IEditorView , Keys , Char )
At ActiproSoftware.UI.WinForms.Controls.SyntaxEditor.SyntaxEditor.OnKeyPress(KeyPressEventArgs e)
At System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
At System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
At System.Windows.Forms.Control.WmKeyChar(Message& m)
At System.Windows.Forms.Control.WndProc(Message& m)
At System.Windows.Forms.ScrollableControl.WndProc(Message& m)
At ActiproSoftware.UI.WinForms.Controls.SyntaxEditor.SyntaxEditor.WndProc(Message& m)
At System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
At System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
At System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
At System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
At System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
At System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
At System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
At System.Windows.Forms.Application.Run(Form mainForm)
....
 
 
I guess some your codes are not rigorous enough to judge whether an object is null.

The "actiprosoftware. Internal. Hb. EI3" method failed both times. Please check the code of this method carefully
 
ActiproSoftware.Internal.HB.EI3(EwS , ITypeDefinition , TypeMemberDeclaration )
 
 
 
Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

We already had null checks throughout that code.  Actually, looking at the commit history, there was one place in that method that was updated several weeks back to fix a single missing null check.  However that code update isn't in v22.1.0, it was added for the upcoming maintenance release.  I bet that's what you are running into, since that fix isn't in your codebase.  We are hoping to publish the maintenance release this week.


Actipro Software Support

The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.