-
Notifications
You must be signed in to change notification settings - Fork 607
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
Fails with shared libraries because mapping is ignored on OSX #311
Comments
Actually this fix is not correct - there is already a mechanism for subtracting base addresses but it isn't used on OSX! On OSX all the symbols in a library start at 0, but all the symbols in an executable start at 0x100000000. This number comes from the Here is the fixed code (instead of the above
With both of these fixes it works for shared libraries and in the executable, with PIE and ASLR enabled. |
This fixes issue google#311. The mapped address of libraries was never considered, nor was the load address of the segments.
Huh, thanks a lot for tracking this down, this makes a lot of sense. I think your fix will also help a number of cases people had in #130 - some of symbolization issues mentioned there are with dynamic libraries and some could have been because of executable's ASLR. |
Set base address on OSX. This fixes issue #311. The mapped address of libraries was never considered, nor was the load address of the segments. It also fixes a couple of issues in binutils.go, such as when the tail of the data wasn't handled right when grouping symbols at the same address.
Set base address on OSX. This fixes issue google#311. The mapped address of libraries was never considered, nor was the load address of the segments. It also fixes a couple of issues in binutils.go, such as when the tail of the data wasn't handled right when grouping symbols at the same address.
Set base address on OSX. This fixes issue google#311. The mapped address of libraries was never considered, nor was the load address of the segments. It also fixes a couple of issues in binutils.go, such as when the tail of the data wasn't handled right when grouping symbols at the same address.
See this issue for background and test case.
Basically on OSX pprof does not subtract the mapped base address of shared libraries from code addresses before feeding them to
llvm-symbolizer
.I don't know exactly how it is supposed to work, but replacing this line with this seems to make it work:
Also, for some very strange reason, with this patch,
-web
,-top
and-list '.*'
work but-weblist '.*'
does not. However-weblist 'factorial'
does work. It seems like the web interface trips up on the first??
output:The text was updated successfully, but these errors were encountered: