From 361ec17c871d69cccb0d2994ea312533b7d0272a Mon Sep 17 00:00:00 2001 From: Nikita Mikhaylov Date: Fri, 1 Mar 2024 15:31:25 +0000 Subject: [PATCH 1/2] gdb... --- docker/test/fuzzer/run-fuzzer.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docker/test/fuzzer/run-fuzzer.sh b/docker/test/fuzzer/run-fuzzer.sh index b4376fe2409..1a1888861af 100755 --- a/docker/test/fuzzer/run-fuzzer.sh +++ b/docker/test/fuzzer/run-fuzzer.sh @@ -247,6 +247,9 @@ quit fuzzer_pid=$! echo "Fuzzer pid is $fuzzer_pid" + echo "Attaching gdb to the fuzzer itself" + gdb -batch -command script.gdb -p $fuzzer_pid & + # Wait for the fuzzer to complete. # Note that the 'wait || ...' thing is required so that the script doesn't # exit because of 'set -e' when 'wait' returns nonzero code. From e715ff622d50b3c1dda8c4e90bcb97c431b6a81b Mon Sep 17 00:00:00 2001 From: Nikita Mikhaylov Date: Tue, 5 Mar 2024 00:52:13 +0100 Subject: [PATCH 2/2] Better --- docker/test/fuzzer/run-fuzzer.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docker/test/fuzzer/run-fuzzer.sh b/docker/test/fuzzer/run-fuzzer.sh index 1a1888861af..0234ead69d0 100755 --- a/docker/test/fuzzer/run-fuzzer.sh +++ b/docker/test/fuzzer/run-fuzzer.sh @@ -247,8 +247,11 @@ quit fuzzer_pid=$! echo "Fuzzer pid is $fuzzer_pid" + # The fuzzer_pid belongs to the timeout process. + actual_fuzzer_pid=$(ps -o pid= --ppid "$fuzzer_pid") + echo "Attaching gdb to the fuzzer itself" - gdb -batch -command script.gdb -p $fuzzer_pid & + gdb -batch -command script.gdb -p $actual_fuzzer_pid & # Wait for the fuzzer to complete. # Note that the 'wait || ...' thing is required so that the script doesn't