{"record":{"id":"be98512b23c3f7da","repo":"dotnet/runtime","slug":"invalid-arch","errorCode":null,"errorMessage":"Invalid arch.","messagePattern":"Invalid arch\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/coreclr/scripts/superpmi_aspnet.py","lineNumber":113,"sourceCode":"    Return:\n        (str) : name of the benchmnark machine\n    \"\"\"\n\n    if coreclr_args.arch == \"x64\":\n        if coreclr_args.host_os == \"windows\":\n            return \"aspnet-perf-win\"\n#            return \"aspnet-citrine-win\"\n        elif coreclr_args.host_os == \"linux\":\n            return \"aspnet-perf-lin\"\n        else:\n            raise RuntimeError(\"Invalid OS for x64.\")\n    elif coreclr_args.arch == \"arm64\":\n        if coreclr_args.host_os == \"linux\":\n            return \"aspnet-citrine-arm\"\n        else:\n            raise RuntimeError(\"Invalid OS for arm64.\")\n    else:\n        raise RuntimeError(\"Invalid arch.\")\n\ndef build_and_run(coreclr_args):\n    \"\"\"Run perf scenarios under crank and collect data with SPMI\"\n\n    Args:\n        coreclr_args (CoreClrArguments): Arguments use to drive\n        output_mch_name (string): Name of output mch file name\n    \"\"\"\n    source_directory = coreclr_args.source_directory\n    target_arch = coreclr_args.arch\n    target_os = coreclr_args.host_os\n\n    checked_root = path.join(source_directory, \"artifacts\", \"bin\", \"coreclr\", target_os + \".\" + coreclr_args.arch + \".Checked\")\n    release_root = path.join(source_directory, \"artifacts\", \"bin\", \"coreclr\", target_os + \".\" + coreclr_args.arch + \".Release\")\n\n    # We'll use repo script to install dotnet\n    dotnet_install_script_name = \"dotnet-install.cmd\" if is_windows else \"dotnet-install.sh\"\n    dotnet_install_script_path = path.join(source_directory, \"eng\", \"common\", dotnet_install_script_name)","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/dotnet/runtime/blob/60108ba66eb7d1d12f595480091b4ad80a24b172/src/coreclr/scripts/superpmi_aspnet.py#L95-L131","documentation":"Raised by determine_benchmark_machine() at src/coreclr/scripts/superpmi_aspnet.py:113 when arch is neither 'x64' nor 'arm64'. setup_args() already whitelists arch to x64/arm64, so this is a defensive guard reached only if that validation is bypassed by a direct call.","triggerScenarios":"Calling determine_benchmark_machine() directly (not via setup_args) with an arch like 'x86' or 'arm', or after a future arch addition that updates setup_args but not this function.","commonSituations":"Programmatic use of the function skipping setup_args validation.","solutions":["Pass -arch as x64 or arm64.","If calling determine_benchmark_machine() directly, validate arch beforehand."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if coreclr_args.arch.lower() not in ('x64', 'arm64'):\n    raise SystemExit('arch must be x64 or arm64')","typeGuard":"def is_supported_arch(arch: str) -> bool:\n    return arch.lower() in ('x64', 'arm64')","tryCatchPattern":null,"preventionTips":["Always go through setup_args(), which enforces the arch whitelist."],"tags":["dotnet","coreclr","superpmi","architecture","configuration"],"backgroundTag":null,"analyzedSha":"60108ba66eb7d1d12f595480091b4ad80a24b172","analyzedAt":"2026-08-10T18:54:11.478Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}