{"record":{"id":"8320193bd2e87396","repo":"NationalSecurityAgency/ghidra","slug":"the-back-end-exited-code-s-before-receiving-a-c","errorCode":null,"errorMessage":"The back-end exited (code=%s) before receiving a connection","messagePattern":"The back-end exited \\(code=(.+?)\\) before receiving a connection","errorType":"exception","errorClass":"EarlyTerminationException","httpStatus":null,"severity":"error","filePath":"Ghidra/Debug/Debugger-rmi-trace/src/main/java/ghidra/app/plugin/core/debug/gui/tracermi/launcher/AbstractTraceRmiLaunchOffer.java","lineNumber":578,"sourceCode":"\t\t\tSocketAddress address) throws Exception;\n\n\tprotected TraceRmiHandler acceptOrSessionEnds(DefaultTraceRmiAcceptor acceptor,\n\t\t\tTraceRmiBackEnd backEnd)\n\t\t\tthrows SocketException, CancelledException, EarlyTerminationException {\n\t\tacceptor.setTimeout(getConnectionTimeoutMillis());\n\t\tCompletableFuture<TraceRmiHandler> futureConnection = CompletableFuture.supplyAsync(() -> {\n\t\t\ttry {\n\t\t\t\treturn acceptor.accept();\n\t\t\t}\n\t\t\tcatch (CancelledException | IOException e) {\n\t\t\t\treturn ExceptionUtils.rethrow(e);\n\t\t\t}\n\t\t});\n\t\t// Because of accept timeout, should be a finite wait\n\t\ttry {\n\t\t\tCompletableFuture.anyOf(backEnd, futureConnection).get();\n\t\t\tif (backEnd.isDone()) {\n\t\t\t\tthrow new EarlyTerminationException(\n\t\t\t\t\t\"The back-end exited (code=%s) before receiving a connection\"\n\t\t\t\t\t\t\t.formatted(backEnd.getNow(null)));\n\t\t\t}\n\t\t\treturn futureConnection.get();\n\t\t}\n\t\tcatch (ExecutionException e) {\n\t\t\tswitch (e.getCause()) {\n\t\t\t\tcase CancelledException ce -> throw ce;\n\t\t\t\tdefault -> throw new AssertionError(e);\n\t\t\t}\n\t\t}\n\t\tcatch (InterruptedException e) {\n\t\t\tthrow new AssertionError(e);\n\t\t}\n\t}\n\n\tpublic static class NoStaticMappingException extends Exception {\n\t\tpublic NoStaticMappingException(String message) {","sourceCodeStart":560,"sourceCodeEnd":596,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Debugger-rmi-trace/src/main/java/ghidra/app/plugin/core/debug/gui/tracermi/launcher/AbstractTraceRmiLaunchOffer.java#L560-L596","documentation":"Thrown as EarlyTerminationException by acceptOrSessionEnds when the back-end CompletableFuture completes (the launched target/tracer process exited) before the Trace RMI acceptor received an incoming connection. The exit code is included. This indicates the debugger back-end died during startup, before it could phone home to Ghidra.","triggerScenarios":"The launch offer starts a back-end process and races its termination future against the RMI accept future. If the process exits first — crash, missing library, wrong architecture, bad arguments — this fires. Common with misconfigured launch arguments, missing target binary, or the back-end script erroring out immediately.","commonSituations":"The target executable path is wrong or the binary is missing; the back-end requires a dependency (e.g., gdb, a JDI agent jar) not installed; the launch arguments contain a typo causing immediate exit; the back-end script printed an error to its terminal and exited with a non-zero code; architecture mismatch (e.g., 32-bit target with 64-bit debugger).","solutions":["Inspect the back-end terminal output for the error that caused the exit (the exit code is in the message).","Verify the target binary path and all launch arguments in the launch offer configuration.","Ensure required debugger/agent dependencies are installed and on PATH for the back-end.","Confirm architecture compatibility between the debugger back-end and the target process."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Before launching, sanity-check the target binary and back-end dependencies\nPath target = Path.of(spec.getArguments().get(0));\nif (!Files.isExecutable(target)) throw new IllegalStateException(\"Target binary missing/not executable\");","typeGuard":null,"tryCatchPattern":"try { handler = acceptOrSessionEnds(acceptor, backEnd); }\ncatch (EarlyTerminationException e) {\n    // read exit code, surface back-end terminal output to user\n    throw e;\n}","preventionTips":["Validate the target binary path and back-end dependencies before launch.","Keep the back-end terminal visible so exit causes are obvious.","Match debugger architecture to the target to avoid immediate back-end crashes."],"tags":["launch","process-exit","connection-failure","ghidra-debug"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}