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: http /trace endpoint broken javascript #37987

Closed
tatatodd opened this issue Mar 21, 2020 · 1 comment
Closed

cmd/trace: http /trace endpoint broken javascript #37987

tatatodd opened this issue Mar 21, 2020 · 1 comment

Comments

@tatatodd
Copy link
Contributor

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

$ go version
go version go1.14 darwin/amd64

Does this issue reproduce with the latest release?

go.1.14 is the latest release. It also reproduces on go1.13.8

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/toddwang/Library/Caches/go-build"
GOENV="/Users/toddwang/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/toddwang/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.14/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.14/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="***REDACTED***/go.mod"
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/rw/lyr53c8115bf5y6q_4f0_yyh0000gn/T/go-build853332319=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

  1. Create a trace.out file.
  2. Run go tool trace
$ go tool trace /tmp/trace.out
2020/03/21 12:34:08 Parsing trace...
2020/03/21 12:34:09 Splitting trace...
2020/03/21 12:34:10 Opening browser. Trace viewer is listening on http://127.0.0.1:53686
  1. Visit http://127.0.0.1:53686 in Chrome Version 80.0.3987.149 (Official Build) (64-bit)
  2. Click on View trace, which takes me to http://127.0.0.1:53686/trace. The page is empty.
  3. Open Chrome javascript console (cmd-opt-j on Mac).
  4. Reload http://127.0.0.1:53686/trace and see the broken javascript:
Uncaught ReferenceError: tr is not defined
    at onResult (trace:59)
    at trace:43
  1. Click through to see the JS that caused the error:
58  function onResult(result) {
59    model = new tr.Model();  ## tr is not defined here
60    var opts = new tr.importer.ImportOptions();
61    opts.shiftWorldToZero = false;
62    var i = new tr.importer.Import(model, opts);
63    var p = i.importTracesWithProgressDialog([result]);
64    p.then(onModelLoaded, onImportFail);
65  }
  1. Give up and file a bug, because I'm lousy at JS.

What did you expect to see?

I expect to see a non-empty trace in my browser. This is my first time using go tool trace so I don't know what it's supposed to show me. Note that the /trace endpoint is also used when you click on a specific goroutine number in the /goroutines page, and is similarly broken.

What did you see instead?

An empty trace in my browser, and the above broken javascript in the console.
AFAICT the other links on the local http server seem to work fine; only /trace seems to be broken.

@agnivade
Copy link
Contributor

Duplicate of #34374. Please use 1.14.1. Thanks.

@golang golang locked and limited conversation to collaborators Mar 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants