apache / apache/netbeans

Stopping CppLite build does not kill compiler processes

Open
#7,064 0 comments 0 reactions 0 assignees View on GitHub
C/C++ kind:bug needs:triage
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Apache NetBeans version

Apache NetBeans 20

### What happened

Stopping a build using the stop button on the "Output" pane does not kill all the compiler processes.

The expected behavior of doing this during a long-running build is to kill the build tool (Ninja) as well as its child processes (GCC), or to at least kill the build tool in such a way that it is able to interrupt and clean up all the compilers.

The actual behavior is that the child processes are not killed. All compilers running at the moment the build is stopped keep running. But they appear to be reparented to the init process (systemd).

### Language / Project Type / NetBeans Component

C++ CppLite project

### How to reproduce

Create a C++ program with many .cpp files that each take a long time to compile, and that uses CMake.

Run CMake and tell it to use Ninja:

```
cmake -S . -B build_dir -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
```

Add this as a new project to Netbeans using the Lightweight C/C++ Project type.

Set the build command to invoke Ninja directly:

```
ninja -C build_dir
```

Start a build. Open a tool like `htop` in a terminal.

Press the "Stop" button on the "Output" pane.

Notice how all the gcc/g++ processes are still running.

### Did this work correctly in an earlier version?

No / Don't know

### Operating System

RHEL7 AMD64

### JDK

jre-11-openjdk-11.0.22.0.7-1.el7_9.x86_64

### Apache NetBeans packaging

Apache NetBeans binary zip

### Anything else

This happens every time.

It used to work correctly with Netbeans 8.2.

### Are you willing to submit a pull request?

No

Contributor guide

Open the contributing guide

Research direction

Start at the CppLite/Lightweight C/C++ project build-stop path exposed by the Output pane, using the reported Ninja command as the reproduction entry point. Reproduce with a long-running multi-file CMake/Ninja build and verify that stopping the build also terminates the active GCC/G++ child processes rather than leaving them under systemd.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.