NebulousLabs / Sia

Blockchain-based marketplace for file storage. Project has moved to GitLab: https://gitlab.com/NebulousLabs/Sia
https://sia.tech
MIT License
2.71k stars 440 forks source link

"slice bounds out of range" in getBlockTotals #2183

Open Pertti132 opened 7 years ago

Pertti132 commented 7 years ago

A critical error loading Sia has occured: Siad unexpectedly exited. Error log: Loading... (0/6) Loading siad... (1/6) Loading gateway... (2/6) Loading consensus... (3/6) Loading transaction pool... panic: runtime error: slice bounds out of range

goroutine 67 [running]: github.com/NebulousLabs/Sia/modules/consensus.(ConsensusSet).getBlockTotals(0xc042115b80, 0xc042996000, 0x1500000000000000, 0xee743f9fd0122a30, 0x413a6e45e9c4300f, 0x3ae9d5f06a2f666, 0xc0421a6800, 0x0, 0x0, 0x0, ...) /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/difficulty.go:120 +0x13b github.com/NebulousLabs/Sia/modules/consensus.(ConsensusSet).newChild(0xc042115b80, 0xc042996000, 0xc0429c2000, 0x1500000000000000, 0xee743f9fd0122a30, 0x413a6e45e9c4300f, 0x3ae9d5f06a2f666, 0x4a001170140b0df, 0x59777861, 0xc0421a6800, ...) /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/processedblock.go:135 +0x1a8 github.com/NebulousLabs/Sia/modules/consensus.(ConsensusSet).addBlockToTree(0xc042115b80, 0xc042996000, 0x1500000000000000, 0xee743f9fd0122a30, 0x413a6e45e9c4300f, 0x3ae9d5f06a2f666, 0x4a001170140b0df, 0x59777861, 0xc0421a6800, 0x1, ...) /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/accept.go:151 +0xa3 github.com/NebulousLabs/Sia/modules/consensus.(ConsensusSet).managedAcceptBlocks.func1(0xc042996000, 0xb0b570, 0xc042996000) /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/accept.go:262 +0x23a github.com/NebulousLabs/bolt.(DB).Update(0xc0420dc780, 0xc0422392e8, 0x0, 0x0) /home/luke/go/src/github.com/NebulousLabs/bolt/db.go:603 +0xa6 github.com/NebulousLabs/Sia/modules/consensus.(ConsensusSet).managedAcceptBlocks(0xc042115b80, 0xc0423dc0c0, 0x2, 0x2, 0x0, 0x0, 0x0) /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/accept.go:283 +0x520 github.com/NebulousLabs/Sia/modules/consensus.(ConsensusSet).managedReceiveBlocks(0xc042115b80, 0xde41c0, 0xc04220e1a0, 0x0, 0x0) /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/synchronize.go:225 +0x5be github.com/NebulousLabs/Sia/modules/consensus.(ConsensusSet).(github.com/NebulousLabs/Sia/modules/consensus.managedReceiveBlocks)-fm(0xde41c0, 0xc04220e1a0, 0x0, 0x0) /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/synchronize.go:445 +0x45 github.com/NebulousLabs/Sia/modules/gateway.(Gateway).managedRPC(0xc04205ac60, 0xc0421846c0, 0x11, 0xaddb78, 0xa, 0xc04211e000, 0x0, 0x0) /home/luke/go/src/github.com/NebulousLabs/Sia/modules/gateway/rpc.go:66 +0x339 github.com/NebulousLabs/Sia/modules/gateway.(Gateway).RPC(0xc04205ac60, 0xc0421846c0, 0x11, 0xaddb78, 0xa, 0xc04211e000, 0x0, 0x0) /home/luke/go/src/github.com/NebulousLabs/Sia/modules/gateway/rpc.go:76 +0xd8 github.com/NebulousLabs/Sia/modules/consensus.(ConsensusSet).threadedInitialBlockchainDownload.func1(0xc042115b80, 0xc042239ef0, 0xc042239eb0, 0xc042239eb8, 0x0, 0x0) /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/synchronize.go:580 +0x133 github.com/NebulousLabs/Sia/modules/consensus.(ConsensusSet).threadedInitialBlockchainDownload(0xc042115b80, 0x0, 0x0) /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/synchronize.go:601 +0x30e github.com/NebulousLabs/Sia/modules/consensus.New.func1(0x1, 0xc04223aa30, 0xc042115b80, 0xde4440, 0xc04205ac60) /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/consensusset.go:151 +0x404 created by github.com/NebulousLabs/Sia/modules/consensus.New /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/consensusset.go:182 +0x641

lukechampine commented 7 years ago

@DavidVorick this appears to be the same bug as https://github.com/NebulousLabs/Sia/issues/2118

Pertti132 commented 7 years ago

Is there anyway to unfuck this problem?

DavidVorick commented 7 years ago

In the short term, you're probably okay to delete your consensus.db. In the long term, it'll take me a while to figure out what led to the out-of-bounds error.

bluegizmo83 commented 7 years ago

I too got this same error when I updated to 1.3.0 If it matters, I'm running the Sia-UI on windows 10. To install 1.3.0 I just extracted the RAR file and overwrote the old files in my C:\Sia-UI\resources\app\Sia folder. The Sia app was not fully synced before the update, as I havn't had it running the last few days. Deleting the old consensus.db file seems to have worked though, it's Syncing again in the Sia-UI.

EDIT: After my Sia-UI finished syncing the blockchain again, it now shows duplicates of all my wallet transactions, still has the correct balance though. siadup

Dagon- commented 7 years ago

FYI, Getting the same thing after updating to 1.3.0:

Loading...
(0/6) Loading siad...
(1/6) Loading gateway...
(2/6) Loading consensus...
(3/6) Loading transaction pool...
(4/6) Loading wallet...
(5/6) Loading host...
(6/6) Loading renter...
Finished loading in 0.525551684 seconds
panic: runtime error: slice bounds out of range

goroutine 14 [running]:
github.com/NebulousLabs/Sia/modules/consensus.(*ConsensusSet).getBlockTotals(0xc420147b80, 0xc420f0c620, 0x5100000000000000, 0xb5d34eb8e8666fd3, 0xb8272bae54839530, 0x98a5e36790ec3299, 0xc4208f53c0, 0x0, 0x0, 0x0, ...)
    /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/difficulty.go:120 +0x134
github.com/NebulousLabs/Sia/modules/consensus.(*ConsensusSet).newChild(0xc420147b80, 0xc420f0c620, 0xc420784b00, 0x5100000000000000, 0xb5d34eb8e8666fd3, 0xb8272bae54839530, 0x98a5e36790ec3299, 0xacbf0f08009c3203, 0x59726d22, 0xc4208f53c0, ...)
    /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/processedblock.go:135 +0x1a1
github.com/NebulousLabs/Sia/modules/consensus.(*ConsensusSet).addBlockToTree(0xc420147b80, 0xc420f0c620, 0x5100000000000000, 0xb5d34eb8e8666fd3, 0xb8272bae54839530, 0x98a5e36790ec3299, 0xacbf0f08009c3203, 0x59726d22, 0xc4208f53c0, 0x1, ...)
    /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/accept.go:151 +0x9c
github.com/NebulousLabs/Sia/modules/consensus.(*ConsensusSet).managedAcceptBlocks.func1(0xc420f0c620, 0xb036c8, 0xc420f0c620)
    /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/accept.go:262 +0x233
github.com/NebulousLabs/bolt.(*DB).Update(0xc42010e780, 0xc42162b2e8, 0x0, 0x0)
    /home/luke/go/src/github.com/NebulousLabs/bolt/db.go:603 +0x9f
github.com/NebulousLabs/Sia/modules/consensus.(*ConsensusSet).managedAcceptBlocks(0xc420147b80, 0xc42002dc00, 0xa, 0xa, 0x0, 0x0, 0x0)
    /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/accept.go:283 +0x519
github.com/NebulousLabs/Sia/modules/consensus.(*ConsensusSet).managedReceiveBlocks(0xc420147b80, 0xde2720, 0xc420374160, 0x0, 0x0)
    /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/synchronize.go:225 +0x5b7
github.com/NebulousLabs/Sia/modules/consensus.(*ConsensusSet).(github.com/NebulousLabs/Sia/modules/consensus.managedReceiveBlocks)-fm(0xde2720, 0xc420374160, 0x0, 0x0)
    /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/synchronize.go:445 +0x3e
github.com/NebulousLabs/Sia/modules/gateway.(*Gateway).managedRPC(0xc420080c60, 0xc4201a5f20, 0x13, 0xad6ab0, 0xa, 0xc420cf21d0, 0x0, 0x0)
    /home/luke/go/src/github.com/NebulousLabs/Sia/modules/gateway/rpc.go:66 +0x332
github.com/NebulousLabs/Sia/modules/gateway.(*Gateway).RPC(0xc420080c60, 0xc4201a5f20, 0x13, 0xad6ab0, 0xa, 0xc420cf21d0, 0x0, 0x0)
    /home/luke/go/src/github.com/NebulousLabs/Sia/modules/gateway/rpc.go:76 +0xd1
github.com/NebulousLabs/Sia/modules/consensus.(*ConsensusSet).threadedInitialBlockchainDownload.func1(0xc420147b80, 0xc42162bef0, 0xc42162beb0, 0xc42162beb8, 0x0, 0x0)
    /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/synchronize.go:580 +0x12c
github.com/NebulousLabs/Sia/modules/consensus.(*ConsensusSet).threadedInitialBlockchainDownload(0xc420147b80, 0x0, 0x0)
    /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/synchronize.go:601 +0x307
github.com/NebulousLabs/Sia/modules/consensus.New.func1(0x1, 0xc420254a00, 0xc420147b80, 0xde29a0, 0xc420080c60)
    /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/consensusset.go:151 +0x3fd
created by github.com/NebulousLabs/Sia/modules/consensus.New
    /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/consensusset.go:182 +0x63a
Pertti132 commented 7 years ago

For me deleting consensus and downloadin it again worked.. for now

ghost commented 7 years ago

Also got this after updating to 1.3.0:

Loading... (0/6) Loading siad... (1/6) Loading gateway... (2/6) Loading consensus... (3/6) Loading transaction pool... panic: runtime error: slice bounds out of range

goroutine 27 [running]: github.com/NebulousLabs/Sia/modules/consensus.(ConsensusSet).getBlockTotals(0xc042129b80, 0xc043563c00, 0x200000000000000, 0x3df605704c73c36e, 0x24c3fb5c88cdcf09, 0x51bd66aa6f54c3ac, 0xc0420406c0, 0x0, 0x0, 0x0, ...) /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/difficulty.go:120 +0x13b github.com/NebulousLabs/Sia/modules/consensus.(ConsensusSet).newChild(0xc042129b80, 0xc043563c00, 0xc04357ab00, 0x200000000000000, 0x3df605704c73c36e, 0x24c3fb5c88cdcf09, 0x51bd66aa6f54c3ac, 0x819e014804fd72b2, 0x5977c0b6, 0xc0420406c0, ...) /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/processedblock.go:135 +0x1a8 github.com/NebulousLabs/Sia/modules/consensus.(ConsensusSet).addBlockToTree(0xc042129b80, 0xc043563c00, 0x200000000000000, 0x3df605704c73c36e, 0x24c3fb5c88cdcf09, 0x51bd66aa6f54c3ac, 0x819e014804fd72b2, 0x5977c0b6, 0xc0420406c0, 0x1, ...) /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/accept.go:151 +0xa3 github.com/NebulousLabs/Sia/modules/consensus.(ConsensusSet).managedAcceptBlocks.func1(0xc043563c00, 0xb0b570, 0xc043563c00) /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/accept.go:262 +0x23a github.com/NebulousLabs/bolt.(DB).Update(0xc0420f6780, 0xc0436352e8, 0x0, 0x0) /home/luke/go/src/github.com/NebulousLabs/bolt/db.go:603 +0xa6 github.com/NebulousLabs/Sia/modules/consensus.(ConsensusSet).managedAcceptBlocks(0xc042129b80, 0xc042030800, 0xa, 0xa, 0x0, 0x0, 0x0) /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/accept.go:283 +0x520 github.com/NebulousLabs/Sia/modules/consensus.(ConsensusSet).managedReceiveBlocks(0xc042129b80, 0xde41c0, 0xc042ed8400, 0x0, 0x0) /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/synchronize.go:225 +0x5be github.com/NebulousLabs/Sia/modules/consensus.(ConsensusSet).(github.com/NebulousLabs/Sia/modules/consensus.managedReceiveBlocks)-fm(0xde41c0, 0xc042ed8400, 0x0, 0x0) /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/synchronize.go:445 +0x45 github.com/NebulousLabs/Sia/modules/gateway.(Gateway).managedRPC(0xc04206cc60, 0xc04218b360, 0x13, 0xaddb78, 0xa, 0xc042f18480, 0x0, 0x0) /home/luke/go/src/github.com/NebulousLabs/Sia/modules/gateway/rpc.go:66 +0x339 github.com/NebulousLabs/Sia/modules/gateway.(Gateway).RPC(0xc04206cc60, 0xc04218b360, 0x13, 0xaddb78, 0xa, 0xc042f18480, 0x0, 0x0) /home/luke/go/src/github.com/NebulousLabs/Sia/modules/gateway/rpc.go:76 +0xd8 github.com/NebulousLabs/Sia/modules/consensus.(ConsensusSet).threadedInitialBlockchainDownload.func1(0xc042129b80, 0xc043635ef0, 0xc043635eb0, 0xc043635eb8, 0x0, 0x0) /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/synchronize.go:580 +0x133 github.com/NebulousLabs/Sia/modules/consensus.(ConsensusSet).threadedInitialBlockchainDownload(0xc042129b80, 0x0, 0x0) /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/synchronize.go:601 +0x30e github.com/NebulousLabs/Sia/modules/consensus.New.func1(0x1, 0xc042234960, 0xc042129b80, 0xde4440, 0xc04206cc60) /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/consensusset.go:151 +0x404 created by github.com/NebulousLabs/Sia/modules/consensus.New /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/consensusset.go:182 +0x641

tlightsky commented 6 years ago

meet this when unlocking:

D:\s\sia-win>siad -M gctw
Sia Daemon v1.3.1
Loading...
(0/4) Loading siad...
(1/4) Loading gateway...
(2/4) Loading consensus...
(3/4) Loading transaction pool...
(4/4) Loading wallet...
Finished loading in 4.438807 seconds
Wallet: scanned to height 237324...
Done!
panic: runtime error: slice bounds out of range

goroutine 208 [running]:
github.com/NebulousLabs/Sia/modules/consensus.stdBlockRuleHelper.minimumValidChildTimestamp(0xe01120, 0xc0793436c0, 0xc0422aa9a0, 0xc0793436c0)
        /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/block_rules.go:44 +0x33a
github.com/NebulousLabs/Sia/modules/consensus.(*stdBlockRuleHelper).minimumValidChildTimestamp(0xf392f8, 0xe01120, 0xc0793436c0, 0xc0422aa9a0, 0xc0793436c0)
        <autogenerated>:1 +0x59
github.com/NebulousLabs/Sia/modules/consensus.(*ConsensusSet).computeConsensusChange(0xc042296000, 0xc06c196d20, 0x0, 0x0, 0x0, 0xc07a171840, 0x1, 0x1, 0x0, 0x0, ...)
        /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/subscribe.go:85 +0x176c
github.com/NebulousLabs/Sia/modules/consensus.(*ConsensusSet).managedInitializeSubscribe.func2(0xc06c196d20, 0xaf4c28, 0xc06c196d20)
        /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/subscribe.go:180 +0x1a1
github.com/NebulousLabs/bolt.(*DB).View(0xc042160780, 0xc07a4d1ab0, 0x0, 0x0)
        /home/luke/go/src/github.com/NebulousLabs/bolt/db.go:634 +0xa1
github.com/NebulousLabs/Sia/modules/consensus.(*ConsensusSet).managedInitializeSubscribe(0xc042296000, 0xe00e60, 0xc0720c98c0, 0xb06e2afddd4eba8e, 0x24a1f3a34f385f99, 0xd623744383c04998, 0x66b23118f88d3e21, 0xc0731b1140, 0x4727bd, 0xc075a45bd8)
        /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/subscribe.go:173 +0x26d
github.com/NebulousLabs/Sia/modules/consensus.(*ConsensusSet).ConsensusSetSubscribe(0xc042296000, 0xe00e60, 0xc0720c98c0, 0xb06e2afddd4eba8e, 0x24a1f3a34f385f99, 0xd623744383c04998, 0x66b23118f88d3e21, 0xc0731b1140, 0x0, 0x0)
        /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/subscribe.go:223 +0x108
github.com/NebulousLabs/Sia/modules/wallet.(*Wallet).managedUnlock(0xc0720c98c0, 0x896be1d91cd2090a, 0x68de32c3adb48124, 0xf9fdf99634545ea4, 0x6f00e7d0790e5257, 0x0, 0x0)
        /home/luke/go/src/github.com/NebulousLabs/Sia/modules/wallet/encrypt.go:205 +0x3dd
github.com/NebulousLabs/Sia/modules/wallet.(*Wallet).Unlock(0xc0720c98c0, 0x896be1d91cd2090a, 0x68de32c3adb48124, 0xf9fdf99634545ea4, 0x6f00e7d0790e5257, 0x0, 0x0)
        /home/luke/go/src/github.com/NebulousLabs/Sia/modules/wallet/encrypt.go:581 +0x173
github.com/NebulousLabs/Sia/api.(*API).walletUnlockHandler(0xc072aacbd0, 0xe07be0, 0xc074338d20, 0xc053b12500, 0x0, 0x0, 0x0)
        /home/luke/go/src/github.com/NebulousLabs/Sia/api/wallet.go:547 +0x13d
github.com/NebulousLabs/Sia/api.(*API).(github.com/NebulousLabs/Sia/api.walletUnlockHandler)-fm(0xe07be0, 0xc074338d20, 0xc053b12500, 0x0, 0x0, 0x0)
        /home/luke/go/src/github.com/NebulousLabs/Sia/api/api.go:297 +0x6d
github.com/julienschmidt/httprouter.(*Router).ServeHTTP(0xc072e637c0, 0xe07be0, 0xc074338d20, 0xc053b12500)
        /home/luke/go/src/github.com/julienschmidt/httprouter/router.go:344 +0x7a0
github.com/NebulousLabs/Sia/api.RequireUserAgent.func1(0xe07be0, 0xc074338d20, 0xc053b12500)
        /home/luke/go/src/github.com/NebulousLabs/Sia/api/api.go:99 +0xc1
net/http.HandlerFunc.ServeHTTP(0xc072dd6ed0, 0xe07be0, 0xc074338d20, 0xc053b12500)
        /usr/local/go/src/net/http/server.go:1918 +0x4b
github.com/NebulousLabs/Sia/api.cleanCloseHandler.func1.1(0xc07539a540, 0xe03160, 0xc072dd6ed0, 0xe07be0, 0xc074338d20, 0xc053b12500)
        /home/luke/go/src/github.com/NebulousLabs/Sia/api/api.go:132 +0x80
created by github.com/NebulousLabs/Sia/api.cleanCloseHandler.func1
        /home/luke/go/src/github.com/NebulousLabs/Sia/api/api.go:130 +0xbe
avahowell commented 6 years ago

Wallet: scanned to height 237324...

Hmm, that's clearly not right. @tlightsky can you describe some of the things that you did with this wallet before that happened?

lukechampine commented 6 years ago

sounds like a double-subscription

tlightsky commented 6 years ago

@avahowell i remember just doing unlocking, this is 1.3.1 rc1 on windows btw