{"record":{"id":"337d2e068e0a0177","repo":"oracle/graal","slug":"invalid-jdwp-option-address-value-must-be-in","errorCode":null,"errorMessage":"Invalid JDWP option, address: {value}. Must be in the 0 - 65535 range.","messagePattern":"Invalid JDWP option, address: (.+?)\\. Must be in the 0 - 65535 range\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"espresso/src/com.oracle.truffle.espresso/src/com/oracle/truffle/espresso/EspressoOptions.java","lineNumber":435,"sourceCode":"                    throw new IllegalArgumentException(\"JDWP options must be a comma separated list of key=value pairs.\");\n                }\n                String key = keyValue.substring(0, equalsIndex);\n                String value = keyValue.substring(equalsIndex + 1);\n                switch (key) {\n                    case \"address\":\n                        String inputHost = null;\n                        int inputPort = 0;\n                        if (!value.isEmpty()) {\n                            int colonIndex = value.indexOf(':');\n                            if (colonIndex > 0) {\n                                inputHost = value.substring(0, colonIndex);\n                            }\n                            String portStr = value.substring(colonIndex + 1);\n                            long realValue;\n                            try {\n                                realValue = Long.valueOf(portStr);\n                                if (realValue < 0 || realValue > 65535) {\n                                    throw new IllegalArgumentException(\"Invalid JDWP option, address: \" + value + \". Must be in the 0 - 65535 range.\");\n                                }\n                            } catch (NumberFormatException ex) {\n                                throw new IllegalArgumentException(\"Invalid JDWP option, address: \" + value + \". Port is not a number. Must be a number in the 0 - 65535 range.\");\n                            }\n                            inputPort = (int) realValue;\n                        }\n                        host = inputHost;\n                        port = inputPort;\n                        break;\n                    case \"transport\":\n                        if (!\"dt_socket\".equals(value)) {\n                            throw new IllegalArgumentException(\"Invalid transport \" + value + \". Espresso only supports dt_socket currently.\");\n                        }\n                        transport = value;\n                        break;\n                    case \"server\":\n                        server = yesOrNo(key, value);\n                        break;","sourceCodeStart":417,"sourceCodeEnd":453,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/espresso/src/com.oracle.truffle.espresso/src/com/oracle/truffle/espresso/EspressoOptions.java#L417-L453","documentation":"While parsing the JDWP 'address' key, the port component (text after the first ':') is parsed as a long; if the numeric value is <0 or >65535 an IllegalArgumentException is thrown because it is not a valid TCP port.","triggerScenarios":"--java.JDWPOptions=...,address=localhost:70000 or address=:99999; also negative ports like address=host:-1.","commonSituations":"Ports computed from environment variables or dynamically allocated colliding with the range check; typos adding an extra digit; copying an ephemeral port report incorrectly.","solutions":["Use a port in 0-65535, e.g. address=localhost:8000.","If the port comes from a variable, clamp/validate it before launch.","Use port 0 to let the OS assign a free port."],"exampleFix":"# before\n--java.JDWPOptions=transport=dt_socket,server=y,address=localhost:80000\n\n# after\n--java.JDWPOptions=transport=dt_socket,server=y,address=localhost:8000","handlingStrategy":"validation","validationCode":"int port = Integer.parseInt(portStr);\nif (port < 0 || port > 65535) throw new ConfigException(\"Port out of range: \" + port);","typeGuard":"static boolean validPort(String p) {\n    if (!p.matches(\"\\\\d+\")) return false;\n    long v = Long.parseLong(p);\n    return v >= 0 && v <= 65535;\n}","tryCatchPattern":null,"preventionTips":["Validate ports at config-parse time, not launch time.","Prefer port 0 + reading the assigned port for dynamic setups."],"tags":["espresso","graalvm","jdwp","debugging","port","configuration"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}