{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/16778","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/16778/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/16778/comments","events_url":"https://api.github.com/repos/golang/go/issues/16778/events","html_url":"https://github.com/golang/go/issues/16778","id":171780363,"number":16778,"title":"runtime: fatal error: sweep increased allocation count in go1.7","user":{"login":"zeebo","id":96925,"avatar_url":"https://avatars.githubusercontent.com/u/96925?v=3","gravatar_id":"","url":"https://api.github.com/users/zeebo","html_url":"https://github.com/zeebo","followers_url":"https://api.github.com/users/zeebo/followers","following_url":"https://api.github.com/users/zeebo/following{/other_user}","gists_url":"https://api.github.com/users/zeebo/gists{/gist_id}","starred_url":"https://api.github.com/users/zeebo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeebo/subscriptions","organizations_url":"https://api.github.com/users/zeebo/orgs","repos_url":"https://api.github.com/users/zeebo/repos","events_url":"https://api.github.com/users/zeebo/events{/privacy}","received_events_url":"https://api.github.com/users/zeebo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-08-17T22:57:40Z","updated_at":"2016-10-29T15:27:20Z","closed_at":"2016-08-17T23:09:05Z","body":"Please answer these questions before submitting your issue. Thanks!\r\n\r\n1. What version of Go are you using (`go version`)?\r\ngo version go1.7 darwin/amd64\r\n\r\n2. What operating system and processor architecture are you using (`go env`)?\r\nGOARCH=\"amd64\"\r\nGOBIN=\"\"\r\nGOEXE=\"\"\r\nGOHOSTARCH=\"amd64\"\r\nGOHOSTOS=\"darwin\"\r\nGOOS=\"darwin\"\r\nGOPATH=\"\"\r\nGORACE=\"\"\r\nGOROOT=\"/Users/jeff/go\"\r\nGOTOOLDIR=\"/Users/jeff/go/pkg/tool/darwin_amd64\"\r\nCC=\"clang\"\r\nGOGCCFLAGS=\"-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/tn/09dglcts0b9gc5111hnf0_dm0000gn/T/go-build421610542=/tmp/go-build -gno-record-gcc-switches -fno-common\"\r\nCXX=\"clang++\"\r\nCGO_ENABLED=\"1\"\r\n\r\n3. What did you do?\r\nI ran this program: https://play.golang.org/p/LXVU7fsuOr\r\n\r\n4. What did you expect to see?\r\nA bunch of pointers forever.\r\n\r\n5. What did you see instead?\r\nA bunch of pointers and then\r\n```\r\nruntime: nelems=512 nfree=510 nalloc=2 previous allocCount=1 nfreed=65535\r\nfatal error: sweep increased allocation count\r\n\r\nruntime stack:\r\nruntime.throw(0xa934f, 0x20)\r\n\t/Users/jeff/go/src/runtime/panic.go:566 +0x95\r\nruntime.(*mspan).sweep(0x1a42c0, 0x1a4201, 0x2cf01)\r\n\t/Users/jeff/go/src/runtime/mgcsweep.go:287 +0x7ab\r\nruntime.(*mcentral).cacheSpan(0xfe450, 0x40002a201)\r\n\t/Users/jeff/go/src/runtime/mcentral.go:47 +0x491\r\nruntime.(*mcache).refill(0x12f4b0, 0x2, 0xc420000b60)\r\n\t/Users/jeff/go/src/runtime/mcache.go:121 +0xae\r\nruntime.(*mcache).nextFree.func1()\r\n\t/Users/jeff/go/src/runtime/malloc.go:505 +0x33\r\nruntime.systemstack(0xc420019500)\r\n\t/Users/jeff/go/src/runtime/asm_amd64.s:298 +0x79\r\nruntime.mstart()\r\n\t/Users/jeff/go/src/runtime/proc.go:1079\r\n\r\ngoroutine 1 [running]:\r\nruntime.systemstack_switch()\r\n\t/Users/jeff/go/src/runtime/asm_amd64.s:252 fp=0xc42003f900 sp=0xc42003f8f8\r\nruntime.(*mcache).nextFree(0x12f4b0, 0x2, 0x0, 0x0, 0x0)\r\n\t/Users/jeff/go/src/runtime/malloc.go:506 +0xb2 fp=0xc42003f958 sp=0xc42003f900\r\nruntime.mallocgc(0x10, 0x0, 0xf300, 0xc42003fa20)\r\n\t/Users/jeff/go/src/runtime/malloc.go:658 +0x809 fp=0xc42003f9f8 sp=0xc42003f958\r\nruntime.growslice(0x8b3c0, 0x0, 0x0, 0x0, 0xc, 0xc4203d2010, 0x0, 0x10)\r\n\t/Users/jeff/go/src/runtime/slice.go:126 +0x24e fp=0xc42003fa88 sp=0xc42003f9f8\r\nfmt.(*fmt).pad(0xc4203de040, 0xc4203de0a0, 0xc, 0xc)\r\n\t/Users/jeff/go/src/fmt/format.go:92 +0x112 fp=0xc42003fb10 sp=0xc42003fa88\r\nfmt.(*fmt).fmt_integer(0xc4203de040, 0xc4203dc010, 0x10, 0x0, 0xa6865, 0x11)\r\n\t/Users/jeff/go/src/fmt/format.go:307 +0x1f9 fp=0xc42003fb78 sp=0xc42003fb10\r\nfmt.(*pp).fmt0x64(0xc4203de000, 0xc4203dc010, 0x1)\r\n\t/Users/jeff/go/src/fmt/print.go:348 +0x6c fp=0xc42003fbc0 sp=0xc42003fb78\r\nfmt.(*pp).fmtPointer(0xc4203de000, 0x88ea0, 0xc4203dc010, 0x16, 0x70)\r\n\t/Users/jeff/go/src/fmt/print.go:515 +0xfc fp=0xc42003fc40 sp=0xc42003fbc0\r\nfmt.(*pp).printArg(0xc4203de000, 0x88ea0, 0xc4203dc010, 0xc400000070)\r\n\t/Users/jeff/go/src/fmt/print.go:619 +0xec3 fp=0xc42003fd38 sp=0xc42003fc40\r\nfmt.(*pp).doPrintf(0xc4203de000, 0xa54a5, 0x3, 0xc42003ff28, 0x1, 0x1)\r\n\t/Users/jeff/go/src/fmt/print.go:985 +0x123d fp=0xc42003fe20 sp=0xc42003fd38\r\nfmt.Fprintf(0xf6140, 0xc42002c010, 0xa54a5, 0x3, 0xc42003ff28, 0x1, 0x1, 0xd, 0x0, 0x0)\r\n\t/Users/jeff/go/src/fmt/print.go:181 +0x76 fp=0xc42003fe88 sp=0xc42003fe20\r\nfmt.Printf(0xa54a5, 0x3, 0xc42003ff28, 0x1, 0x1, 0x10, 0x0, 0x0)\r\n\t/Users/jeff/go/src/fmt/print.go:190 +0x72 fp=0xc42003fee8 sp=0xc42003fe88\r\nmain.main()\r\n\t/Users/jeff/tmp/bolt-bugs/foo.go:17 +0xb8 fp=0xc42003ff48 sp=0xc42003fee8\r\nruntime.main()\r\n\t/Users/jeff/go/src/runtime/proc.go:183 +0x1f4 fp=0xc42003ffa0 sp=0xc42003ff48\r\nruntime.goexit()\r\n\t/Users/jeff/go/src/runtime/asm_amd64.s:2086 +0x1 fp=0xc42003ffa8 sp=0xc42003ffa0\r\nexit status 2\r\n```\r\n\r\nI'm aware this program is doing something silly by constructing a pointer to a field that isn't backed by any allocation, but it didn't crash on go1.6 and I'm not sure if there's any defined behavior around this. If the answer is \"don't do that then. you're in wacky land because of unsafe\", that's fine, I just want to be sure that this isn't a problem. I found it interesting that it took many prints for it to fail, rather than failing right away."},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/257097778","html_url":"https://github.com/golang/go/issues/16778#issuecomment-257097778","issue_url":"https://api.github.com/repos/golang/go/issues/16778","id":257097778,"user":{"login":"Icedroid","id":674647,"avatar_url":"https://avatars.githubusercontent.com/u/674647?v=3","gravatar_id":"","url":"https://api.github.com/users/Icedroid","html_url":"https://github.com/Icedroid","followers_url":"https://api.github.com/users/Icedroid/followers","following_url":"https://api.github.com/users/Icedroid/following{/other_user}","gists_url":"https://api.github.com/users/Icedroid/gists{/gist_id}","starred_url":"https://api.github.com/users/Icedroid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Icedroid/subscriptions","organizations_url":"https://api.github.com/users/Icedroid/orgs","repos_url":"https://api.github.com/users/Icedroid/repos","events_url":"https://api.github.com/users/Icedroid/events{/privacy}","received_events_url":"https://api.github.com/users/Icedroid/received_events","type":"User","site_admin":false},"created_at":"2016-10-29T15:27:20Z","updated_at":"2016-10-29T15:27:20Z","body":"I'm having this issue after upgrade to go 1.7"}}
{"actor":{"display_login":"Icedroid"}}