Skip to content

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

@danmoseley

Description

@danmoseley

Got this error in CI

 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)

Exception is from here
https://github.com/dotnet/runtime/blob/master/src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L367

The string builder here is apparently corrupted - eg ToString() on an empty StringBuilder does not throw - suggesting that writing to it happened after WaitForExit() returned
https://github.com/dotnet/runtime/blob/master/src/tasks/AppleAppBuilder/Utils.cs#L75

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions