1
2
3
4
5 package main
6
7 import "C"
8
9 import (
10 "fmt"
11 "os"
12 "runtime"
13 )
14
15
16
17
18
19
20 func RunGoroutines() {
21 for i := 0; i < 4; i++ {
22 go func() {
23 runtime.LockOSThread()
24 select {}
25 }()
26 }
27 }
28
29 var P *byte
30
31
32
33
34 func TestSEGV() {
35 defer func() {
36 if recover() == nil {
37 fmt.Fprintln(os.Stderr, "no panic from segv")
38 os.Exit(1)
39 }
40 }()
41 *P = 0
42 fmt.Fprintln(os.Stderr, "continued after segv")
43 os.Exit(1)
44 }
45
46 func main() {
47 }
48
View as plain text