<p dir="auto">by <strong>esko.luontola</strong>:</p>
<pre class="notranslate">What steps will reproduce the problem?

import (
    "testing"
    "runtime"
)

func TestBug(t *testing.T) {
    pc, fileCaller, lineCaller, _ := runtime.Caller(0)
    
    f := runtime.FuncForPC(pc)
    fileFunc, lineFunc := f.FileLine(pc)
    
    t.Log(fileCaller, fileFunc)
    if fileCaller != fileFunc {
        t.Errorf("file wrong: %v != %v", fileCaller, fileFunc)
    }
    
    t.Log(lineCaller, lineFunc)
    if lineCaller != lineFunc {
        t.Errorf("line wrong: %v != %v", lineCaller, lineFunc)
    }
}

What is the expected output? What do you see instead?

--- FAIL: gospec.TestBug
    /home/orfjackal/devel/gospec/src/gospec/bug_test.go 
/home/orfjackal/devel/gospec/src/gospec/bug_test.go
    9 1126
    line wrong: 9 != 1126

What is your $GOOS?  $GOARCH?
linux amd64

Which revision are you using?  (hg identify)
d1615461b60e tip</pre>
<pre class="notranslate">My app hangs acquiring a semaphore (within RWMutex).
(Simple workaround is to add a field to sync.RWMutex struct.)

This problem has been happening for about a week. 
There were some bugs in the runtime being chased 
at the time, so I hoped this was a duplicate. 

I switched back to 1.0.3 in which my app runs fine.

That bug was:
  <a href="https://golang.org/issue/5120" rel="nofollow">https://golang.org/issue/5120</a>

After that bug was fixed, I tried again and it still 
hangs, and the same symptoms occur.

I'd define symptoms below.

Whenever I run my application, it hangs at a certain 
point acquiring a semaphore. 
(I used kill -SIGABRT to get the stacktrace).

  goroutine 17 [semacquire]:
  sync.runtime_Semacquire(0x7fc24a701370)
    /opt/go-contrib/src/pkg/runtime/zsema_linux_amd64.c:165 +0x2e
  sync.(*RWMutex).Lock(0x7fc24a701368)
    /opt/go-contrib/src/pkg/sync/rwmutex.go:80 +0x81
  ugorji.net/util.(*SafeStore).putAll(0x7fc24a701360, 0x0, 0x1, 0x0, 0x149682c01495c0, ...)
    /home/ugorji/depot/golang/src/ugorji.net/util/safe_store.go:148 +0x88

However, I got it past that point simply by adding a 
field to RWMutex ie I added "Ugorji bool" as last
field in sync.RWMutex. And we're fine; no more hanging.
(Hopefully this gives a hint of what is causing this).

I tried applying Remy's patch but that didn't help (pulling straws here).
  <a href="https://golang.org/cl/8287043/" rel="nofollow">https://golang.org/cl/8287043/</a>

I've been trying to isolate the issue for a week now. 
I even wrote standalone programs that simulate what 
I am doing, but they all work fine.

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
Linux 3.5.0-26-generic #42-Ubuntu SMP Fri Mar 8 23:18:20 UTC 2013 x86_64 GNU/Linux

Which version are you using?  (run 'go version')
go version devel +d646225cb410 Wed Apr 03 17:03:42 2013 -0700 linux/amd64

Please provide any additional information below.</pre>