From 66277ade287ba2fbe01248e001bd39255f55a7a1 Mon Sep 17 00:00:00 2001 From: Todd Lipcon Date: Wed, 21 Mar 2018 15:35:17 -0700 Subject: [PATCH] symbolz: skip un-symbolizable mappings This fixes https://github.com/google/pprof/issues/339 by skipping attempts to symbolize anything from system mappings like [vdso], [vsyscall], etc. --- internal/symbolz/symbolz.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/symbolz/symbolz.go b/internal/symbolz/symbolz.go index 086c0ccb..9083ab4c 100644 --- a/internal/symbolz/symbolz.go +++ b/internal/symbolz/symbolz.go @@ -38,13 +38,18 @@ var ( // symbolz handler. syms receives the symbolz query (hex addresses // separated by '+') and returns the symbolz output in a string. If // force is false, it will only symbolize locations from mappings -// not already marked as HasFunctions. +// not already marked as HasFunctions. Never attempts symbolization of +// any symbols found in unsymbolizable system mappings. func Symbolize(p *profile.Profile, force bool, sources plugin.MappingSources, syms func(string, string) ([]byte, error), ui plugin.UI) error { for _, m := range p.Mapping { if !force && m.HasFunctions { // Only check for HasFunctions as symbolz only populates function names. continue } + // Skip well-known system mappings. + if m.Unsymbolizable() { + continue + } mappingSources := sources[m.File] if m.BuildID != "" { mappingSources = append(mappingSources, sources[m.BuildID]...)