gonids: recompile go to hunt bug (#7876)

cf https://github.com/golang/go/issues/49075

Try to git bisect this unreproducible bug
This commit is contained in:
Catena cyber 2022-06-16 10:57:54 +02:00 committed by GitHub
parent cb8a8f0f65
commit d288c9ae86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 6 deletions

View File

@ -15,6 +15,8 @@
################################################################################
FROM gcr.io/oss-fuzz-base/base-builder-go
RUN git clone --depth 1 https://github.com/catenacyber/gobughunt
RUN git clone https://go.googlesource.com/go goroot
RUN git clone --depth 1 https://github.com/google/gonids
ADD https://rules.emergingthreats.net/open/suricata/emerging.rules.zip emerging.rules.zip

View File

@ -15,15 +15,20 @@
#
################################################################################
# Test to fix https://github.com/golang/go/issues/49075
# with fix of https://github.com/golang/go/issues/49961
# ie https://go-review.googlesource.com/c/go/+/369098/
# recompile go from git
(
cd /root/.go
git apply $SRC/372f9bd.diff || true
cd $SRC/goroot/src
export bisect_good=`cat $SRC/gobughunt/good`
export bisect_bad=`cat $SRC/gobughunt/bad`
git log $bisect_good..$bisect_bad --oneline --reverse > gitlog.txt
# take one commit in the range good..bad based on the day of the month
expr `date +"%d"` '*' `wc -l gitlog.txt | cut -d' ' -f1` / 31 > logline.txt
cat gitlog.txt | sed -n `cat logline.txt`p | cut -d' ' -f1 | xargs git checkout
./make.bash
)
rm -Rf /root/.go/
mv $SRC/goroot /root/.go
export GODEBUG=cpu.all=off
compile_go_fuzzer github.com/google/gonids FuzzParseRule fuzz_parserule
cd $SRC