NTrace fails with NullReferenceException when used inside a d'tor

May 31, 2011 at 1:01 PM

Hi,

When putting EtwTrace.Trace() call inside a d'tor, NTrace (preprocessor?) fails with NullReferenceException with the following stack trace:

C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: The "EtwTrace" task failed unexpectedly.C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: System.NullReferenceException: Object reference not set to an instance of an object.C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018:    at NTrace.NTraceAstVisitor.CreateTraceCall(ParametrizedNode parent, PreprocessorContext context, Int32 line, IList`1 args, Byte level, Int32 flag)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018:    at NTrace.NTraceAstVisitor.ProcessTraceCall(ParametrizedNode parent, PreprocessorContext context, Statement statement, InvocationExpression invocationExpression)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018:    at NTrace.NTraceAstVisitor.VisitExpressionStatement(ExpressionStatement expressionStatement, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018:    at ICSharpCode.NRefactory.Ast.ExpressionStatement.AcceptVisitor(IAstVisitor visitor, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018:    at ICSharpCode.NRefactory.Ast.AbstractNode.AcceptChildren(IAstVisitor visitor, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018:    at ICSharpCode.NRefactory.Visitors.AbstractAstVisitor.VisitBlockStatement(BlockStatement blockStatement, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018:    at ICSharpCode.NRefactory.Ast.BlockStatement.AcceptVisitor(IAstVisitor visitor, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018:    at ICSharpCode.NRefactory.Visitors.AbstractAstVisitor.VisitDestructorDeclaration(DestructorDeclaration destructorDeclaration, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018:    at ICSharpCode.NRefactory.Ast.DestructorDeclaration.AcceptVisitor(IAstVisitor visitor, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018:    at ICSharpCode.NRefactory.Ast.AbstractNode.AcceptChildren(IAstVisitor visitor, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018:    at ICSharpCode.NRefactory.Visitors.AbstractAstVisitor.VisitTypeDeclaration(TypeDeclaration typeDeclaration, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018:    at NTrace.NTraceAstVisitor.VisitTypeDeclaration(TypeDeclaration typeDeclaration, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018:    at ICSharpCode.NRefactory.Ast.TypeDeclaration.AcceptVisitor(IAstVisitor visitor, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018:    at ICSharpCode.NRefactory.Ast.AbstractNode.AcceptChildren(IAstVisitor visitor, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018:    at ICSharpCode.NRefactory.Visitors.AbstractAstVisitor.VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018:    at ICSharpCode.NRefactory.Ast.NamespaceDeclaration.AcceptVisitor(IAstVisitor visitor, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018:    at ICSharpCode.NRefactory.Ast.AbstractNode.AcceptChildren(IAstVisitor visitor, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018:    at ICSharpCode.NRefactory.Visitors.AbstractAstVisitor.VisitCompilationUnit(CompilationUnit compilationUnit, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018:    at ICSharpCode.NRefactory.Ast.CompilationUnit.AcceptVisitor(IAstVisitor visitor, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018:    at NTrace.FileProcessor.Process(String codeFile)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018:    at NTrace.Tasks.EtwTrace.Execute()C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018:    at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult)

Is this a known issue? Is this scenario (tracing inside a d'tor) supported whatsoever?

Thanks,

--Eran

Coordinator
May 31, 2011 at 1:41 PM
None of our test scenarios ever covered dtors, so it looks like you've discovered a bug in our preprocessor. I'll take a look at it after we get this incremental build issue addressed.

On Tue, May 31, 2011 at 9:01 AM, eranhare <notifications@codeplex.com> wrote:

From: eranhare

Hi,

When putting EtwTrace.Trace() call inside a d'tor, NTrace (preprocessor?) fails with NullReferenceException with the following stack trace:

C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: The "EtwTrace" task failed unexpectedly.C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: System.NullReferenceException: Object reference not set to an instance of an object.C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at NTrace.NTraceAstVisitor.CreateTraceCall(ParametrizedNode parent, PreprocessorContext context, Int32 line, IList`1 args, Byte level, Int32 flag)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at NTrace.NTraceAstVisitor.ProcessTraceCall(ParametrizedNode parent, PreprocessorContext context, Statement statement, InvocationExpression invocationExpression)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at NTrace.NTraceAstVisitor.VisitExpressionStatement(ExpressionStatement expressionStatement, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at ICSharpCode.NRefactory.Ast.ExpressionStatement.AcceptVisitor(IAstVisitor visitor, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at ICSharpCode.NRefactory.Ast.AbstractNode.AcceptChildren(IAstVisitor visitor, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at ICSharpCode.NRefactory.Visitors.AbstractAstVisitor.VisitBlockStatement(BlockStatement blockStatement, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at ICSharpCode.NRefactory.Ast.BlockStatement.AcceptVisitor(IAstVisitor visitor, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at ICSharpCode.NRefactory.Visitors.AbstractAstVisitor.VisitDestructorDeclaration(DestructorDeclaration destructorDeclaration, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at ICSharpCode.NRefactory.Ast.DestructorDeclaration.AcceptVisitor(IAstVisitor visitor, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at ICSharpCode.NRefactory.Ast.AbstractNode.AcceptChildren(IAstVisitor visitor, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at ICSharpCode.NRefactory.Visitors.AbstractAstVisitor.VisitTypeDeclaration(TypeDeclaration typeDeclaration, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at NTrace.NTraceAstVisitor.VisitTypeDeclaration(TypeDeclaration typeDeclaration, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at ICSharpCode.NRefactory.Ast.TypeDeclaration.AcceptVisitor(IAstVisitor visitor, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at ICSharpCode.NRefactory.Ast.AbstractNode.AcceptChildren(IAstVisitor visitor, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at ICSharpCode.NRefactory.Visitors.AbstractAstVisitor.VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at ICSharpCode.NRefactory.Ast.NamespaceDeclaration.AcceptVisitor(IAstVisitor visitor, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at ICSharpCode.NRefactory.Ast.AbstractNode.AcceptChildren(IAstVisitor visitor, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at ICSharpCode.NRefactory.Visitors.AbstractAstVisitor.VisitCompilationUnit(CompilationUnit compilationUnit, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at ICSharpCode.NRefactory.Ast.CompilationUnit.AcceptVisitor(IAstVisitor visitor, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at NTrace.FileProcessor.Process(String codeFile)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at NTrace.Tasks.EtwTrace.Execute()C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult)

Is this a known issue? Is this scenario (tracing inside a d'tor) supported whatsoever?

Thanks,

--Eran

Read the full discussion online.

To add a post to this discussion, reply to this email (NTrace@discussions.codeplex.com)

To start a new discussion for this project, email NTrace@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


May 31, 2011 at 2:06 PM
Sure - notice that this one (d'tor trace) is in low priority for us:)


From: [email removed]
To: [email removed]
Date: Tue, 31 May 2011 06:41:29 -0700
Subject: Re: NTrace fails with NullReferenceException when used inside a d'tor [NTrace:259643]

From: ahopper
None of our test scenarios ever covered dtors, so it looks like you've discovered a bug in our preprocessor. I'll take a look at it after we get this incremental build issue addressed.

On Tue, May 31, 2011 at 9:01 AM, eranhare <notifications@codeplex.com> wrote:
From: eranhare
Hi,
When putting EtwTrace.Trace() call inside a d'tor, NTrace (preprocessor?) fails with NullReferenceException with the following stack trace:
C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: The "EtwTrace" task failed unexpectedly.C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: System.NullReferenceException: Object reference not set to an instance of an object.C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at NTrace.NTraceAstVisitor.CreateTraceCall(ParametrizedNode parent, PreprocessorContext context, Int32 line, IList`1 args, Byte level, Int32 flag)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at NTrace.NTraceAstVisitor.ProcessTraceCall(ParametrizedNode parent, PreprocessorContext context, Statement statement, InvocationExpression invocationExpression)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at NTrace.NTraceAstVisitor.VisitExpressionStatement(ExpressionStatement expressionStatement, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at ICSharpCode.NRefactory.Ast.ExpressionStatement.AcceptVisitor(IAstVisitor visitor, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at ICSharpCode.NRefactory.Ast.AbstractNode.AcceptChildren(IAstVisitor visitor, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at ICSharpCode.NRefactory.Visitors.AbstractAstVisitor.VisitBlockStatement(BlockStatement blockStatement, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at ICSharpCode.NRefactory.Ast.BlockStatement.AcceptVisitor(IAstVisitor visitor, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at ICSharpCode.NRefactory.Visitors.AbstractAstVisitor.VisitDestructorDeclaration(DestructorDeclaration destructorDeclaration, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at ICSharpCode.NRefactory.Ast.DestructorDeclaration.AcceptVisitor(IAstVisitor visitor, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at ICSharpCode.NRefactory.Ast.AbstractNode.AcceptChildren(IAstVisitor visitor, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at ICSharpCode.NRefactory.Visitors.AbstractAstVisitor.VisitTypeDeclaration(TypeDeclaration typeDeclaration, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at NTrace.NTraceAstVisitor.VisitTypeDeclaration(TypeDeclaration typeDeclaration, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at ICSharpCode.NRefactory.Ast.TypeDeclaration.AcceptVisitor(IAstVisitor visitor, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at ICSharpCode.NRefactory.Ast.AbstractNode.AcceptChildren(IAstVisitor visitor, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at ICSharpCode.NRefactory.Visitors.AbstractAstVisitor.VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at ICSharpCode.NRefactory.Ast.NamespaceDeclaration.AcceptVisitor(IAstVisitor visitor, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at ICSharpCode.NRefactory.Ast.AbstractNode.AcceptChildren(IAstVisitor visitor, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at ICSharpCode.NRefactory.Visitors.AbstractAstVisitor.VisitCompilationUnit(CompilationUnit compilationUnit, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at ICSharpCode.NRefactory.Ast.CompilationUnit.AcceptVisitor(IAstVisitor visitor, Object data)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at NTrace.FileProcessor.Process(String codeFile)C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at NTrace.Tasks.EtwTrace.Execute()C:\Program Files\MSBuild\NTrace\v2.0\NTrace.CSharp.v2.0.targets(62,5): error MSB4018: at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult)
Is this a known issue? Is this scenario (tracing inside a d'tor) supported whatsoever?
Thanks,
--Eran
Read the full discussion online.
To add a post to this discussion, reply to this email (NTrace@discussions.codeplex.com)
To start a new discussion for this project, email NTrace@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

Read the full discussion online.
To add a post to this discussion, reply to this email (NTrace@discussions.codeplex.com)
To start a new discussion for this project, email NTrace@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com