Skip to content
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

fmt: TestCountMallocs: fmt_test.go:607: Fprintf(buf, "%s"): got 1.21 allocs, want <=1 #4974

alberts opened this issue Mar 4, 2013 · 3 comments


Copy link

@alberts alberts commented Mar 4, 2013

What steps will reproduce the problem?

GOMAXPROCS=19 ./run.bash --no-rebuild

What is the expected output?

test passes

What do you see instead?

--- FAIL: TestCountMallocs-19 (0.01 seconds)
fmt_test.go:607: Fprintf(buf, "%s"): got 1.21 allocs, want <=1
FAIL fmt 0.064s

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


Which operating system are you using?


Which version are you using?  (run 'go version')

go version devel +67fc3cb0d3aa Mon Mar 04 14:54:36 2013 +1100 linux/amd64
Copy link
Contributor Author

@alberts alberts commented Mar 6, 2013

Comment 1:

some goodies from
go tool pprof --svg --alloc_objects ./fmt.test memprof.profile
had to hack the testing package to write a memprofile when it fails.
it seems in the failure case, runtime.allocm sometimes calls runtime.malg.


  1. ok.svg (98580 bytes)
  2. fail.svg (72234 bytes)
Copy link

@rsc rsc commented Mar 6, 2013

Comment 2:

I think any TestCountMallocs test should just refuse to run if GOMAXPROCS
is not 1.
Copy link

@robpike robpike commented Mar 6, 2013

Comment 3:

This issue was closed by revision 0a71a5b.

Status changed to Fixed.

@alberts alberts added fixed labels Mar 6, 2013
@rsc rsc added this to the Go1.1 milestone Apr 14, 2015
@rsc rsc removed the go1.1maybe label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.