go/doc
Russ Cox ade6bc68b0 runtime: crash when func main calls Goexit and all other goroutines exit
This has typically crashed in the past, although usually with
an 'all goroutines are asleep - deadlock!' message that shows
no goroutines (because there aren't any).

Previous discussion at:
https://groups.google.com/d/msg/golang-nuts/uCT_7WxxopQ/BoSBlLFzUTkJ
https://groups.google.com/d/msg/golang-dev/KUojayEr20I/u4fp_Ej5PdUJ
http://golang.org/issue/7711

There is general agreement that runtime.Goexit terminates the
main goroutine, so that main cannot return, so the program does
not exit.

The interpretation that all other goroutines exiting causes an
exit(0) is relatively new and was not part of those discussions.
That is what this CL changes.

Thankfully, even though the exit(0) has been there for a while,
some other accounting bugs made it very difficult to trigger,
so it is reasonable to replace. In particular, see golang.org/issue/7711#c10
for an examination of the behavior across past releases.

Fixes #7711.

LGTM=iant, r
R=golang-codereviews, iant, dvyukov, r
CC=golang-codereviews
https://golang.org/cl/88210044
2014-04-16 13:12:18 -04:00
..
articles build: remove depdenency on GNU make 2014-04-07 11:34:35 +10:00
codewalk doc: fix small HTML problems 2013-10-12 18:40:41 -04:00
devel doc: document Go 1.2.1 2014-03-03 11:26:18 +11:00
gopher doc/gopher: fix typo in README 2014-03-26 11:23:33 +11:00
play doc: remove godocs.js and playground.js from core repo 2013-08-01 15:09:18 +10:00
progs doc/progs: don't try building cgo tests if CGO_ENABLED=0 2013-10-11 08:55:13 -07:00
asm.html doc/asm.html: remove mention of 6l -a 2014-04-15 16:27:48 -07:00
cmd.html doc: re-organize golang.org site content 2013-09-16 15:47:13 +10:00
code.html doc: update installation instructions 2013-11-21 07:55:29 +11:00
contrib.html doc/contrib.html: fix some tags 2013-10-15 18:41:23 +11:00
contribute.html doc: Revise Contribution Guidelines. 2014-03-17 09:35:04 +11:00
debugging_with_gdb.html doc/debugging_with_gdb: use -w to strip debug info. 2014-04-16 01:19:26 -04:00
docs.html doc: restore race detector manual 2014-02-11 09:26:34 +11:00
effective_go.html doc: allow buffered channel as semaphore without initialization 2014-03-24 19:11:21 -04:00
gccgo_contribute.html doc: update gccgo docs 2013-06-20 14:49:15 -07:00
gccgo_install.html doc: update list of gccgo import search paths 2013-12-06 13:33:10 -08:00
go-logo-black.png doc: pngcrush and remove old, unused images 2012-03-08 14:18:28 +11:00
go-logo-blue.png doc: pngcrush and remove old, unused images 2012-03-08 14:18:28 +11:00
go-logo-white.png doc: pngcrush and remove old, unused images 2012-03-08 14:18:28 +11:00
go1.1.html doc: fix a few broken links 2013-10-09 07:05:43 +11:00
go1.2.html encoding/gob: do not use MarshalText, UnmarshalText 2013-11-13 21:29:19 -05:00
go1.3.html runtime: crash when func main calls Goexit and all other goroutines exit 2014-04-16 13:12:18 -04:00
go1.html doc: re-organize golang.org site content 2013-09-16 15:47:13 +10:00
go1compat.html doc: re-organize golang.org site content 2013-09-16 15:47:13 +10:00
go_faq.html doc/go_faq.html: update description of stack management 2014-03-21 13:59:30 +11:00
go_mem.html doc: allow buffered channel as semaphore without initialization 2014-03-24 19:11:21 -04:00
go_spec.html spec: clarify when constant slice indices must be in range 2014-03-06 17:11:13 -08:00
help.html doc/help.html: fix typo in word order 2014-04-14 13:03:03 -07:00
ie.css golang.org redesign 2010-09-16 14:01:02 +10:00
install-source.html doc: document DragonFly BSD port 2014-03-26 14:06:18 +09:00
install.html doc/install.html: FreeBSD 8 and higher only are supported 2014-04-15 16:40:48 -07:00
logo-153x55.png doc: pngcrush and remove old, unused images 2012-03-08 14:18:28 +11:00
root.html doc: remove "Code that grows with grace" video from front page 2014-02-11 16:00:44 +11:00
share.png godoc: change link styles, add 'pop out' button 2012-03-13 11:00:11 +11:00
sieve.gif repair corrupted sieve.gif 2009-10-30 10:34:01 -07:00
tos.html doc: add Terms of Service 2012-03-27 09:27:43 +11:00