Skip to content

Commit

Permalink
Add timeout to gdbserver startup (#2321)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ordoviz committed Jan 2, 2024
1 parent cd0c34a commit 3bb756d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pwnlib/gdb.py
Expand Up @@ -315,7 +315,14 @@ def _gdbserver_port(gdbserver, ssh):

# Process /bin/bash created; pid = 14366
# Listening on port 34816
process_created = gdbserver.recvline()
process_created = gdbserver.recvline(timeout=3)

if not process_created:
log.error(
'No output from gdbserver after 3 seconds. Try setting the SHELL=/bin/sh '
'environment variable or using the env={} argument if you are affected by '
'https://sourceware.org/bugzilla/show_bug.cgi?id=26116'
)

if process_created.startswith(b'ERROR:'):
raise ValueError(
Expand Down

0 comments on commit 3bb756d

Please sign in to comment.