-
Notifications
You must be signed in to change notification settings - Fork 18k
pkg fmt test failure on ARM #2653
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
Owner changed to [email protected]. |
Possibly still a problem on older arm5 hardware stora(~/go/src) % make -C pkg/fmt test make: Entering directory `/home/dfc/go/src/pkg/fmt' gotest rm -f _test/fmt.a rm -f _test/fmt.a gopack grc _test/fmt.a _gotest_.5 --- FAIL: fmt_test.TestCountMallocs (0.10 seconds) fmt_test.go:542: Sprintf("%g"): expected 1 mallocs, got 2 FAIL gotest: "./5.out" failed: exit status 1 make: *** [test] Error 2 make: Leaving directory `/home/dfc/go/src/pkg/fmt' stora(~/go/src) % hg identify uname -a 0ebf155c8d5a+ tip stora(~/go/src) % uname -a Linux stora.local 2.6.34-rc2-g85354d2 #1 PREEMPT Fri Mar 26 07:21:32 PDT 2010 armv5tel GNU/Linux |
Re: comment 5, it looks like the malloc test does not run in short mode, which is what ./all.bash uses. Please see http://golang.org/cl/5544067/. If you do make -C $GOROOT/src/pkg/fmt test this will run the full test set, with or without the CL above. Please let me know if you see the test fail. I have bisected back to weekly.2011-12-22 but have not yet found where this test started to break. |
This failure is not present in weekly.2011-12-14, however at that point %g generated 6 mallocs. Subsequently this alloc count was improved to 2, then this commit reduced the expected count to 1 http://code.google.com/p/go/source/detail?r=11ab63c03100b6ef9e6d0217967191e9033794f0 However, after investigating it this test currently fails on darwin/386 at tip. imac(~/go/src) % hg identify 518f09c59498 tip imac(~/go/src) % make -C pkg/fmt test gotest rm -f _test/fmt.a rm -f _test/fmt.a gopack grc _test/fmt.a _gotest_.8 --- FAIL: fmt_test.TestCountMallocs (0.01 seconds) fmt_test.go:542: Sprintf("%g"): expected 1 mallocs, got 2 FAIL gotest: "./8.out" failed: exit status 1 make: *** [test] Error 2 My hypothesis is %g takes 2 allocs on all 32 bit platforms, and 1 on 64bit platforms but nobody noticed because the alloc test doesn't run in short mode. |
Re Comment 8: Confirm your hypothesis on Linux/386 and Darwin/386. Have you started tracing this bug? If not, I would like to debug this. Re Comment 9: "./?.out -test.short" is the short mode, and it will omit some lengthy tests. This bug is only triggered in the non-short test mode (although testing it won't take long). |
Minux, please feel free to take a look. Some points which may (or may not) be useful: * If you cast the call to Sprintf to float32(3.14159) then only one allocation is used, which is strange because the internal formatFloat routine expects a float64 so there are lots of conversions between float32 -> float64 -> uint64. * This commit, http://code.google.com/p/go/source/detail?r=6cfb9f2415fab4b8fed834afac05afeb9fb9ee8b, improved the count from 6 to 2, it is possible it reduced it to 1 on 64bit machines unintentionally, or perhaps a later change improved for 64bit hosts unintentionally. |
Owner changed to @robpike. |
This issue was closed by revision 45d7397. Status changed to Fixed. |
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: