From #78202:
My best guess is that the deferred AddInt32 is from Mutex.Unlock: https://cs.opensource.google/go/go/+/master:src/internal/sync/mutex.go;l=194;drc=6c660052856feae2bf1f3fe44665b5da0002500d
net/http/internal/http2.(*pipe).closeWithError() defers an Unlock.
If that is accurate, then the stack trace is actually missing quite a few frames:
net/http/internal/http2.(*pipe).closeWithError() before the defer, and sync.(*Mutex).Unlock and internal/sync.(*Mutex).Unlock between the defer and sync/atomic.AddInt32.
cc @golang/runtime
In other words, traceback output is sometimes missing multiple frames, and not just inlined frames. closeWithError in those races was not inlined. The Unlock frames could be inlined, but not into deferreturn.
From #78202:
In other words, traceback output is sometimes missing multiple frames, and not just inlined frames.
closeWithErrorin those races was not inlined. The Unlock frames could be inlined, but not into deferreturn.