Closed rgwood closed 2 years ago
OK the good news is that I am able to reproduce on my machine!
The bad news is for the life of me I can't get it to break on first-chance exceptions with Child Process extension. I selected the .NET 5.0 Mixed mode debugging, turned off Just My Code, but it still doesn't break, just prints the exception and returns.
Did you have to do anything else to enable the debugger to break? I do see the second process (dotnet.exe) starting in the Debug -> Windows -> Processes window, so at least the Child Process Attach extension is working. But then when there's an exception there it doesn't break. When it breaks for you at the BinaryLogger exception, can you paste your Debug -> Windows -> Processes list? And the callstack from the thread where the exception happens.
Arguments passed to dotnet msbuild by releaser:
msbuild
-p:Configuration=Release
-p:CustomAfterMicrosoftCommonTargets=C:\\dotnet-releaser\\src\\dotnet-releaser\\bin\\Debug\\net6.0\\dotnet-releaser.targets
-nologo
-logger:BinaryLogger,\"C:\\dotnet-releaser\\src\\dotnet-releaser\\bin\\Debug\\net6.0\\dotnet-releaser-binary-logger.dll\";\"C:\\Users\\kirill\\AppData\\Local\\Temp\\tmp535D.tmp.binlog
-t:DotNetReleaserGetPackageInfo
C:\\Temp\\releaser\\releaser.csproj
Interesting, I didn't change any VS settings since the previous issue (and the settings I changed then are all the ones you suggested).
Debug -> Windows -> Processes:
dotnet-releaser.exe 21688 C:\Users\reill\github\dotnet-releaser\src\dotnet-releaser\bin\Debug\net6.0\dotnet-releaser.exe dotnet-releaser Break Managed (.NET Core, .NET 5+), Native Default TATERTABLET
Call stack from the first exception:
> StructuredLogger.dll!Microsoft.Build.Logging.StructuredLogger.BuildEventArgsReader.GetStringFromRecord(int index) Line 1189 C#
StructuredLogger.dll!Microsoft.Build.Logging.StructuredLogger.BuildEventArgsReader.ReadDeduplicatedString() Line 1164 C#
StructuredLogger.dll!Microsoft.Build.Logging.StructuredLogger.BuildEventArgsReader.ReadOptionalString() Line 1153 C#
StructuredLogger.dll!Microsoft.Build.Logging.StructuredLogger.BuildEventArgsReader.ReadEvaluationLocation() Line 1232 C#
StructuredLogger.dll!Microsoft.Build.Logging.StructuredLogger.BuildEventArgsReader.ReadProjectEvaluationFinishedEventArgs() Line 423 C#
StructuredLogger.dll!Microsoft.Build.Logging.StructuredLogger.BuildEventArgsReader.Read() Line 160 C#
StructuredLogger.dll!Microsoft.Build.Logging.StructuredLogger.BinLogReader.Replay(System.IO.Stream stream, Microsoft.Build.Logging.StructuredLogger.Progress progress) Line 104 C#
StructuredLogger.dll!Microsoft.Build.Logging.StructuredLogger.BinLogReader.Replay(string sourceFilePath, Microsoft.Build.Logging.StructuredLogger.Progress progress) Line 50 C#
StructuredLogger.dll!Microsoft.Build.Logging.StructuredLogger.BinLogReader.Replay(string sourceFilePath) Line 39 C#
dotnet-releaser.dll!DotNetReleaser.Runners.MSBuildRunner.Run(DotNetReleaser.Logging.ISimpleLogger logger) Line 99 C#
[Resuming Async Method]
System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.__Canon>.AsyncStateMachineBox<System.__Canon>.ExecutionContextCallback(object s) Unknown
System.Private.CoreLib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) Unknown
System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<DotNetReleaser.Runners.MSBuildResult>.AsyncStateMachineBox<DotNetReleaser.Runners.MSBuildRunner.<Run>d__31>.MoveNext(System.Threading.Thread threadPoolThread) Unknown
System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.__Canon>.AsyncStateMachineBox<System.__Canon>.MoveNext() Unknown
System.Private.CoreLib.dll!System.Runtime.CompilerServices.TaskAwaiter.OutputWaitEtwEvents.AnonymousMethod__12_0(System.Action innerContinuation, System.Threading.Tasks.Task innerTask) Unknown
System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke() Unknown
System.Private.CoreLib.dll!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action action, bool allowInlining) Unknown
System.Private.CoreLib.dll!System.Threading.Tasks.Task.RunContinuations(object continuationObject) Unknown
System.Private.CoreLib.dll!System.Threading.Tasks.Task.FinishContinuations() Unknown
System.Private.CoreLib.dll!System.Threading.Tasks.Task<System.__Canon>.TrySetResult(System.__Canon result) Unknown
System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.__Canon>.SetExistingTaskResult(System.Threading.Tasks.Task<System.__Canon> task, System.__Canon result) Unknown
System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<DotNetReleaser.Runners.DotNetResult>.SetResult(DotNetReleaser.Runners.DotNetResult result) Unknown
[Completed] dotnet-releaser.dll!DotNetReleaser.Runners.DotNetRunnerBase.RunImpl() Line 43 C#
System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.__Canon>.AsyncStateMachineBox<System.__Canon>.ExecutionContextCallback(object s) Unknown
System.Private.CoreLib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) Unknown
System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<DotNetReleaser.Runners.DotNetResult>.AsyncStateMachineBox<DotNetReleaser.Runners.DotNetRunnerBase.<RunImpl>d__16>.MoveNext(System.Threading.Thread threadPoolThread) Unknown
System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.__Canon>.AsyncStateMachineBox<System.__Canon>.MoveNext() Unknown
System.Private.CoreLib.dll!System.Runtime.CompilerServices.TaskAwaiter.OutputWaitEtwEvents.AnonymousMethod__12_0(System.Action innerContinuation, System.Threading.Tasks.Task innerTask) Unknown
System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke() Unknown
System.Private.CoreLib.dll!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action action, bool allowInlining) Unknown
System.Private.CoreLib.dll!System.Threading.Tasks.Task.RunContinuations(object continuationObject) Unknown
System.Private.CoreLib.dll!System.Threading.Tasks.Task.FinishContinuations() Unknown
System.Private.CoreLib.dll!System.Threading.Tasks.Task<System.__Canon>.TrySetResult(System.__Canon result) Unknown
System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.__Canon>.SetExistingTaskResult(System.Threading.Tasks.Task<System.__Canon> task, System.__Canon result) Unknown
System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<DotNetReleaser.Runners.DotNetResult>.SetResult(DotNetReleaser.Runners.DotNetResult result) Unknown
[Completed] dotnet-releaser.dll!DotNetReleaser.Runners.DotNetRunnerBase.Run(string command, System.Collections.Generic.IEnumerable<string> args, System.Collections.Generic.IReadOnlyDictionary<string, object> properties, string workingDirectory) Line 96 C#
System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.__Canon>.AsyncStateMachineBox<System.__Canon>.ExecutionContextCallback(object s) Unknown
System.Private.CoreLib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) Unknown
System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<DotNetReleaser.Runners.DotNetResult>.AsyncStateMachineBox<DotNetReleaser.Runners.DotNetRunnerBase.<Run>d__20>.MoveNext(System.Threading.Thread threadPoolThread) Unknown
System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.__Canon>.AsyncStateMachineBox<System.__Canon>.MoveNext() Unknown
System.Private.CoreLib.dll!System.Runtime.CompilerServices.TaskAwaiter.OutputWaitEtwEvents.AnonymousMethod__12_0(System.Action innerContinuation, System.Threading.Tasks.Task innerTask) Unknown
System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke() Unknown
System.Private.CoreLib.dll!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action action, bool allowInlining) Unknown
System.Private.CoreLib.dll!System.Threading.Tasks.Task.RunContinuations(object continuationObject) Unknown
System.Private.CoreLib.dll!System.Threading.Tasks.Task.FinishContinuations() Unknown
System.Private.CoreLib.dll!System.Threading.Tasks.Task<System.__Canon>.TrySetResult(System.__Canon result) Unknown
System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.__Canon>.SetExistingTaskResult(System.Threading.Tasks.Task<System.__Canon> task, System.__Canon result) Unknown
System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<CliWrap.CommandResult>.SetResult(CliWrap.CommandResult result) Unknown
[Completed] CliWrap.dll!CliWrap.Command.AttachAsync(CliWrap.Utils.ProcessEx process, System.Threading.CancellationToken cancellationToken) Line 465 C#
System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<CliWrap.CommandResult>.AsyncStateMachineBox<CliWrap.Command.<AttachAsync>d__47>.ExecutionContextCallback(object s) Unknown
System.Private.CoreLib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) Unknown
System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<CliWrap.CommandResult>.AsyncStateMachineBox<CliWrap.Command.<AttachAsync>d__47>.MoveNext(System.Threading.Thread threadPoolThread) Unknown
System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.__Canon>.AsyncStateMachineBox<CliWrap.Command.<AttachAsync>d__47>.MoveNext() Unknown
System.Private.CoreLib.dll!System.Runtime.CompilerServices.TaskAwaiter.OutputWaitEtwEvents.AnonymousMethod__12_0(System.Action innerContinuation, System.Threading.Tasks.Task innerTask) Unknown
System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke() Unknown
System.Private.CoreLib.dll!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action action, bool allowInlining) Unknown
System.Private.CoreLib.dll!System.Threading.Tasks.Task.RunContinuations(object continuationObject) Unknown
System.Private.CoreLib.dll!System.Threading.Tasks.Task.FinishContinuations() Unknown
System.Private.CoreLib.dll!System.Threading.Tasks.Task<System.Threading.Tasks.VoidTaskResult>.TrySetResult(System.Threading.Tasks.VoidTaskResult result) Unknown
System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.Threading.Tasks.VoidTaskResult>.SetExistingTaskResult(System.Threading.Tasks.Task<System.Threading.Tasks.VoidTaskResult> task, System.Threading.Tasks.VoidTaskResult result) Unknown
System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder.SetResult() Unknown
[Completed] CliWrap.dll!CliWrap.Utils.ProcessEx.WaitUntilExitAsync() Line 125 C#
System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.Threading.Tasks.VoidTaskResult>.AsyncStateMachineBox<CliWrap.Utils.ProcessEx.<WaitUntilExitAsync>d__36>.ExecutionContextCallback(object s) Unknown
System.Private.CoreLib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) Unknown
System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.Threading.Tasks.VoidTaskResult>.AsyncStateMachineBox<CliWrap.Utils.ProcessEx.<WaitUntilExitAsync>d__36>.MoveNext(System.Threading.Thread threadPoolThread) Unknown
System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.Threading.Tasks.VoidTaskResult>.AsyncStateMachineBox<CliWrap.Utils.ProcessEx.<WaitUntilExitAsync>d__36>.MoveNext() Unknown
System.Private.CoreLib.dll!System.Runtime.CompilerServices.TaskAwaiter.OutputWaitEtwEvents.AnonymousMethod__12_0(System.Action innerContinuation, System.Threading.Tasks.Task innerTask) Unknown
System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke() Unknown
System.Private.CoreLib.dll!System.Threading.Tasks.AwaitTaskContinuation.System.Threading.IThreadPoolWorkItem.Execute() Unknown
System.Private.CoreLib.dll!System.Threading.ThreadPoolWorkQueue.Dispatch() Unknown
System.Private.CoreLib.dll!System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() Unknown
System.Private.CoreLib.dll!System.Threading.Thread.StartCallback() Unknown
[Native to Managed Transition]
kernel32.dll!00007ff82bdd54e0() Unknown
ntdll.dll!00007ff82cb4485b() Unknown
[Async Call Stack]
[Async] dotnet-releaser.dll!DotNetReleaser.ReleaserApp.RunMSBuild(string target, System.Collections.Generic.IDictionary<string, object> properties) Line 187 C#
[Async] dotnet-releaser.dll!DotNetReleaser.ReleaserApp.LoadPackageInfo() Line 18 C#
[Async] dotnet-releaser.dll!DotNetReleaser.ReleaserApp.RunImpl() Line 187 C#
[Async] dotnet-releaser.dll!DotNetReleaser.ReleaserApp.Run.AnonymousMethod__6(System.Threading.CancellationToken token) Line 130 C#
[Async] McMaster.Extensions.CommandLineUtils.dll!McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(string[] args, System.Threading.CancellationToken cancellationToken) Unknown
[Async] dotnet-releaser.dll!DotNetReleaser.ReleaserApp.Run(string[] args) Line 145 C#
[Async] dotnet-releaser.dll!Program.<Main>$(string[] args) Line 2 C#
Interesting, so in your case the exception happens in the original process that you're debugging! You don't have any child processes.
I just now got into the same state as you somehow, so I will investigate that.
Hmm the /profileevaluation flag seems to be set in the corrupt binlog
ARGH FOUND IT. Rookie mistake on my part.
@rgwood thanks again for your patience!
Could you please locally bump MSBuild.StructuredLogger to this version: https://www.nuget.org/packages/MSBuild.StructuredLogger/2.1.630 This is how you bump: https://github.com/xoofx/dotnet-releaser/pull/9/files
and do a git clean -xdff and full rebuild of dotnet-releaser.
Here's what I think the fix is: https://github.com/KirillOsenkov/MSBuildStructuredLog/commit/28c95fef870802e4e72dc7c3c779a59564d61040
Nice, that fixes it. Thanks for another super quick fix!
Hi again! I had some time to test the latest dotnet-releaser (v0.1.6, 5ac4c65) and run it. It's on v2.1.624 of MSBuild.StructuredLogger and now it's encountering a new failure :'(
If I clone dotnet-releaser and run it in VS like you showed me, it breaks on lot of exceptions one after the other. Doubt you need them all but just in case, here they are in order:
Version Info
VS Version 17.1.0 Preview 4.0