Skip to content
This repository was archived by the owner on Jul 13, 2026. It is now read-only.
This repository was archived by the owner on Jul 13, 2026. It is now read-only.

macOS CI: Test host crash in JdkInfo.GetJavaProperties — StringBuilder concurrency issue #336

Closed

Description

@jonathanpeppers

Summary

The macOS CI test run for Xamarin.Android.Tools.AndroidSdk-Tests is crashing the test host process with an unhandled System.ArgumentException: Destination is too short in JdkInfo.GetJavaProperties.

All 224 tests pass, but the test host crashes after completion, causing the overall run to be marked as aborted/failed.

Stack Trace

Unhandled exception. System.ArgumentException: Destination is too short. (Parameter 'destination')
   at System.Text.StringBuilder.AppendWithExpansion(Char& value, Int32 valueCount)
   at System.Text.StringBuilder.Append(String value)
   at System.Text.StringBuilder.AppendLine(String value)
   at Xamarin.Android.Tools.JdkInfo.<>c__DisplayClass49_0.<GetJavaProperties>b__0(Object o, DataReceivedEventArgs e) in JdkInfo.cs:line 282
   at System.Diagnostics.AsyncStreamReader.FlushMessageQueue(Boolean rethrowInNewThread)

Environment

Analysis

The crash occurs in the OutputDataReceived callback at JdkInfo.cs:line 282, which appends to a StringBuilder. The Destination is too short exception from StringBuilder.AppendWithExpansion suggests a possible concurrency issue — StringBuilder is not thread-safe, and OutputDataReceived is called from a background thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions