-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
Description
What steps will reproduce the problem? I've got it down to the following test program: package main func main() { for i := 0; i < 5000; i++ { go func() { }() } for i := 0; i < 5000; i++ { print(i, "\n") } } ./6.out |more ^C after one page of output What do you see instead? panic: runtime error: invalid memory address or nil pointer dereference panic PC=0x25cf08 runtime.panic+0xb2 /Users/dadkins/go/src/pkg/runtime/proc.c:1028 runtime.panic(0xfa6c, 0x2591f0) runtime.panicstring+0x69 /Users/dadkins/go/src/pkg/runtime/runtime.c:86 runtime.panicstring(0x2183c, 0x25cfb8) runtime.sigpanic+0x144 /Users/dadkins/go/src/pkg/runtime/darwin/thread.c:460 runtime.sigpanic() runtime.notok+0x5 /Users/dadkins/go/src/pkg/runtime/darwin/amd64/sys.s:118 runtime.notok() runtime.write+0x1b /Users/dadkins/go/src/pkg/runtime/darwin/amd64/sys.s:40 runtime.write() runtime.printuint+0x7f /Users/dadkins/go/src/pkg/runtime/print.c:289 runtime.printuint(0xdfd, 0xe004) runtime.printint+0x55 /Users/dadkins/go/src/pkg/runtime/print.c:299 runtime.printint(0xdfd, 0x1) main.main+0x7d /Users/dadkins/tst/go/sched.go:11 main.main() runtime.mainstart+0xf /Users/dadkins/go/src/pkg/runtime/amd64/asm.s:77 runtime.mainstart() runtime.goexit /Users/dadkins/go/src/pkg/runtime/proc.c:146 runtime.goexit() goroutine 4001 [1]: goroutine 4000 [1]: ... Which compiler are you using (5g, 6g, 8g, gccgo)? 6g Which operating system are you using? Mac OS X Which revision are you using? (hg identify) 03404c0155f6 tip Please provide any additional information below. The output loop is essential to reproducing the bug. I tried replacing it with time.Sleep(10e9) but that worked.