Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GDB exits and debugging stops with -d <pid> on a running process (PyInf#10417) #217

Open
dshivashankar1994 opened this issue Oct 7, 2022 · 1 comment

Comments

@dshivashankar1994
Copy link
Collaborator

I noticed that here we exit the GDB launched using inject and the debugging happens outside of the GDB.

The code in here checks for the presence of the gdb process and exits the debugging if not.

The gdb process stops and becomes a zombie process. Earlier the issue was not exposed as the zombie process was not considered as non-existing - which was fixed in commit 6ee02b8.

@dshivashankar1994
Copy link
Collaborator Author

Expanding the issue a little bit

Because Zombie process are treated as existing (tried to solve in 6ee02b8), say we do 'py -d ' and while this is active we issue second 'py -d ' on the same pid, command hangs forever

Basically, GDB doesn't support connecting multiple GDB to same process and hence it exits when an active GDB is already connected with the process.

Couple of things to be modified to fix this issue are with inject method (here)

  1. PIPE the stdout and stderr to be used later instead of "_dev_null" (if show_output is False)
  2. Return process instead of process.id so that the process.stdout and process.stderr can be processed by the watchdog process

Since this is a public facing API, we should see how we can take care of the above changes as the signature gets modified with above change.

@dshivashankar1994 dshivashankar1994 changed the title GDB exits and debugging stops with -d <pid> on a running process GDB exits and debugging stops with -d <pid> on a running process (PyInf#8704) Apr 18, 2023
@sac111gp sac111gp changed the title GDB exits and debugging stops with -d <pid> on a running process (PyInf#8704) GDB exits and debugging stops with -d <pid> on a running process (PyInf/10417) Jun 12, 2023
@sac111gp sac111gp changed the title GDB exits and debugging stops with -d <pid> on a running process (PyInf/10417) GDB exits and debugging stops with -d <pid> on a running process (PyInf#10417) Jun 12, 2023
@peytondmurray peytondmurray assigned Carreau and unassigned aktech Nov 14, 2023
@Carreau Carreau removed their assignment Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants