• Keith Randall's avatar
    runtime: dequeue the correct SudoG · e330cc16
    Keith Randall authored
    select {
           case <- c:
           case <- c:
    }
    
    In this case, c.recvq lists two SudoGs which have the same G.
    So we can't use the G as the key to dequeue the correct SudoG,
    as that key is ambiguous.  Dequeueing the wrong SudoG ends up
    freeing a SudoG that is still in c.recvq.
    
    The fix is to use the actual SudoG pointer as the key.
    
    LGTM=dvyukov
    R=rsc, bradfitz, dvyukov, khr
    CC=austin, golang-codereviews
    https://golang.org/cl/159040043
    e330cc16
select.go 15.2 KB