diff --git a/iast-agent/src/main/java/com/secnium/iast/agent/AttachLauncher.java b/iast-agent/src/main/java/com/secnium/iast/agent/AttachLauncher.java index 245967b99..05395dea1 100644 --- a/iast-agent/src/main/java/com/secnium/iast/agent/AttachLauncher.java +++ b/iast-agent/src/main/java/com/secnium/iast/agent/AttachLauncher.java @@ -20,6 +20,7 @@ public static void attach(String pid, String args) { vmObj = VirtualMachine.attach(pid); vmObj.loadAgent(AGENT_PATH, "token=" + args); LogUtils.info("attach to process " + pid + " success."); + vmObj.detach(); } catch (AttachNotSupportedException e) { LogUtils.error("attach failed, reason: Attach not support"); } catch (IOException e) { diff --git a/iast-agent/src/main/java/com/secnium/iast/agent/manager/EngineManager.java b/iast-agent/src/main/java/com/secnium/iast/agent/manager/EngineManager.java index d51c01636..64daabb8d 100644 --- a/iast-agent/src/main/java/com/secnium/iast/agent/manager/EngineManager.java +++ b/iast-agent/src/main/java/com/secnium/iast/agent/manager/EngineManager.java @@ -277,7 +277,8 @@ public synchronized boolean uninstall() { classOfEngine.getMethod("destroy", String.class, String.class, Instrumentation.class) .invoke(null, launchMode, this.properties.getPropertiesFilePath(), inst); Agent.appendToolsPath(); - AttachLauncher.detach(ppid); + //no necessary to do detach here + // AttachLauncher.detach(ppid); } } catch (IllegalAccessException e) { e.printStackTrace();