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 func RunGoroutines() {
20 for i := 0; i < 4; i++ {
21 go func() {
22 runtime.LockOSThread()
23 select {}
24 }()
25 }
26 }
27
28 var P *byte
29
30
31
32 func TestSEGV() {
33 defer func() {
34 if recover() == nil {
35 fmt.Fprintln(os.Stderr, "no panic from segv")
36 os.Exit(1)
37 }
38 }()
39 *P = 0
40 fmt.Fprintln(os.Stderr, "continued after segv")
41 os.Exit(1)
42 }
43
44 func main() {
45 }
46
View as plain text