{"record":{"id":"ad474fa7c53fd06f","repo":"NationalSecurityAgency/ghidra","slug":"interrupted","errorCode":null,"errorMessage":"interrupted: ","messagePattern":"interrupted: ","errorType":"exception","errorClass":"DecompileException","httpStatus":null,"severity":"warning","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ParallelDecompileTask.java","lineNumber":58,"sourceCode":"\t// save for shutting down abnormally\n\tprivate DecompilerConcurrentQ<Function, Function> queue;\n\n\tpublic ParallelDecompileTask(Program prog, TaskMonitor mon, DecompileFunctionTask ftask) {\n\t\tprogram = prog;\n\t\tif (mon != null)\n\t\t\ttaskMonitor = mon;\n\t\tftask_template = ftask;\n\n\t\tftask_template.initializeGlobal(program);\n\t}\n\n\tpublic void decompile(Iterator<Function> iter, int functionCount) throws DecompileException {\n\t\ttry {\n\t\t\tdoDecompile(iter, functionCount);\n\t\t}\n\t\tcatch (InterruptedException e) {\n\t\t\tMsg.error(this, \"Problem with decompiler worker thread\", e);\n\t\t\tthrow new DecompileException(\"interrupted\", e.getMessage());\n\t\t}\n\t\tcatch (Exception t) {\n\t\t\tMsg.error(this, \"Problem with decompiler worker thread\", t);\n\t\t\tDecompileException decompileException =\n\t\t\t\tnew DecompileException(\"execution\", t.getMessage());\n\t\t\tdecompileException.initCause(t);\n\t\t\tthrow decompileException;\n\t\t}\n\t}\n\n\tprivate void doDecompile(Iterator<Function> iter, int functionCount)\n\t\t\tthrows InterruptedException, Exception {\n\t\ttaskMonitor.setMessage(\"Analyzing functions...\");\n\t\ttaskMonitor.initialize(functionCount);\n\n\t\tCachingPool<DecompileFunctionTask> decompilerPool =\n\t\t\tnew CachingPool<DecompileFunctionTask>(new DecompilerTaskFactory(ftask_template));\n\t\tQCallback<Function, Function> callback = new ParallelDecompilerCallback(decompilerPool);","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ParallelDecompileTask.java#L40-L76","documentation":"Thrown by ParallelDecompileTask.decompile when the decompile worker thread is interrupted (InterruptedException). It wraps the interruption as a DecompileException with source 'interrupted' and the interrupt's message. This typically indicates an external cancellation or shutdown of the parallel decompile pool rather than a logic error.","triggerScenarios":"doDecompile throws InterruptedException because a worker thread was interrupted: the user cancelled the operation, the TaskMonitor was cancelled, a timeout fired, or the JVM/application is shutting down the decompiler threads.","commonSituations":"User cancels a long-running BSim signature generation job. A TaskMonitor cancellation propagates as an interrupt. Thread pool shutdown during application exit. An explicit timeout/cancel from a higher-level orchestration layer.","solutions":["Treat this as a cancellation, not a defect: check whether the operation was intentionally cancelled (monitor.isCancelled()).","If unexpected, ensure nothing is prematurely interrupting the decompiler worker threads (e.g. an overly aggressive timeout).","Restore the interrupt status in your handler if you swallow it: Thread.currentThread().interrupt().","Clean up partial decompiler resources and report the cancellation to the user."],"exampleFix":"// before\ncatch (InterruptedException e) {\n    throw new DecompileException(\"interrupted\", e.getMessage());\n}\n// after\ncatch (InterruptedException e) {\n    Thread.currentThread().interrupt(); // restore interrupt status\n    throw new DecompileException(\"interrupted\", \"decompile cancelled\");\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    parallelTask.decompile(iter, functionCount);\n} catch (DecompileException e) {\n    if (\"interrupted\".equals(e.getSource())) {\n        log.info(\"Decompile was interrupted/cancelled\");\n        Thread.currentThread().interrupt(); // restore flag\n        // handle cancellation gracefully (cleanup + report)\n    } else {\n        throw e;\n    }\n}","preventionTips":["Distinguish cancellation (InterruptedException) from real failures in your handler.","Always restore the interrupt flag with Thread.currentThread().interrupt() if you catch InterruptedException.","Wire the TaskMonitor so user cancellations propagate cleanly rather than as opaque errors."],"tags":["bsim","decompiler","threading","cancellation"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}