From d01a15f013795fe8b54e0deb53bcd98a66dbc342 Mon Sep 17 00:00:00 2001 From: Martin Weber Date: Mon, 30 May 2022 22:45:04 +0200 Subject: [PATCH] Bug 580045 - Spurious java.lang.IllegalThreadStateException: Process not Terminated in o.e.c.jsoncdb.core.CompileCommandsJsonParser Signed-off-by: Martin Weber Change-Id: I898b07dca92f47ec7315da3380231b818349139c --- .../builtins/CompilerBuiltinsDetector.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/jsoncdb/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/internal/builtins/CompilerBuiltinsDetector.java b/jsoncdb/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/internal/builtins/CompilerBuiltinsDetector.java index 818fcf36247..971f3371681 100644 --- a/jsoncdb/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/internal/builtins/CompilerBuiltinsDetector.java +++ b/jsoncdb/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/internal/builtins/CompilerBuiltinsDetector.java @@ -130,13 +130,17 @@ public class CompilerBuiltinsDetector { } } if (state != ICommandLauncher.COMMAND_CANCELED) { - // check exit status - final int exitValue = proc.exitValue(); - if (exitValue != 0 && !builtinsDetectionBehavior.suppressErrormessage()) { - // compiler had errors... - String errMsg = String.format(Messages.CompilerBuiltinsDetector_errmsg_command_failed, command, - exitValue); - createMarker(errMsg); + try { + // check exit status + final int exitValue = proc.waitFor(); + if (exitValue != 0 && !builtinsDetectionBehavior.suppressErrormessage()) { + // compiler had errors... + String errMsg = String.format(Messages.CompilerBuiltinsDetector_errmsg_command_failed, command, + exitValue); + createMarker(errMsg); + } + } catch (InterruptedException ex) { + // ignore for now } } } else {