{"record":{"id":"fb7307ff061cab4e","repo":"oracle/graal","slug":"could-not-determine-cpu-from-vm-info-in-s-n-s","errorCode":null,"errorMessage":"Could not determine CPU from vm_info in %s:%n%s","messagePattern":"Could not determine CPU from vm_info in (.+?):%n(.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/disassembler/MachCode.java","lineNumber":148,"sourceCode":"        String bestGuess = null;\n        String bestGuessLine = null;\n        for (String line : input.split(\"\\n\")) {\n            Matcher matcher = osArch.matcher(line);\n            if (matcher.find()) {\n                return fromArch(matcher.group(1), line);\n            }\n            String guess = null;\n            if (amd64.matcher(line).find()) {\n                guess = \"amd64\";\n            }\n            if (aarch64.matcher(line).find()) {\n                guess = \"aarch64\";\n            }\n            if (line.startsWith(\"vm_info:\")) {\n                if (guess != null) {\n                    return fromArch(guess, String.format(\"Selected from input line \\\"%s\\\" in %s\", line, inputName));\n                }\n                throw new IllegalArgumentException(String.format(\"Could not determine CPU from vm_info in %s:%n%s\", inputName, input));\n            }\n            if (line.contains(\" built on \")) {\n                // Xinternalversion line from the normal HotSpot log\n                if (guess != null) {\n                    return fromArch(guess, String.format(\"Selected from input line \\\"%s\\\" in %s\", line, inputName));\n                }\n            }\n            if (bestGuess == null) {\n                if (guess != null) {\n                    bestGuess = guess;\n                    bestGuessLine = line;\n                }\n            } else {\n                if (!bestGuess.equals(guess)) {\n                    bestGuess = \"unknown\";\n                }\n            }\n        }","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/disassembler/MachCode.java#L130-L166","documentation":"While heuristically probing an hs_err or .jtr input for the CPU type, MachCode found a line starting with \"vm_info:\" but could not match either the amd64 or aarch64 patterns in it, so it cannot decide which Disassembler to build. The message includes the input name and the whole input, making the offending vm_info line visible. It means the log's VM metadata does not identify a supported CPU.","triggerScenarios":"MachCode.initDisassembler with userArch == null and no machcode.arch property, run on an input whose \"vm_info:\" line mentions a different ISA (e.g. riscv64, ppc) or omits CPU identification entirely. The vm_info branch requires a non-null guess and throws otherwise.","commonSituations":"Disassembling crash logs from non-x86/arm systems (RISC-V, POWER), truncated/edited hs_err files where vm_info was mangled, or logs from exotic JVM builds with nonstandard vm_info wording.","solutions":["Pass the architecture explicitly (userArch, e.g. \"amd64\") so probing is skipped.","Set the machcode.arch / os.arch fallback property to the correct ISA.","If the log is from an unsupported ISA, disassemble it with a native tool (objdump) instead of this library.","For truncated logs, restore or fix the vm_info line so the pattern match succeeds."],"exampleFix":"# before\njava DisassemblerTool crash_riscv.hs_err\n# after (only if content is really amd64-decodable, or on an amd64 host)\njava -Dmachcode.arch=amd64 DisassemblerTool crash.hs_err","handlingStrategy":"validation","validationCode":"// supply the arch explicitly so heuristic probing never runs\nDisassembler d = MachCode.initDisassembler(inputName, input, log, System.getProperty(\"machcode.arch\", \"amd64\"));","typeGuard":null,"tryCatchPattern":"try { MachCode.initDisassembler(f, input, log, null); } catch (IllegalArgumentException e) { if (e.getMessage().contains(\"vm_info\")) { /* ask user for --arch or reject file */ } else throw e; }","preventionTips":["Always pass an explicit arch when the input format is not guaranteed.","Prefer logs from supported ISAs; route riscv/ppc logs to native objdump.","Do not edit hs_err files by hand — vm_info is a key probe anchor."],"tags":["graalvm","hsdis","hs-err-log","machcode"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}