Source file
test/fixedbugs/issue29362.go
1
2
3
4
5
6
7
8
9
10 package main
11
12 import (
13 "unsafe"
14 )
15
16 var badPtr uintptr
17
18 var sink []byte
19
20 func init() {
21
22 b := make([]byte, 1<<16-1)
23 sink = b
24
25 badPtr = uintptr(unsafe.Pointer(&b[len(b)-1])) + 1
26 }
27
28 var throttle = make(chan struct{}, 10)
29
30 func noPointerArgs(a, b, c, d uintptr) {
31 sink = make([]byte, 4096)
32 <-throttle
33 }
34
35 func main() {
36 const N = 1000
37 for i := 0; i < N; i++ {
38 throttle <- struct{}{}
39 go noPointerArgs(badPtr, badPtr, badPtr, badPtr)
40 sink = make([]byte, 4096)
41 }
42 }
43
View as plain text