Skip to content

OpenDebugAD7 process does not exit when its input is closed #1625

Description

When the OpenDebugAD7 input is closed, the program does not exit and instead stays alive doing nothing, which also keeps GDB and the debuggee alive.

Reproducer:

#!/bin/bash
# Usage: ./repro.sh /path/to/OpenDebugAD7
# Leaves the processes running. Kill OpenDebugAD7 afterwards.
send() { printf 'Content-Length: %d\r\n\r\n%s' ${#1} "$1"; }
{
  send '{"seq":1,"type":"request","command":"initialize","arguments":{"adapterID":"cppdbg","pathFormat":"path"}}'
  send '{"seq":2,"type":"request","command":"launch","arguments":{"program":"/bin/sleep","args":["12345"],"cwd":"/","MIMode":"gdb"}}'
  send '{"seq":3,"type":"request","command":"configurationDone"}'
  sleep 5
} | "$1" &> /dev/null &
sleep 15
pgrep -a -x OpenDebugAD7;
pgrep -a -x gdb;
pgrep -a -f 'sleep 12345'

This is because the remaining threads are treated as foreground threads, and so keep the program alive. One solution is to mark them as background threads. Another is to handle closed input as if the user had sent a disconnect request.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions