Skip to content

deadlock when calling eth.getLogs if fromBlock is small #1125

@github1youlc

Description

@github1youlc

System information

Geth version:
Geth
Version: 1.1.15
Architecture: amd64
Go Version: go1.18.3
Operating System: linux

OS & Version: Linux

Expected behaviour

After attaching geth, this script

eth.getLogs({"fromBlock": "0x0", "toBlock": "0x3E8", "topics": [["0x3c13bc30b8e878c53fd2a36b679409c073afd75950be43d8858768e956fbc20e"]]})

should response normally.

Actual behaviour

It block forever. And some goroutines trapped in deadlock.

sync.runtime_SemacquireMutex+0x24 /home/ubuntu/opt/go/src/runtime/sema.go:71
sync.(*Mutex).lockSlow+0x164 /home/ubuntu/opt/go/src/sync/mutex.go:162
sync.(*Mutex).Lock+0x52 /home/ubuntu/opt/go/src/sync/mutex.go:81
sync.(*Once).doSlow+0x26 /home/ubuntu/opt/go/src/sync/once.go:64
sync.(*Once).Do+0x44 /home/ubuntu/opt/go/src/sync/once.go:59
github.com/ethereum/go-ethereum/core/bloombits.(*MatcherSession).Close+0x14 /home/ubuntu/projects/bsc-workspace/bsc-geth/core/bloombits/matcher.go:528
github.com/ethereum/go-ethereum/eth/filters.(*Filter).indexedLogs+0x4c9 /home/ubuntu/projects/bsc-workspace/bsc-geth/eth/filters/filter.go:201
github.com/ethereum/go-ethereum/eth/filters.(*Filter).Logs+0x1ab /home/ubuntu/projects/bsc-workspace/bsc-geth/eth/filters/filter.go:162
github.com/ethereum/go-ethereum/eth/filters.(*PublicFilterAPI).GetLogs+0x192 /home/ubuntu/projects/bsc-workspace/bsc-geth/eth/filters/api.go:355

sync.runtime_Semacquire+0x24 /home/ubuntu/opt/go/src/runtime/sema.go:56
sync.(*WaitGroup).Wait+0x51 /home/ubuntu/opt/go/src/sync/waitgroup.go:136
github.com/ethereum/go-ethereum/core/bloombits.(*MatcherSession).Close.func1+0x33 /home/ubuntu/projects/bsc-workspace/bsc-geth/core/bloombits/matcher.go:531
sync.(*Once).doSlow+0xc1 /home/ubuntu/opt/go/src/sync/once.go:68
sync.(*Once).Do+0x44 /home/ubuntu/opt/go/src/sync/once.go:59
github.com/ethereum/go-ethereum/core/bloombits.(*MatcherSession).Close+0x14 /home/ubuntu/projects/bsc-workspace/bsc-geth/core/bloombits/matcher.go:528
github.com/ethereum/go-ethereum/core/bloombits.(*MatcherSession).Multiplex+0x359 /home/ubuntu/projects/bsc-workspace/bsc-geth/core/bloombits/matcher.go:641

github.com/ethereum/go-ethereum/core/bloombits.(*Matcher).distributor+0x31e /home/ubuntu/projects/bsc-workspace/bsc-geth/core/bloombits/matcher.go:411
github.com/ethereum/go-ethereum/core/bloombits.(*Matcher).run.func2+0x24 /home/ubuntu/projects/bsc-workspace/bsc-geth/core/bloombits/matcher.go:253

Steps to reproduce the behaviour

Execute this script in attached geth terminal.

eth.getLogs({"fromBlock": "0x0", "toBlock": "0x3E8", "topics": [["0x3c13bc30b8e878c53fd2a36b679409c073afd75950be43d8858768e956fbc20e"]]})

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions