Navigation Menu

Skip to content
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

cmd/trace: trace shows blank page on chrome #25151

Closed
tarekbadrshalaan opened this issue Apr 28, 2018 · 31 comments
Closed

cmd/trace: trace shows blank page on chrome #25151

tarekbadrshalaan opened this issue Apr 28, 2018 · 31 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@tarekbadrshalaan
Copy link

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

1.10

Does this issue reproduce with the latest release?

no

What operating system and processor architecture are you using (go env)?

ubuntu / amd64

What did you do?

run 'go tool trace m.trace'

What did you expect to see?

full view on the browser of trace

What did you see instead?

empty page on google chrome and firefox and got this error in the console Uncaught ReferenceError: tr is not defined

@AlekSi
Copy link
Contributor

AlekSi commented Apr 29, 2018

This error typically comes from the incompatible browser; only Chrome is supported. Can you confirm this issue with the latest stable version of Chrome? What version do you use?

@ALTree
Copy link
Member

ALTree commented Apr 29, 2018

The fact that firefox doesn't work is explicitly documented:

Note that while the various profiles available when launching 'go tool
trace' work on every browser, the trace viewer itself (the 'view trace'
page) comes from the Chrome/Chromium project and is only actively tested on
that browser.

Chrome, on the other hand, should work.

@ALTree ALTree changed the title try to view runtime/trace on browser cmd/trace: trace shows blank page on chrome Apr 29, 2018
@ALTree ALTree added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Apr 29, 2018
@AlekSi
Copy link
Contributor

AlekSi commented Apr 29, 2018

We could check if tracing tool is available in the browser, and give an explicit error message to the user if it is not. That blank page was very confusing for me too the first time I tried to use it.

@tarekbadrshalaan
Copy link
Author

my chrome version
Version 66.0.3359.139 (Official Build) (64-bit)
it's the latest

@AlekSi
cc @ALTree

@AlekSi
Copy link
Contributor

AlekSi commented Apr 29, 2018

It works for me. Can you please provide a small self-contained example demonstrating the problem?

@ALTree
Copy link
Member

ALTree commented Apr 29, 2018

Are you sure the m.trace file is not empty? Can you attach it?

@tarekbadrshalaan
Copy link
Author

tarekbadrshalaan commented Apr 29, 2018

i recently run a windows 10 vm and setup golang,google chrome and the file works well ,
it can help me for now , but i need it to run on my ubuntu machine

@bcmills
Copy link
Contributor

bcmills commented May 1, 2018

CC: @hyangah @heschik

@hyangah
Copy link
Contributor

hyangah commented May 1, 2018

@tarekbadrshalaan
Can you check if trace_viewer_lean.html is available from your $GOROOT/misc/trace directory?

$ ls go env GOROOT/misc/trace

@tarekbadrshalaan
Copy link
Author

@hyangah
i have no directory $GOROOT/misc/trace
and no directory $GOROOT/misc

@ALTree
Copy link
Member

ALTree commented May 2, 2018

@tarekbadrshalaan I don't see how that's possible... please post here the output of go env.

@tarekbadrshalaan
Copy link
Author

~$go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/tarek/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/tarek/Program/GO_Lang/GOPATH"
GORACE=""
GOROOT="/usr/lib/go-1.10"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.10/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build795570521=/tmp/go-build -gno-record-gcc-switches"

@ALTree
Copy link
Member

ALTree commented May 2, 2018

What does ls /usr/lib/go-1.10 print?

Did you install Go from your OS package manager?

@tarekbadrshalaan
Copy link
Author

output of ls /usr/lib/go-1.10
bin doc favicon.ico.gz pkg src test VERSION

here how i installed go on Ubuntu
sudo add-apt-repository ppa:longsleep/golang-backports
sudo apt-get update
sudo apt-get install golang-go
echo "export GOPATH=/home/tarek/Program/GO_Lang/GOPATH" >> .bashrc
echo "export PATH=$GOPATH/bin:$PATH" >> .bashrc

@bcmills
Copy link
Contributor

bcmills commented May 2, 2018

Please try installing the official distribution per the instructions at https://golang.org/doc/install and see if you can still reproduce the problem.

@bcmills bcmills added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label May 2, 2018
@bcmills bcmills added this to the Unplanned milestone May 2, 2018
@tarekbadrshalaan
Copy link
Author

ok it's working now with go installation from the official distribution on ubuntu/chrome
thank you
@bcmills
@ALTree
@hyangah
@AlekSi

@paravz
Copy link

paravz commented Mar 21, 2019

fedora 29 has a separate rpm for "misc":
dnf install golang-misc

@a652
Copy link

a652 commented Feb 13, 2020

I got this problem recently.
What version of Go are you using (go version)?
1.13.8 (brew install go)

Does this issue reproduce with the latest release?
yes

What operating system and processor architecture are you using (go env)?
darwin / amd64

What did you do?
run 'go tool trace trace.out'

What did you expect to see?
full view on the browser after clicking "View trace"

What did you see instead?
empty page on google chrome(v80.0.3987.100 64 bit) and got this error in the console:
Uncaught ReferenceError: tr is not defined
at onResult (trace?start=0&end=1009904:59)
at trace?start=0&end=1009904:43

output of 'ls $GOROOT/misc/trace' is:
README.md
trace_viewer_full.html
(GOROOT="/usr/local/Cellar/go/1.13.8/libexec")
@ALTree
@hyangah

@hyangah
Copy link
Contributor

hyangah commented Feb 13, 2020

#34374

@kjelle
Copy link

kjelle commented Feb 21, 2020

Hello. I also got this problem.

What version of Go are you using (go version)?
1.13.6 (dnf install golang)

$ dnf info golang
Last metadata expiration check: 1:54:47 ago on Fri 21 Feb 2020 06:41:40 AM CET.
Installed Packages
Name         : golang
Version      : 1.13.6
Release      : 1.fc31
Architecture : x86_64
Size         : 7.8 M
Source       : golang-1.13.6-1.fc31.src.rpm
Repository   : @System
From repo    : updates
Summary      : The Go Programming Language
URL          : http://golang.org/
License      : BSD and Public Domain
Description  : The Go Programming Language.

Does this issue reproduce with the latest release?
yes (from fedora repos that is)

What operating system and processor architecture are you using (go env)?
linux / amd64 (fedora 31)

What did you do?
run a unittest writing trace to file, then running go tool trace trace.out and firefox automatically opens. I clicked on "View Trace".

What did you expect to see?
the contents of "view trace" for my unittest.

What did you see instead?
nothing, an empty, white page in firefox (Mozilla Firefox 71.0)
In the firefox console I get:

ReferenceError: tr is not definedtrace:59:5
    onResult http://127.0.0.1:33971/trace:59
    onreadystatechange http://127.0.0.1:33971/trace:43

It seems I am also missing the misc folder:

$ go env GOROOT
/usr/lib/golang

$ stat /usr/lib/golang/misc
stat: cannot stat '/usr/lib/golang/misc': No such file or directory

I removed the golang package dnf remove -y golang and installed it from https://golang.org/doc/install using go1.13.8.linux-amd64.tar.gz. Now I have the misc folder:

$ go env GOROOT  
/usr/local/go

$ stat `go env GOROOT`/misc
  File: /usr/local/go/misc
...

However, this doesn't fix the problem with an empty page in Firefox. When I launch the trace I get the same empty page with the same error message in the console. I see from #34374 and @hyangah in #34374 (comment) that it is not yet fixed in any stable download.

Updated
The workaround from @jpvillaseca in #34374 (comment) works on my go1.13.8 manual install.

@nomad-software
Copy link

I get this too with:

Ubuntu 16.04 LTS (64-bit)
Chrome version 80.0.3987.122 (Official Build) (64-bit)
Go v1.14

@hyangah
Copy link
Contributor

hyangah commented Feb 27, 2020

The fix is in the tip and waiting for feedback so it can be included in the patch release of go1.14. Please try the version (the easiest is https://godoc.org/golang.org/dl/gotip and gotip tool trace ...

@didrocks
Copy link

Tested gotip tool trace with chrome 80.0.3987.87 and firefox 73 on ubuntu focal (which will be ubuntu 20.04) and I confirm that the UI is now correctly loading.

@StarpTech
Copy link

I'm using go1.14 linux/amd64 and the issue is still there.

@Alex-duzhichao
Copy link

Tested gotip tool trace with chrome 80.0.3987.87 and firefox 73 on ubuntu focal (which will be ubuntu 20.04) and I confirm that the UI is now correctly loading.
@didrocks What's your golang version?

@didrocks
Copy link

Tested gotip tool trace with chrome 80.0.3987.87 and firefox 73 on ubuntu focal (which will be ubuntu 20.04) and I confirm that the UI is now correctly loading.
@didrocks What's your golang version?

go version devel +b8f54e5 Fri Feb 28 09:29:22 2020 +0000 linux/amd64

@Alex-duzhichao
Copy link

Tested gotip tool trace with chrome 80.0.3987.87 and firefox 73 on ubuntu focal (which will be ubuntu 20.04) and I confirm that the UI is now correctly loading.
@didrocks What's your golang version?

go version devel +b8f54e5 Fri Feb 28 09:29:22 2020 +0000 linux/amd64

Thank you very much.
I tried gotip on Macos and Centos. gotip works on Macos, but failed on Centos when I called gotip download.

It complains:

Updating the go development tree...
HEAD is now at 26154f3... cmd/compile: use NEG/NEGW pseudo-instructions on riscv64
error: unknown switch `i'
usage: git clean [-d] [-f] [-n] [-q] [-e ] [-x | -X] [--] ...

-q, --quiet do not print names of files removed
-n, --dry-run dry run
-f, --force force
-d remove whole directories
-e, --exclude
add to ignore rules
-x remove ignored files, too
-X remove only ignored files

gotip: failed to cleanup git repository: exit status 129

Do you hava any suggestion?

@Alex-duzhichao
Copy link

The fix is in the tip and waiting for feedback so it can be included in the patch release of go1.14. Please try the version (the easiest is https://godoc.org/golang.org/dl/gotip and gotip tool trace ...

I tried gotip on centos. There is something wrong with gotip download:

Updating the go development tree...
HEAD is now at 26154f3... cmd/compile: use NEG/NEGW pseudo-instructions on riscv64
error: unknown switch `i'
usage: git clean [-d] [-f] [-n] [-q] [-e ] [-x | -X] [--] ...

-q, --quiet do not print names of files removed
-n, --dry-run dry run
-f, --force force
-d remove whole directories
-e, --exclude
add to ignore rules
-x remove ignored files, too
-X remove only ignored files

gotip: failed to cleanup git repository: exit status 129

Do you have any solution about how to fix this?

@hyangah
Copy link
Contributor

hyangah commented Mar 16, 2020

Please file a separate bug to track the gotip issue. cc @FiloSottile

If gotip doesn't work, an alternative is to build from the source. The instruction is https://golang.org/doc/install/source

I think the minor version release will be available soon and include the fix. But I don't know the concrete timeline yet cc @andybons

@yangeagle
Copy link

It is OK on Macos:
go 1.14.4
firefox 77.0.1 (64 bit)

@davecheney
Copy link
Contributor

Marking as resolved based on #25151 (comment)

@golang golang locked as resolved and limited conversation to collaborators Jul 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests