-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: TestCgoPprof fails on Ubuntu 16.10 #15714
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
Comments
The test assumes that cmd/pprof can decode the debug info of the executable, to map the PC valeu to the name cpuHog. What does that debug info look like? |
I'm no expert at DWARF, but it looks OK to me?
I've uploaded the file here: http://people.canonical.com/~mwh/testprogcgo if you want a look. Building testprogcgo on 16.10, copying it to 16.04, running and looking at the profile there doesn't work. More surprisingly, building it on 16.04, copying to 16.10, running and looking at the profile there doesn't work, but then building it on 16.04, running it there and then copying the binary and profile to 16.10 also doesn't work, so maybe there is more than one problem here. |
Can you also upload the profile file? |
I got confused about my executables so I built another one, made a profile, On 19 May 2016 at 02:17, Ian Lance Taylor notifications@github.com wrote:
|
@ianlancetaylor Have you had a chance to look at the uploaded profile? Is this a 1.7 blocker since it (doesn't seem to be) our regression? |
I looked now. The problem is that the binary was linked as a PIE. The profiling data records the PC values for the executable as it was run, which have nothing to do with the addresses in the binary itself. For this to work the pprof tool needs to know the base address of the executable when it is run. Or, the profiler needs to record PC values as an offset from the load address. This must be a known problem but off hand I don't know what the usual solution is. @mwhudson For 1.7 do you want to try changing buildTestProg to pass -extldflags=-fno-pie? Unfortunately we can't do that unconditionally, we can only do it if it works. |
Switching to the new profile format might help but that's not going to happen for Go 1.7. Is there some way to know that we're running a PIE binary? The runtime could subtract the base addresses from the profile, maybe. |
I'll try fixing the test, but it'll be Monday next week before I get to it. I don't know how to find the base address for the binary off the top of my On 27 May 2016 at 13:57, Russ Cox notifications@github.com wrote:
|
You could elf.Open /proc/self/exe, look up a variable in the symbol table, and subtract the value in the symbol table from the actual address of the variable. Doesn't sound like 1.7 material to me. |
Keeping the issue at 1.7maybe in hopes of fixing the test. |
Which of these cases is true?
If its (1), no big deal, it can wait for Go 1.8. If it's (2) and there is an easy fix, that seems more serious. I was reading the original report as if (2) were the case; maybe I misunderstood. I will leave the 1.7 decision to @ianlancetaylor since I am about to go away for the summer. |
@mwhudson Can you see if https://golang.org/cl/23525 fixes the problem? |
CL https://golang.org/cl/23525 mentions this issue. |
On archlinux I get the same test-failure at tip using all.bash and compiling with 1.6.2. ok runtime 12.990s |
Recently, I encountered similar problem, when I tried to build Go from source on my Ubuntu VM:
Go version used: So far I have seen three subtly different ways in which tests failed: first, second and third one. Here are binaries and corresponding profiles. I ran |
@codesenberg, commenting on closed issues is not effective: we don't track closed issues. If you want somebody to look at it, file a new bug. |
@bradfitz got it. |
Please answer these questions before submitting your issue. Thanks!
go version
)?go version devel +495e3c6 Tue May 17 04:02:11 2016 +0000 linux/amd64
go env
)?Ubuntu 16.10
go test runtime -run TestCgoPprof
ok runtime 1.061s
Not really at all sure what's going on here. Ubuntu 16.10 has a very new toolchain, so that might be the difference?
The text was updated successfully, but these errors were encountered: