-
Notifications
You must be signed in to change notification settings - Fork 17.6k
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/compile: panic by building with GOSSAFUNC in Go1.15 #40919
Comments
It's trying to print you an error because it couldn't open the ssa.html file. Is the directory not writeable? Ah, maybe its trying to print an ssa.html for Part of the problem is GOSSAFUNC uses a package-local name, so it can match in multiple packages, including stdlib. |
I see now. The error writer tries to use the entry block's line number to annotate the error, but the entry block has not been set yet. Oops. |
Change https://golang.org/cl/249497 mentions this issue: |
I don't think this is worth backporting, GOSSAFUNC is a best-effort service. |
As noted already, the specific panic here seems to be around error printing. The underlying issue that causes the error in this case seems like it could be similar to #33278, so it may be helpful to consult that issue for reference (it looks like using |
Change https://golang.org/cl/250340 mentions this issue: |
Old behavior is still enabled because it doesn't hurt to leave it in and existing users of this feature (there are dozens of us!) will not be surprised. Adding this finer control allows users to avoid writing ssa.html where they can't, shouldn't, or just don't want to. Example, both ways: $ GOSSAFUNC="(*Reader).Reset" go test -c -o ./a compress/gzip dumped SSA to bytes/ssa.html dumped SSA to strings/ssa.html dumped SSA to bufio/ssa.html dumped SSA to compress/gzip/ssa.html $ GOSSAFUNC="compress/gzip.(*Reader).Reset" go test -c -o ./a compress/gzip dumped SSA to compress/gzip/ssa.html Updates #40919. Change-Id: I06b77c3c1d326372a32651570b5dd6e56dfb1d7f Reviewed-on: https://go-review.googlesource.com/c/go/+/250340 Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes. It does not happen in Go1.14.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
Build successfully and generate ssa.html.
What did you see instead?
panic has been occurred.
The text was updated successfully, but these errors were encountered: