Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Go 1.7. I was inspecting a CPU profile sent to me for an ARM binary by a user. The top level items make sense but the deeper you get into the stack the more it veers off into cyberspace, with the call stack implicating functions and packages than can never be called from the higher levels. I'll link to the relevant files here and point out some of the discrepancies in the hope that the cause may be obvious to someone.
The profiled binary: https://github.com/syncthing/syncthing/releases/download/v0.14.5/syncthing-linux-arm-v0.14.5.tar.gz (compiled with Go 1.7 on linux-amd64 for linux-arm)
A "web" overview: https://nym.se/r/dbqn.svg
An interesting branch to look at here is the
However, none of the
I'm fairly sure the profile is from the binary in question, as it has a function to create such a profile and tags it with the platform and release version as seen in the profile name.
This profile was not generated with this binary.
The profile is mostly binary but at the end there is a copy of /proc/self/maps. It says
This does not match any of the released syncthing binaries from 0.14.0 to 0.14.5. Look, for example, at the second mapping, the read-only data. It starts at file offset 0x529000 and is mapped at virtual address 0x539000.
In contrast, the read-only data in each binary starts later than that:
Put another way, the text (code) segment in each of these released binaries has a larger FileSiz/MemSiz than the 0x529000 that was mapped in the binary the profile came from.
Clearly the profile came from /usr/bin/syncthing, but it wasn't one of these.
In the long term, Go pprof profiles will become self-contained, so that you don't need a binary. We're not there yet. But this profile definitely didn't come from this binary.