We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Detected by travis cron-job (https://app.travis-ci.com/github/ethereum/go-ethereum/jobs/583768087)
================== WARNING: DATA RACE Write at 0x00c0006fe4a0 by goroutine 364: github.com/ethereum/go-ethereum/graphql.(*Transaction).Logs() /home/travis/gopath/src/github.com/ethereum/go-ethereum/graphql/graphql.go:466 +0x3b0 runtime.call32() /home/travis/.gimme/versions/go1.19.1.linux.amd64/src/runtime/asm_amd64.s:725 +0x48 reflect.Value.Call() /home/travis/.gimme/versions/go1.19.1.linux.amd64/src/reflect/value.go:368 +0xc7 github.com/graph-gophers/graphql-go/internal/exec.execFieldSelection.func2() /home/travis/gopath/pkg/mod/github.com/graph-gophers/graphql-go@v1.3.0/internal/exec/exec.go:211 +0xa1b github.com/graph-gophers/graphql-go/internal/exec.execFieldSelection() /home/travis/gopath/pkg/mod/github.com/graph-gophers/graphql-go@v1.3.0/internal/exec/exec.go:231 +0x37d github.com/graph-gophers/graphql-go/internal/exec.(*Request).execSelections.func1() /home/travis/gopath/pkg/mod/github.com/graph-gophers/graphql-go@v1.3.0/internal/exec/exec.go:81 +0x2d4 github.com/graph-gophers/graphql-go/internal/exec.(*Request).execSelections.func2() /home/travis/gopath/pkg/mod/github.com/graph-gophers/graphql-go@v1.3.0/internal/exec/exec.go:82 +0x47 Previous read at 0x00c0006fe4a0 by goroutine 365: github.com/ethereum/go-ethereum/rpc.(*BlockNumberOrHash).Hash() /home/travis/gopath/src/github.com/ethereum/go-ethereum/rpc/types.go:223 +0x144 github.com/ethereum/go-ethereum/graphql.(*Transaction).Logs() /home/travis/gopath/src/github.com/ethereum/go-ethereum/graphql/graphql.go:460 +0xcb runtime.call32() /home/travis/.gimme/versions/go1.19.1.linux.amd64/src/runtime/asm_amd64.s:725 +0x48 reflect.Value.Call() /home/travis/.gimme/versions/go1.19.1.linux.amd64/src/reflect/value.go:368 +0xc7 github.com/graph-gophers/graphql-go/internal/exec.execFieldSelection.func2() /home/travis/gopath/pkg/mod/github.com/graph-gophers/graphql-go@v1.3.0/internal/exec/exec.go:211 +0xa1b github.com/graph-gophers/graphql-go/internal/exec.execFieldSelection() /home/travis/gopath/pkg/mod/github.com/graph-gophers/graphql-go@v1.3.0/internal/exec/exec.go:231 +0x37d github.com/graph-gophers/graphql-go/internal/exec.(*Request).execSelections.func1() /home/travis/gopath/pkg/mod/github.com/graph-gophers/graphql-go@v1.3.0/internal/exec/exec.go:81 +0x2d4 github.com/graph-gophers/graphql-go/internal/exec.(*Request).execSelections.func2() /home/travis/gopath/pkg/mod/github.com/graph-gophers/graphql-go@v1.3.0/internal/exec/exec.go:82 +0x47 Goroutine 364 (running) created at:
func (t *Transaction) Logs(ctx context.Context) (*[]*Log, error) { if _, err := t.resolve(ctx); err != nil { return nil, err } if t.block == nil { return nil, nil } if _, ok := t.block.numberOrHash.Hash(); !ok { header, err := t.r.backend.HeaderByNumberOrHash(ctx, *t.block.numberOrHash) if err != nil { return nil, err } hash := header.Hash() t.block.numberOrHash.BlockHash = &hash // <--- THIS LINE } return t.getLogs(ctx) }
func (bnh *BlockNumberOrHash) Hash() (common.Hash, bool) { if bnh.BlockHash != nil { // <-- PREV READ return *bnh.BlockHash, true } return common.Hash{}, false }
The text was updated successfully, but these errors were encountered:
This code keeps on giving...I'll look into it thanks for reporting.
Sorry, something went wrong.
t.block.numberOrHash.BlockHash = &hash
Perhaps you can just change this to be set/read using atomic , via a setter and a getter?
atomic
Hm, the fields are public, so that's not a super-great change
null
Should be fixed as part of #26965.
s1na
No branches or pull requests
Detected by travis cron-job (https://app.travis-ci.com/github/ethereum/go-ethereum/jobs/583768087)
The text was updated successfully, but these errors were encountered: