Clion IDE not killing processes

I am using the following Clion build for development:

CLion 2016.1.1
Build #CL-145.597, built on March 31, 2016
JRE: 1.8.0_60-b27 amd64
JVM: Java HotSpot(TM) 64-Bit Server VM by Oracle Corporation

When I run processes through the IDE and click the "Stop" or "Close" buttons on the Run Toolbar the processes are not actually killed, they are left to finish on their own.

The following example will be left running

#include <iostream>
#include <unistd.h>

using namespace std;

int main() {

while(true){
sleep(1);
}

return 0;
}

even after the IDE outputs the following when the stop button is pressed:

C:\Users\Developer\.CLion2016.1\system\cmake\generated\TestIssue-af67feb6\af67feb6\Debug\TestIssue.exe

Process finished with exit code 1

Running ps in the cygwin terminal shows that the process is still running in the background and has not actually been terminated:

$ ps
PID PPID PGID WINPID TTY UID STIME COMMAND
7684 3304 7684 7424 pty6 1005 09:58:08 /usr/bin/ps
3304 7504 3304 9356 pty6 1005 09:57:43 /usr/bin/bash
7128 9752 7128 3256 pty4 1005 09:55:33 /cygdrive/c/Users/Developer/.CLion2016.1/system/cmake/generated/TestIssue-af67feb6/af67feb6/Debug/TestIssue
7504 1 7504 7504 ? 1005 09:57:43 /usr/bin/mintty
8684 6080 8684 7696 pty2 1005 09:54:46 /cygdrive/c/Users/Developer/.CLion2016.1/system/cmake/generated/TestIssue-af67feb6/af67feb6/Debug/TestIssue

Based on the information on this page, my understanding was that the stop / and close buttons were supposed to terminate the running process? Is this a bug or intended functionality?

2 comments

Hi Byron!

Thank you for the report, I created the issue https://youtrack.jetbrains.com/issue/CPP-6434. Feel free to vote for it!

As a workaround you can disable 'run.processes.with.pty' option in the Registry (Help -> Find Action -> Registry...)

0

I notice the same on El Capitan and when I switch to GDB.

0

Please sign in to leave a comment.