From: Russ Cox Date: Mon, 6 Oct 2014 18:18:56 +0000 (-0400) Subject: [dev.garbage] all: merge default into dev.garbage X-Git-Tag: go1.5beta1~2684^2~35 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=9ba99011fa9083b31a108acfb6c3d16b8c774f8f;p=gostls13.git [dev.garbage] all: merge default into dev.garbage This picks up the selectdone dangling pointer fix, among others. LGTM=rlh R=rlh CC=golang-codereviews https://golang.org/cl/153070045 --- 9ba99011fa9083b31a108acfb6c3d16b8c774f8f diff --cc src/runtime/select.go index 1bcea8c4b4,9de057b871..2d0787bd96 --- a/src/runtime/select.go +++ b/src/runtime/select.go @@@ -377,8 -377,14 +377,9 @@@ loop // iterating through the linked list they are in reverse order. cas = nil sglist = gp.waiting - // Clear all selectdone and elem before unlinking from gp.waiting. - // They must be cleared before being put back into the sudog cache. - // Clear before unlinking, because if a stack copy happens after the unlink, - // they will not be updated, they will be left pointing to the old stack, - // which creates dangling pointers, which may be detected by the - // garbage collector. + // Clear all elem before unlinking from gp.waiting. for sg1 := gp.waiting; sg1 != nil; sg1 = sg1.waitlink { + sg1.selectdone = nil sg1.elem = nil } gp.waiting = nil