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/cover: inconsistent NumStmt with prometheus #45361

Open
catenacyber opened this issue Apr 2, 2021 · 1 comment
Open

cmd/cover: inconsistent NumStmt with prometheus #45361

catenacyber opened this issue Apr 2, 2021 · 1 comment
Labels
NeedsInvestigation

Comments

@catenacyber
Copy link
Contributor

@catenacyber catenacyber commented Apr 2, 2021

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

$ go version
go version go1.16.2 linux/amd64

Does this issue reproduce with the latest release?

It is indeed the latest release

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/root/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/root/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/root/.go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/root/.go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16.2"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
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=/tmp/go-build2943966716=/tmp/go-build -gno-record-gcc-switches"

What did you do?

git clone https://github.com/prometheus/prometheus
cd prometheus/promql/parser
go test -coverprofile=wrong.out
go tool cover -html wrong.out

What did you expect to see?

Get the HTML coverage report

What did you see instead?

Error message cover: inconsistent NumStmt: changed from 2 to 1

The wrong.out contains indeed (running grep generated_parser.y.go wrong.out | grep 178

github.com/prometheus/prometheus/promql/parser/generated_parser.y.go:178.0,180.0 2 1
github.com/prometheus/prometheus/promql/parser/generated_parser.y.go:179.0,178.0 2 1
github.com/prometheus/prometheus/promql/parser/generated_parser.y.go:176.0,178.0 1 1
github.com/prometheus/prometheus/promql/parser/generated_parser.y.go:178.0,180.0 1 1

I found this by modifying the covermessage with adding %#+v about other fields

@seankhliao seankhliao changed the title Coverage inconsistent NumStmt with prometheus cmd/cover: inconsistent NumStmt with prometheus Apr 3, 2021
@seankhliao seankhliao added the NeedsInvestigation label Apr 3, 2021
benthor added a commit to netsys-lab/scion-rains that referenced this issue Dec 3, 2021
@yufeiminds
Copy link

@yufeiminds yufeiminds commented Jun 16, 2022

It still does not work on my laptop.

  • OS: macOS Catalina 10.15.5 19F101 x86_64 / Intel Chip
  • Go version: 1.18.3

Any update on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation
Projects
None yet
Development

No branches or pull requests

4 participants
@yufeiminds @seankhliao @catenacyber and others