-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: memory profiler is inaccurate when GOMAXPROCS>1 #6566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Milestone
Comments
I bisected this and it looks to be related to goroutine preemption [1]. Looking at src/pkg/runtime/mprof.goc [2], it looks like this could happen when a goroutine is preempted during runtime·MProf_Malloc (or runtime·MProf_Free) after incrementing m->nomemprof . If another goroutine runs on the same M* in the meantime, it will see that m->nomemprof is set and not record the malloc/free. Does my analysis sound correct? Can preemption be disabled for specific runtime functions? Or maybe there's a different way to avoid the deadlock that m->nomemprof prevents? [1] The first bad revision is: changeset: 17451:a5b5cbb9bd3d user: Dmitriy Vyukov <dvyukov@google.com> date: Tue Jul 30 22:17:38 2013 +0400 summary: runtime: enable goroutine preemption [2] http://tip.golang.org/src/pkg/runtime/mprof.goc#L248 [3] https://code.google.com/p/go/source/diff?spec=svn9e1fd312d1bd4c0d4202fc9795f55a4d867c52c4&old=0cdceeba29f24c7dedb650f67b9d66a6705b52f9&r=9e1fd312d1bd4c0d4202fc9795f55a4d867c52c4&format=unidiff&path=%2Fsrc%2Fpkg%2Fruntime%2Fsymtab.c |
Owner changed to @dvyukov. |
I've mailed the fix yesterday: https://golang.org/cl/14695044/ It only deletes code, so in some sense it's trivial :) |
Issue #6592 has been merged into this issue. |
This issue was closed by revision f632970. Status changed to Fixed. |
adg
added a commit
that referenced
this issue
May 11, 2015
««« CL 14695044 / 35d5bae6aac8 runtime: remove nomemprof Nomemprof seems to be unneeded now, there is no recursion. If the recursion will be re-introduced, it will break loudly by deadlocking. Fixes #6566. R=golang-dev, minux.ma, rsc CC=golang-dev https://golang.org/cl/14695044 »»» R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/20540043
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: