KirillOsenkov / MSBuildStructuredLog

A logger for MSBuild that records a structured representation of executed targets, tasks, property and item values.
MIT License
1.44k stars 190 forks source link

System.IO.InvalidDataException in dotnet-releaser #562

Closed rgwood closed 2 years ago

rgwood commented 2 years ago

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 :'(

? dotnet-releaser build --force dotnet-releaser.toml
info: dotnet-releaser[0]
      Loading configuration from C:\Users\reill\source\releaser-repro\dotnet-releaser.toml
info: dotnet-releaser[1]
      Adding default profile for platform [win-x64] with [Zip] package
      Adding default profile for platform [win-arm] with [Zip] package
      Adding default profile for platform [win-arm64] with [Zip] package
      Adding default profile for platform [linux-x64] with [Deb, Tar] packages
      Adding default profile for platform [linux-arm] with [Deb, Tar] packages
      Adding default profile for platform [linux-arm64] with [Deb, Tar] packages
      Adding default profile for platform [rhel-x64] with [Rpm, Tar] packages
      Adding default profile for platform [osx-x64] with [Tar] package
      Adding default profile for platform [osx-arm64] with [Tar] package

Unexpected error Sequence contains no matching element

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:

System.IO.InvalidDataException
  HResult=0x80131501
  Message=String record number 1536 is invalid: string index -1 is not within 1200.
  Source=StructuredLogger
  StackTrace:
   at Microsoft.Build.Logging.StructuredLogger.BuildEventArgsReader.GetStringFromRecord(Int32 index) in C:\MSBuildStructuredLog\src\StructuredLogger\BinaryLogger\BuildEventArgsReader.cs:line 1189
System.OperationCanceledException
  HResult=0x8013153B
  Message=The operation was canceled.
  Source=System.Private.CoreLib
  StackTrace:
   at System.Threading.CancellationToken.ThrowOperationCanceledException()
System.OperationCanceledException
  HResult=0x8013153B
  Message=The operation was canceled.
  Source=System.Private.CoreLib
  StackTrace:
   at System.Threading.SemaphoreSlim.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
System.InvalidOperationException
  HResult=0x80131509
  Message=Sequence contains no matching element
  Source=System.Linq
  StackTrace:
   at System.Linq.ThrowHelper.ThrowNoMatchException()
System.InvalidOperationException
  HResult=0x80131509
  Message=Sequence contains no matching element
  Source=System.Linq
  StackTrace:
   at System.Linq.ThrowHelper.ThrowNoMatchException()
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate)
   at DotNetReleaser.ReleaserApp.<LoadPackageInfo>d__28.MoveNext() in C:\Users\reill\github\dotnet-releaser\src\dotnet-releaser\ReleaserApp.Packaging.cs:line 20
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

  This exception was originally thrown at this call stack:
    System.Linq.ThrowHelper.ThrowNoMatchException()
    System.Linq.Enumerable.First<TSource>(System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource, bool>)
    DotNetReleaser.ReleaserApp.LoadPackageInfo() in ReleaserApp.Packaging.cs
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.InvalidOperationException
  HResult=0x80131509
  Message=Sequence contains no matching element
  Source=System.Linq
  StackTrace:
   at System.Linq.ThrowHelper.ThrowNoMatchException()
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate)
   at DotNetReleaser.ReleaserApp.<LoadPackageInfo>d__28.MoveNext() in C:\Users\reill\github\dotnet-releaser\src\dotnet-releaser\ReleaserApp.Packaging.cs:line 20
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at DotNetReleaser.ReleaserApp.<RunImpl>d__11.MoveNext() in C:\Users\reill\github\dotnet-releaser\src\dotnet-releaser\ReleaserApp.cs:line 186
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

  This exception was originally thrown at this call stack:
    System.Linq.ThrowHelper.ThrowNoMatchException()
    System.Linq.Enumerable.First<TSource>(System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource, bool>)
    DotNetReleaser.ReleaserApp.LoadPackageInfo() in ReleaserApp.Packaging.cs
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
    System.Runtime.CompilerServices.TaskAwaiter<TResult>.GetResult()
    DotNetReleaser.ReleaserApp.RunImpl() in ReleaserApp.cs
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.InvalidOperationException
  HResult=0x80131509
  Message=Sequence contains no matching element
  Source=System.Linq
  StackTrace:
   at System.Linq.ThrowHelper.ThrowNoMatchException()
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate)
   at DotNetReleaser.ReleaserApp.<LoadPackageInfo>d__28.MoveNext() in C:\Users\reill\github\dotnet-releaser\src\dotnet-releaser\ReleaserApp.Packaging.cs:line 20
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at DotNetReleaser.ReleaserApp.<RunImpl>d__11.MoveNext() in C:\Users\reill\github\dotnet-releaser\src\dotnet-releaser\ReleaserApp.cs:line 186
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at DotNetReleaser.ReleaserApp.<>c__DisplayClass10_2.<<Run>b__6>d.MoveNext() in C:\Users\reill\github\dotnet-releaser\src\dotnet-releaser\ReleaserApp.cs:line 129
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

  This exception was originally thrown at this call stack:
    System.Linq.ThrowHelper.ThrowNoMatchException()
    System.Linq.Enumerable.First<TSource>(System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource, bool>)
    DotNetReleaser.ReleaserApp.LoadPackageInfo() in ReleaserApp.Packaging.cs
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
    System.Runtime.CompilerServices.TaskAwaiter<TResult>.GetResult()
    DotNetReleaser.ReleaserApp.RunImpl() in ReleaserApp.cs
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
    ...
    [Call Stack Truncated]
System.InvalidOperationException
  HResult=0x80131509
  Message=Sequence contains no matching element
  Source=System.Linq
  StackTrace:
   at System.Linq.ThrowHelper.ThrowNoMatchException()
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate)
   at DotNetReleaser.ReleaserApp.<LoadPackageInfo>d__28.MoveNext() in C:\Users\reill\github\dotnet-releaser\src\dotnet-releaser\ReleaserApp.Packaging.cs:line 20
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at DotNetReleaser.ReleaserApp.<RunImpl>d__11.MoveNext() in C:\Users\reill\github\dotnet-releaser\src\dotnet-releaser\ReleaserApp.cs:line 186
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at DotNetReleaser.ReleaserApp.<>c__DisplayClass10_2.<<Run>b__6>d.MoveNext() in C:\Users\reill\github\dotnet-releaser\src\dotnet-releaser\ReleaserApp.cs:line 129
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.<ExecuteAsync>d__154.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

  This exception was originally thrown at this call stack:
    System.Linq.ThrowHelper.ThrowNoMatchException()
    System.Linq.Enumerable.First<TSource>(System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource, bool>)
    DotNetReleaser.ReleaserApp.LoadPackageInfo() in ReleaserApp.Packaging.cs
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
    System.Runtime.CompilerServices.TaskAwaiter<TResult>.GetResult()
    DotNetReleaser.ReleaserApp.RunImpl() in ReleaserApp.cs
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
    ...
    [Call Stack Truncated]

Version Info

VS Version 17.1.0 Preview 4.0

❯ dotnet --info
.NET SDK (reflecting any global.json):
 Version:   6.0.200-preview.22055.15
 Commit:    a3c3a2bf3b

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.22000
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\6.0.200-preview.22055.15\

Host (useful for support):
  Version: 6.0.1
  Commit:  3a25a7f1cc

.NET SDKs installed:
  3.1.416 [C:\Program Files\dotnet\sdk]
  5.0.404 [C:\Program Files\dotnet\sdk]
  6.0.101 [C:\Program Files\dotnet\sdk]
  6.0.200-preview.21617.4 [C:\Program Files\dotnet\sdk]
  6.0.200-preview.22055.15 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.1.21 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.21 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.21 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
KirillOsenkov commented 2 years ago

Repro steps: https://github.com/xoofx/dotnet-releaser/issues/5#issue-1118369304

KirillOsenkov commented 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.

KirillOsenkov commented 2 years ago

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
rgwood commented 2 years ago

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#
KirillOsenkov commented 2 years ago

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.

image

KirillOsenkov commented 2 years ago

Hmm the /profileevaluation flag seems to be set in the corrupt binlog

KirillOsenkov commented 2 years ago

ARGH FOUND IT. Rookie mistake on my part.

KirillOsenkov commented 2 years ago

@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

rgwood commented 2 years ago

Nice, that fixes it. Thanks for another super quick fix!