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

wtxmgr: panic on interrupt #283

Closed
tuxcanfly opened this issue May 21, 2015 · 1 comment
Closed

wtxmgr: panic on interrupt #283

tuxcanfly opened this issue May 21, 2015 · 1 comment
Assignees

Comments

@tuxcanfly
Copy link
Contributor

This happens sometimes when btcsim is interrupted. Will try to list the exact steps to repro, maybe consider it low priority until then.

unexpected fault address 0x7fc2277c6068
fatal error: fault
[signal 0xb code=0x1 addr=0x7fc2277c6068 pc=0x82ee1d]

goroutine 37 [running]:
runtime.gothrow(0xaac260, 0x5)
        /usr/local/go/src/runtime/panic.go:503 +0x8e fp=0xc2095490b0 sp=0xc209549098
runtime.sigpanic()
        /usr/local/go/src/runtime/sigpanic_unix.go:29 +0x265 fp=0xc209549100 sp=0xc2095490b0
github.com/btcsuite/bolt.func·009(0x5, 0x7fc22c038500)
        /home/tuxcanfly/Work/conformal/src/github.com/btcsuite/bolt/cursor.go:318 +0x5d fp=0xc209549188 sp=0xc209549100
sort.Search(0xb, 0xc209549240, 0x7)
        /usr/local/go/src/sort/search.go:66 +0x59 fp=0xc2095491b8 sp=0xc209549188
github.com/btcsuite/bolt.(*Cursor).nsearch(0xc2098ea140, 0xf0926c, 0x2, 0x2)
        /home/tuxcanfly/Work/conformal/src/github.com/btcsuite/bolt/cursor.go:319 +0x166 fp=0xc209549278
github.com/btcsuite/bolt.(*Cursor).seek(0xc2098ea140, 0xf0926c, 0x2, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /home/tuxcanfly/Work/conformal/src/github.com/btcsuite/bolt/cursor.go:152 +0x122 fp=0xc2095493d0 sp=0xc209549370
github.com/btcsuite/bolt.(*Bucket).Bucket(0xc20883eac0, 0xf0926c, 0x2, 0x2, 0x0)
        /home/tuxcanfly/Work/conformal/src/github.com/btcsuite/bolt/bucket.go:111 +0x1df fp=0xc2095494c0 sp=0xc2095493d0
github.com/btcsuite/btcwallet/walletdb/bdb.(*bucket).Bucket(0xc20883eac0, 0xf0926c, 0x2, 0x2, 0x0, 0x0)
        /home/tuxcanfly/Work/conformal/src/github.com/btcsuite/btcwallet/walletdb/bdb/db.go:77 +0x58 fp=0xc2095494f8 sp=0xc2095494c0
github.com/btcsuite/btcwallet/wtxmgr.existsRawUnminedInput(0x7fc22e8944e0, 0xc20883eac0, 0x7fc2277ab578, 0x24, 0x7ffffb67, 0x0, 0x0, 0x0)
        /home/tuxcanfly/Work/conformal/src/github.com/btcsuite/btcwallet/wtxmgr/db.go:1185 +0x73 fp=0xc209549548 sp=0xc2095494f8
github.com/btcsuite/btcwallet/wtxmgr.func·017(0x7fc2277ab578, 0x24, 0x7ffffb67, 0x7fc2277ab59c, 0x24, 0x7ffffb43, 0x0, 0x0)
        /home/tuxcanfly/Work/conformal/src/github.com/btcsuite/btcwallet/wtxmgr/tx.go:837 +0x169 fp=0xc2095495f0 sp=0xc209549548
github.com/btcsuite/bolt.(*Bucket).ForEach(0xc20883eb00, 0xc209d8e6f0, 0x0, 0x0)
        /home/tuxcanfly/Work/conformal/src/github.com/btcsuite/bolt/bucket.go:356 +0x1dd fp=0xc2095496a8 sp=0xc2095495f0
github.com/btcsuite/btcwallet/walletdb/bdb.(*bucket).ForEach(0xc20883eb00, 0xc209d8e6f0, 0x0, 0x0)
        /home/tuxcanfly/Work/conformal/src/github.com/btcsuite/btcwallet/walletdb/bdb/db.go:130 +0x44 fp=0xc2095496e0 sp=0xc2095496a8
github.com/btcsuite/btcwallet/wtxmgr.(*Store).balance(0xc2083c6300, 0x7fc22e8944e0, 0xc20883eac0, 0x3ef00000001, 0xc20883eac0, 0x0, 0x0)
        /home/tuxcanfly/Work/conformal/src/github.com/btcsuite/btcwallet/wtxmgr/tx.go:846 +0x2a6 fp=0xc209549a88 sp=0xc2095496e0
github.com/btcsuite/btcwallet/wtxmgr.func·016(0x7fc22e8944e0, 0xc20883eac0, 0x0, 0x0)
        /home/tuxcanfly/Work/conformal/src/github.com/btcsuite/btcwallet/wtxmgr/tx.go:812 +0x80 fp=0xc209549ae0 sp=0xc209549a88
github.com/btcsuite/btcwallet/wtxmgr.scopedView(0x7fc22e894470, 0xc2080cb580, 0xc209549c88, 0x0, 0x0)
        /home/tuxcanfly/Work/conformal/src/github.com/btcsuite/btcwallet/wtxmgr/db.go:1385 +0x1dd fp=0xc209549c58 sp=0xc209549ae0
github.com/btcsuite/btcwallet/wtxmgr.(*Store).Balance(0xc2083c6300, 0x3ef00000001, 0xc208162180, 0x0, 0x0)
        /home/tuxcanfly/Work/conformal/src/github.com/btcsuite/btcwallet/wtxmgr/tx.go:814 +0x8b fp=0xc209549cb8 sp=0xc209549c58
github.com/btcsuite/btcwallet/wallet.(*Wallet).notifyBalances(0xc2080be000, 0xc2000003ef)
        /home/tuxcanfly/Work/conformal/src/github.com/btcsuite/btcwallet/wallet/chainntfns.go:218 +0x68 fp=0xc209549d40 sp=0xc209549cb8
github.com/btcsuite/btcwallet/wallet.(*Wallet).addRelevantTx(0xc2080be000, 0xc2081af4d0, 0xc20850fa40, 0x0, 0x0)
        /home/tuxcanfly/Work/conformal/src/github.com/btcsuite/btcwallet/wallet/chainntfns.go:205 +0x1f9 fp=0xc209549ea8 sp=0xc209549d40
github.com/btcsuite/btcwallet/wallet.(*Wallet).handleChainNotifications(0xc2080be000)
        /home/tuxcanfly/Work/conformal/src/github.com/btcsuite/btcwallet/wallet/chainntfns.go:48 +0x3b0 fp=0xc209549fd8 sp=0xc209549ea8
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:2232 +0x1 fp=0xc209549fe0 sp=0xc209549fd8
created by github.com/btcsuite/btcwallet/wallet.(*Wallet).Start
        /home/tuxcanfly/Work/conformal/src/github.com/btcsuite/btcwallet/wallet/wallet.go:304 +0x19d
@jrick
Copy link
Member

jrick commented Mar 9, 2016

This is due to bolt transactions still being active while the database is closed. I will look into adding a mutex in walletdb to prevent this from happening.

@jrick jrick self-assigned this Mar 9, 2016
jrick added a commit to jrick/btcwallet that referenced this issue Mar 11, 2016
This corrects and simplifies the shutdown logic for interrupts, the
walletrpc.WalletLoaderService/CloseWallet RPC, and the legacy stop RPC
by both stopping all wallet processes and closing the wallet database.
It appears that this behavior broke as part of the wallet package
refactor, causing occasional nil pointer panics and memory faults when
closing the wallet database with active transactions.

Fixes btcsuite#282.

Fixes btcsuite#283.
jrick added a commit to jrick/btcwallet that referenced this issue Mar 11, 2016
This corrects and simplifies the shutdown logic for interrupts, the
walletrpc.WalletLoaderService/CloseWallet RPC, and the legacy stop RPC
by both stopping all wallet processes and closing the wallet database.
It appears that this behavior broke as part of the wallet package
refactor, causing occasional nil pointer panics and memory faults when
closing the wallet database with active transactions.

Fixes btcsuite#282.

Fixes btcsuite#283.
alexlyp added a commit to alexlyp/btcwallet that referenced this issue Jun 28, 2016
buck54321 added a commit to buck54321/btcwallet that referenced this issue May 8, 2024
Remove duplicate NeutrinoClient interface
Merge btcsuite#265 cache+neutrino: add new cache module by @Roasbeef
Merge btcsuite#261 cache+neutrino: update existing Cache interface to use type parameters by @Roasbeef
Merge btcsuite#268 cache: add deletion and iteration methods by @yyforyongyu
Merge btcsuite#279 lru: add methods to range with orders by @yyforyongyu
Merge btcsuite#278 pushtx: map different backend err to internal err by @ziggie1984
Merge btcsuite#273 query+neutrino: use query dispatcher for GetBlock and GetCFilte by @ellemouton
Merge btcsuite#274 multi: introduce a batch filter writer by @ellemouton
Merge btcsuite#275 rescan: use batch filter fetching by @ellemouton
Merge btcsuite#283 blockmanager.go: use btcd libs to validate headers by @guggero
Merge btcsuite#288 neutrino: Added ResetRanking method to PeerRanking by @Chinwendu20
Merge btcsuite#293 & btcsuite#294 Fix typos by @vuittont60
Merge btcsuite#297 query: fix retry query case by @ziggie1984
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants