{"record":{"id":"122b4110a83904bb","repo":"oracle/graal","slug":"invalid-primitive-component-type","errorCode":null,"errorMessage":"invalid primitive component type {}","messagePattern":"invalid primitive component type (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"espresso/src/com.oracle.truffle.espresso/src/com/oracle/truffle/espresso/runtime/JDWPContextImpl.java","lineNumber":200,"sourceCode":"            switch (slashName) {\n                case \"I\":\n                    return new KlassRef[]{context.getMeta()._int};\n                case \"Z\":\n                    return new KlassRef[]{context.getMeta()._boolean};\n                case \"S\":\n                    return new KlassRef[]{context.getMeta()._short};\n                case \"C\":\n                    return new KlassRef[]{context.getMeta()._char};\n                case \"B\":\n                    return new KlassRef[]{context.getMeta()._byte};\n                case \"J\":\n                    return new KlassRef[]{context.getMeta()._long};\n                case \"D\":\n                    return new KlassRef[]{context.getMeta()._double};\n                case \"F\":\n                    return new KlassRef[]{context.getMeta()._float};\n                default:\n                    throw new IllegalStateException(\"invalid primitive component type \" + slashName);\n            }\n        } else if (slashName.startsWith(\"[\")) {\n            // array type\n            int dimensions = 0;\n            for (char c : slashName.toCharArray()) {\n                if ('[' == c) {\n                    dimensions++;\n                } else {\n                    break;\n                }\n            }\n            String componentRawName = slashName.substring(dimensions);\n            if (componentRawName.length() == 1) {\n                // primitive\n                switch (componentRawName) {\n                    case \"I\":\n                        return new KlassRef[]{context.getMeta()._int.getArrayClassNoCreate(dimensions)};\n                    case \"Z\":","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/espresso/src/com.oracle.truffle.espresso/src/com/oracle/truffle/espresso/runtime/JDWPContextImpl.java#L182-L218","documentation":"JDWPContextImpl parses a class-file type signature into KlassRefs; when the name denotes a primitive (single letter per JVMS: V Z S C B J D F) but the letter is none of them, it throws IllegalStateException('invalid primitive component type'). This is a debugger-backend invariant: only valid JVM primitive descriptors may reach this branch.","triggerScenarios":"A JDWP client (debugger) sends a signature string whose first character implies a primitive (or the fallback default case is reached) with an invalid letter, e.g. 'A', 'P', or a typo'd descriptor; usually via ReferenceType queries with hand-built signature strings.","commonSituations":"Custom JDWP clients or IDE plugins sending malformed type signatures; tools upgrading across JVM versions where new descriptor forms appear; rarely, an Espresso bug producing a bad signature.","solutions":["Fix the JDWP client to send valid JVMS primitive descriptors (V, Z, S, C, B, J, D, F) or proper L...;/[... descriptors.","Validate/normalize signature strings before sending them to the debugger backend.","If the signature comes from the IDE, verify the IDE and GraalVM versions are compatible; report a GraalVM bug if a well-formed signature triggers it."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"private static final Set<String> VALID_PRIM = Set.of(\"V\",\"Z\",\"S\",\"C\",\"B\",\"J\",\"D\",\"F\");\nboolean ok = name.length() == 1 && VALID_PRIM.contains(name);","typeGuard":null,"tryCatchPattern":"try {\n    refs = parseSignature(sig);\n} catch (IllegalStateException e) {\n    if (e.getMessage().startsWith(\"invalid primitive component type\")) { /* bad signature from client */ }\n}","preventionTips":["Generate JDWP signatures from Class.getName()/descriptor helpers instead of string literals.","Unit-test descriptor builders against known-good JVM descriptors."],"tags":["espresso","jdwp","debugging","type-signature"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}