Skip to content

Commit c5db671

Browse files
authored
pprof/internal/binutils: update windows test binary (#608)
Recompiled test binary using MSYS2 gcc 10.2.0 and verified that the binary does not trigger anti-virus using virustotal. Fixes #607
1 parent 1612e9b commit c5db671

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

internal/binutils/binutils_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -492,9 +492,9 @@ func TestPEFile(t *testing.T) {
492492
start, limit, offset uint64
493493
addr uint64
494494
}{
495-
{"fake mapping", 0, math.MaxUint64, 0, 0x401560},
496-
{"fixed load address", 0x400000, 0x402000, 0, 0x401560},
497-
{"simulated ASLR address", 0x500000, 0x502000, 0, 0x501560},
495+
{"fake mapping", 0, math.MaxUint64, 0, 0x140001594},
496+
{"fixed load address", 0x140000000, 0x140002000, 0, 0x140001594},
497+
{"simulated ASLR address", 0x150000000, 0x150002000, 0, 0x150001594},
498498
} {
499499
t.Run(tc.desc, func(t *testing.T) {
500500
bu := &Binutils{}

internal/binutils/testdata/build_binaries.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,16 @@ func main() {
6565
}
6666

6767
case "windows":
68+
// Many gcc enviroments may create binaries that trigger false-positives
69+
// in antiviruses. MSYS2 with gcc 10.2.0 is a working environment for
70+
// compiling. To setup the environment follow the guide at
71+
// https://www.msys2.org/ and install gcc with `pacman -S gcc`.
6872
out, err := exec.Command("gcc", "-g", "-ffile-prefix-map="+wd+"=", "-o", "exe_windows_64.exe", "hello.c").CombinedOutput()
6973
log.Println(string(out))
7074
if err != nil {
7175
log.Fatal(err)
7276
}
77+
log.Println("Please verify that exe_windows_64.exe does not trigger any antivirus on `virustotal.com`.")
7378
default:
7479
log.Fatalf("Unsupported OS %q", runtime.GOOS)
7580
}
-37.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)