Descriptionruntime: don't lock mheap on user goroutine
This is bad for 2 reasons:
1. if the code under lock ever grows stack,
it will deadlock as stack growing acquires mheap lock.
2. It currently deadlocks with SetCPUProfileRate:
scavenger locks mheap, receives prof signal and tries to lock prof lock;
meanwhile SetCPUProfileRate locks prof lock and tries to grow stack
(presumably in runtime.unlock->futexwakeup). Boom.
Let's assume that it
Fixes issue 8407.
Patch Set 1 #Patch Set 2 : diff -r f09014ba559b https://dvyukov%40google.com@code.google.com/p/go/ #Patch Set 3 : diff -r f09014ba559b https://dvyukov%40google.com@code.google.com/p/go/ #Patch Set 4 : diff -r f09014ba559b https://dvyukov%40google.com@code.google.com/p/go/ #Patch Set 5 : diff -r 7c3b57e843c6 https://dvyukov%40google.com@code.google.com/p/go/ #
MessagesTotal messages: 8
|