Skip to content

Commit

Permalink
fix: close pipes in gdb subprocess
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdragun committed Oct 31, 2024
1 parent f15a82c commit 51fdc71
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions esp_coredump/corefile/gdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#

import logging
import os
import re
import time
from subprocess import TimeoutExpired
Expand Down Expand Up @@ -40,6 +41,9 @@ def __del__(self):
try:
if self.p.gdb_process:
self.p.gdb_process.terminate()
if os.name != 'nt':
# this is causing an Exception on Windows, but is required on UNIX systems
self.p.gdb_process.communicate() # Close pipes (STDIN, STDOUT, STDERR)
try:
self.p.gdb_process.wait(timeout=1)
except TimeoutExpired:
Expand Down

0 comments on commit 51fdc71

Please sign in to comment.