Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

Robustify fork server launching & problem detection, part 1 #536

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

copybara-service[bot]
Copy link

Robustify fork server launching & problem detection, part 1

This change addresses the problems (1) and (4) from the bug:

  1. The fork server launches the command in the background like this:

    int ret = system("command &");
    CHECK_EQ(ret, 0);
    

    However, system() always returns success in this case, provided it can just parse the command, because the command is run in the background and doesn't return its exit code to the subshell.

  2. Even if started successfully, the fork server can still die at any moment. Centepede doesn't attempt to detect this, instead sending execution requests to an absent process, never receiving a reply, and eventually timing out.

This change addresses the problems (1) and (4) from the bug:

1. The fork server launches the command in the background like this:
   ```
   int ret = system("command &");
   CHECK_EQ(ret, 0);
   ```
   However, `system()` always returns success in this case, provided it can just parse the command, because the command is run in the background and doesn't return its exit code to the subshell.

4. Even if started successfully, the fork server can still die at any moment. Centepede doesn't attempt to detect this, instead sending execution requests to an absent process, never receiving a reply, and eventually timing out.

PiperOrigin-RevId: 516385634
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant