Skip to content

Commit

Permalink
actions/setup-debugger: Pause for 1 second after interrupting an exec…
Browse files Browse the repository at this point in the history
…to allow /proc/$pid/cmdline to have contents.  It consistently seemed
to be empty (?) on GitHub Actions runners without this brief sleep.
This hacky solution worked in the moment, and so it's what I'm
committing since its tested.  There are likely better solutions that
don't rely on sleeping, like checking for the property we care about
(e.g. does /proc/$pid/cmdline have contents?), but I didn't try those
and so don't want to commit something that doesn't work.

Log the full argv for an easier time debugging the debugger next go
around.
  • Loading branch information
tsibley committed Aug 15, 2024
1 parent d2e728b commit ffe4299
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions actions/setup-debugger/debugger
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ main() {

while <& "$interceptor" IFS=$'\x1f' read -r pid comm exe; do
echo -n "process $pid ($comm) exec of $exe "
sleep 1
set-vars
echo -n "($argv0 ${args[*]}) "

if should-interact; then
echo "[intercepted by debugger]" >> /proc/"$pid"/fd/2
Expand Down

0 comments on commit ffe4299

Please sign in to comment.