weblist comes back blank on OSX when binary referenced in profile exists
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- go, macos
- Ambito
- performance, tooling
Direzione di ricerca
Riproduci il caso OSX dell’issue usando i comandi Go pprof, quindi esamina internal/binutils/addr2liner_nm.go e sourcePrinter.addStack. Confronta il percorso weblist con il comportamento di interactive list descritto nel report. Il lavoro è completato quando l’elenco dei sorgenti del browser viene popolato mentre il binario profilato esiste ancora, preservando al contempo le funzionalità avanzate abilitate da quel binario.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Repro (needs to be on OSX, in pprof repo)
$ go test -o ./profile/foo -c -memprofile=mem.pb.gz ./profile/
$ (cd profile/ && ./foo -test.memprofile ../mem.pb.gz)
PASS
$ go tool pprof -http :6060 mem.pb.gz
In the browser window, navigate to the flame graph and click "Show source in new tab":
A completely empty source listing tab opens.
I spent way too much time digging into this today and found that this is related to whether the file referenced in the profile exists. That's right, you rm profile/foo and refresh the browser window, it will just work.
I didn't just try that out randomly but was motivated to try this after spending a few hours with the debugger attached.
When the file exists, we hit this code:
and (*sourcePrinter).addStack will get (from the addr2LinerNM) plugin.Frames that have zero File and Line, i.e. the only thing in them is Func. Not only that, Func will also have an errant underscore prefix, which is an OSX thing (https://go-review.googlesource.com/c/go/+/196217). So basically it can never successfully look up which file a Frame is from. So at best we can expect a listing that doesn't reference the files.
But we don't even get that! We see why in this snippet as well. sp.interest is keyed by function names as stored in the profile, which don't have the underscore. But we look up with the underscore. So it never matches.
I hacked around this with a diff that also adds the underscore version into sp.interest. Then we get something like this (this is from when I had not ported my repro to use the pprof repo):
Meanwhile, interactive pprof's list command works flawlessly. When I looked at the source I realized why: list doesn't seem to share much code (if any at all) with weblist.
weblist is obviously much more powerful, so it would be good if it worked out of the box on OSX. Moving the file out of the way gives the basic listing, but disables the advanced functionality that's tied to having the binary present.
I have some more "meandering" (write-as-you-go) notes at https://gist.github.com/tbg/ff8de01920551be1a2193a2fd3ffd6b8, I don't think they're adding much but linking just in case.
- Lingua principale
- Go
- Stelle
- 9.3k
- Fork
- 682
- Merge medio
- 2g 4h
- PR unite (30g)
- 11
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di google/pprof
-
Make comments more discoverable in the web UIForse già presa @jabrailkhalil l’ha presa 20 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
google/pprof#1029 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 74/100
google/pprof#1020 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
pprof cannot locate source code for the list command in common Go setupsForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
google/pprof#1009 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Label with zero int64 value and no unit get dropped during decodingForse già presa @ms-hujia l’ha presa 126 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
google/pprof#1002 · 6 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 42/100
google/pprof#992 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di google/pprof
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
grafana/tempo-operator#1691 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
hashicorp/terraform-mcp-server#583 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
backend bug low-priority
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
lognorman20/monaco#6225 ·