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/compile: 'unexpected source op' spam in GOSSAFUNC output #25404

Closed
mundaym opened this issue May 15, 2018 · 5 comments
Closed

cmd/compile: 'unexpected source op' spam in GOSSAFUNC output #25404

mundaym opened this issue May 15, 2018 · 5 comments
Milestone

Comments

@mundaym
Copy link
Member

mundaym commented May 15, 2018

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

Tip (go version devel +212c9479e3 Tue May 15 16:29:04 2018 +0000 darwin/amd64).

Does this issue reproduce with the latest release?

No (tested 1.10.1).

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

darwin/amd64, but probably a universal issue.

What did you do?

go get -u golang.org/x/crypto
cd $GOPATH/src/golang.org/x/crypto/internal/chacha20
GOSSAFUNC=\(*Cipher\).XORKeyStream go test -c

What did you expect to see?

No extra output.

What did you see instead?

...
unexpected at 2721:load with unexpected source op v3278unexpected at 2775:load with 
unexpected source op v3281unexpected at 2249:load with unexpected source op 
v3289unexpected at 2875:load with unexpected source op v3278unexpected at 2232:load 
with unexpected source op v286unexpected at 2231:load with unexpected source op v3291unexpected at 2784:load with unexpected source op v3289unexpected at 2785:load 
with unexpected source op v3291
...

This appears to be generated by

state.unexpected(v, "load with unexpected source op %v", a)
. The unexpected op in question appears to always be a Phi.

@mundaym mundaym added this to the Go1.11 milestone May 15, 2018
@randall77
Copy link
Contributor

@heschik

@gopherbot
Copy link

Change https://golang.org/cl/113275 mentions this issue: cmd/compile: improve error message emitted by debug info generation

@heschi
Copy link
Contributor

heschi commented May 15, 2018

Thanks. There are three issues here:

  • I forgot the newline at the end of the log message.
  • The debug information should definitely understand a load from a phi.
  • There's no context for the log message.

Most of the unexpected() calls have gone by the wayside in refactoring passes, so I could probably just convert these to log statements now.

gopherbot pushed a commit that referenced this issue May 15, 2018
Before:

unexpected at 2721:load with unexpected source op v3278unexpected at 2775:load with
unexpected source op v3281unexpected at 2249:load with unexpected source op
v3289unexpected at 2875:load with unexpected source op v3278unexpected at 2232:load
with unexpected source op v286unexpected at 2231:load with unexpected source op
v3291unexpected at 2784:load with unexpected source op v3289unexpected at 2785:load
with unexpected source op v3291

After:

debug info generation: v2721: load with unexpected source op: Phi (v3278)
debug info generation: v2775: load with unexpected source op: Phi (v3281)
debug info generation: v2249: load with unexpected source op: Phi (v3289)
debug info generation: v2875: load with unexpected source op: Phi (v3278)
debug info generation: v2232: load with unexpected source op: Phi (v286)
debug info generation: v2231: load with unexpected source op: Phi (v3291)
debug info generation: v2784: load with unexpected source op: Phi (v3289)
debug info generation: v2785: load with unexpected source op: Phi (v3291)

Updates #25404.

Change-Id: Ib97722848d27ca18bdcd482a610626bc3c6def7d
Reviewed-on: https://go-review.googlesource.com/113275
Run-TryBot: Michael Munday <mike.munday@ibm.com>
Run-TryBot: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
@heschi heschi self-assigned this May 22, 2018
@gopherbot
Copy link

Change https://golang.org/cl/114008 mentions this issue: cmd/compile: fix debug info generation for loads from Phis

@gopherbot
Copy link

Change https://golang.org/cl/114007 mentions this issue: cmd/compile: clean up debug info generation logging

gopherbot pushed a commit that referenced this issue May 23, 2018
Remove the unexpected function, which is a lot less relevant now that
the generation basically can't detect invalid states, and make sure no
logging appears without -d locationlists=2.

Updates #25404

Change-Id: If3522df5a7397f2e7b43cb808936e319132132b6
Reviewed-on: https://go-review.googlesource.com/114007
Run-TryBot: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
@golang golang locked and limited conversation to collaborators May 23, 2019
@rsc rsc unassigned heschi Jun 23, 2022
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

4 participants