Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

panicked: attempt to calculate the remainder with a divisor of zero #11119

Closed
soc1c opened this issue Oct 2, 2019 · 2 comments
Closed

panicked: attempt to calculate the remainder with a divisor of zero #11119

soc1c opened this issue Oct 2, 2019 · 2 comments
Labels
Z9-invalid 👮‍♀️ Issue is invalid. Closer should comment why.

Comments

@soc1c
Copy link
Contributor

soc1c commented Oct 2, 2019

  • Parity Ethereum version: v2.5.9-stable-06c7096054-20190926
  • Operating system: Arch Linux
  • Installation: repositories pacman -S parity-ethereum
  • Fully synchronized: no
  • Network: https://github.com/eth-classic/mordor
  • Restarted: no

expected behaviour: synchronize blocks one by one.

actual behaviour: multiple panics on block import.

~/mordor master one@acrux                                                                                                                                                                       
❯ parity --chain parity.json                                                                                                                                                                    
2019-10-02 21:56:52  Starting Parity-Ethereum/v2.5.9-stable-06c7096054-20190926/x86_64-linux-gnu/rustc1.37.0                                                                                    
2019-10-02 21:56:52  Keys path /home/one/.local/share/io.parity.ethereum/keys/mordor                                                                                                            
2019-10-02 21:56:52  DB path /home/one/.local/share/io.parity.ethereum/chains/mordor/db/72f707e6f596a43b                                                                                        
2019-10-02 21:56:52  State DB configuration: fast                                                                                                                                                                                
2019-10-02 21:56:52  Operating mode: active                                                                                                                                                                                      
2019-10-02 21:56:52  Configured for Mordor Classic Testnet using Ethash engine                                                                                                                                                   
2019-10-02 21:56:52  Listening for new connections on 127.0.0.1:8546.                                                                                                                                                            
2019-10-02 21:56:57  Public node URL: enode://a59e33ccd2b3e52d578f1fbd70c6f9babda2650f0760d6ff3b37742fdcdfdb3defba5d56d315b40c46b70198c7621e63ffa3f987389c7118634b0fefbbdfa7fd@10.18.62.7:30303                                  
2019-10-02 21:57:27     1/25 peers   832 bytes chain 128 bytes db 0 bytes queue 1008 bytes sync  RPC:  0 conn,    0 req/s,    0 µs                                                                                               
2019-10-02 21:57:57     2/25 peers   832 bytes chain 128 bytes db 0 bytes queue 2 KiB sync  RPC:  0 conn,    0 req/s,    0 µs                                                                                                    
2019-10-02 21:58:27     2/25 peers   832 bytes chain 128 bytes db 0 bytes queue 2 KiB sync  RPC:  0 conn,    0 req/s,    0 µs                                                                                                    
2019-10-02 21:58:57     2/25 peers   832 bytes chain 128 bytes db 0 bytes queue 2 KiB sync  RPC:  0 conn,    0 req/s,    0 µs                                                                                                    
2019-10-02 21:59:27     2/25 peers   832 bytes chain 128 bytes db 0 bytes queue 2 KiB sync  RPC:  0 conn,    0 req/s,    0 µs                                                                                                    
2019-10-02 21:59:57     2/25 peers   832 bytes chain 128 bytes db 0 bytes queue 2 KiB sync  RPC:  0 conn,    0 req/s,    0 µs                                                                                                    
2019-10-02 22:00:27     2/25 peers   832 bytes chain 128 bytes db 0 bytes queue 2 KiB sync  RPC:  0 conn,    0 req/s,    0 µs                                                                                                    
2019-10-02 22:00:42  Syncing       #0 0xd8f9…87b0     0.00 blk/s    0.0 tx/s    0.0 Mgas/s     12+    0 Qed       #16    2/25 peers   832 bytes chain 128 bytes db 19 KiB queue 29 KiB sync  RPC:  0 conn,    0 req/s,    0 µs
                                                        
                                                        
====================                                    
                                                        
stack backtrace:                                        
   0:     0x560756c0c9fd - <unknown>                    
   1:     0x560756c09cbb - <unknown>                    
   2:     0x560756ec26f7 - <unknown>                    
   3:     0x560756c4f32a - <unknown>                    
   4:     0x560756c4f09e - <unknown>                    
   5:     0x560756c6a075 - <unknown>                    
   6:     0x560756c75e4b - <unknown>                    
   7:     0x560756c7764a - <unknown>                    
   8:     0x560756772568 - <unknown>                    
   9:     0x560756727f8a - <unknown>                    
  10:     0x560756739bc8 - <unknown>                    
  11:     0x560755fb4591 - <unknown>                    
  12:     0x5607564f6f35 - <unknown>                    
  13:     0x5607564e1253 - <unknown>                    
  14:     0x560756542500 - <unknown>                    
  15:     0x5607565f20a4 - <unknown>                    
  16:     0x560756c68f7e - <unknown>                    
  17:     0x560756c6b84b - <unknown>                    
  18:     0x7f8206c9157e - start_thread                 
  19:     0x7f8206ba50e2 - __clone                      
  20:                0x0 - <unknown>                    

Thread 'Verifier #0' panicked at 'attempt to calculate the remainder with a divisor of zero', ethcore/src/ethereum/ethash.rs:471                                                                                                 

This is a bug. Please report it at:                     

    https://github.com/paritytech/parity-ethereum/issues/new                                                    
2019-10-02 22:00:43  Finishing work, please wait...                                                             
2019-10-02 22:00:43  Block import failed for #3 (0xf298…a090): Parent not found (0x6439…8254)                                                                                                                                    
2019-10-02 22:00:43                                     
Bad block detected: Error(Msg("Parent not found"), State { next_error: None, backtrace: InternalBacktrace { backtrace: None } })                                                                                                 
RLP: f90215f90210a0643956d4a2a57d1bc80a53028db3ebb366ef51bc5c95ca2fa49ca8080b8f8254a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d4934794fcae7970392f510a985a7eaccd3820b7759d65d9a0d397a7d9ceffa31b2cb7dd3e8661dd54
5f8d83b2e9a565bd3ff0bf865eb3abe5a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b901000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000008302004003833013cf80845d9501ca99d883010903846765746888676f312e31322e38856c696e7578a0fee39b2358313dbb0a3fb01ba57a5680118832f7ba1a5415c85996bf62eb2b53884b22151a62464752c0c0
Header: Header { parent_hash: 0x643956d4a2a57d1bc80a53028db3ebb366ef51bc5c95ca2fa49ca8080b8f8254, timestamp: 1570046410, number: 3, author: 0xfcae7970392f510a985a7eaccd3820b7759d65d9, transactions_root: 0x56e81f171bcc55a6ff83
45e692c0f86e5b48e01b996cadc001622fb5e363b421, uncles_hash: 0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347, extra_data: [216, 131, 1, 9, 3, 132, 103, 101, 116, 104, 136, 103, 111, 49, 46, 49, 50, 46, 56, 13
3, 108, 105, 110, 117, 120], state_root: 0xd397a7d9ceffa31b2cb7dd3e8661dd545f8d83b2e9a565bd3ff0bf865eb3abe5, receipts_root: 0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421, log_bloom: 0x00000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000, gas_used: 0, gas_limit: 3150799, difficulty: 131136, seal: [[160, 254, 227, 155, 35, 88, 49, 61, 187, 10, 63, 176, 27, 165, 122, 86, 128, 17, 136, 50, 247, 186, 26, 84, 21, 200, 89,
 150, 191, 98, 235, 43, 83], [136, 75, 34, 21, 26, 98, 70, 71, 82]], hash: Some(0xf298d7261b57ef41cb0243d0e47a574920e5a32bbb78f017939097d42087a090) }                                                                            
Uncles:                                                 
Transactions:                                           
                                                                                                                                                                                                                                 
2019-10-02 22:00:43  unable to get mut ref for engine for shutdown.                                             
                                                        
                                                        
====================                                    
                                                        
stack backtrace:                                        
   0:     0x560756c0c9fd - <unknown>                    
   1:     0x560756c09cbb - <unknown>                    
   2:     0x560756ec26f7 - <unknown>                    
   3:     0x560756c4f32a - <unknown>                    
   4:     0x560756c4f09e - <unknown>                    
   5:     0x560756c6a075 - <unknown>                    
   6:     0x560756c75e4b - <unknown>                    
   7:     0x560756ef2e50 - <unknown>                    
   8:     0x560755cd39d8 - <unknown>                    
   9:     0x560756f50e42 - <unknown>                    
  10:     0x560756f5089e - <unknown>                    
  11:     0x560755ead21a - <unknown>                    
  12:     0x560755ead21a - <unknown>                    
  13:     0x560755eb5c74 - <unknown>                    
  14:     0x560755d9c61a - <unknown>                    
  15:     0x560755ead21a - <unknown>                    
  16:     0x56075702a0dd - <unknown>                    
  17:     0x560755ead21a - <unknown>                    
  18:     0x5607567e2eac - <unknown>                    
  19:     0x56075702a343 - <unknown>                    
  20:     0x560756cb7c85 - <unknown>                    
  21:     0x560756ebf9c4 - <unknown>                    
  22:     0x560756afd3df - <unknown>                    
  23:     0x560756afaf82 - <unknown>                    
  24:     0x560756af97ed - <unknown>                    
  25:     0x560756ae483e - <unknown>                    
  26:     0x560756afeadb - <unknown>                    
  27:     0x560756afbf5f - <unknown>                    
  28:     0x560756c68f7e - <unknown>                    
  29:     0x560756c6b84b - <unknown>                    
  30:     0x7f8206c9157e - start_thread                 
  31:     0x7f8206ba50e2 - __clone                      
  32:                0x0 - <unknown>                    

Thread 'jsonrpc-eventloop-1' panicked at 'Propagating verifier thread panic on shutdown: Any', src/libcore/result.rs:999                                                                                                         

This is a bug. Please report it at:                     

    https://github.com/paritytech/parity-ethereum/issues/new                                                    

Steps to reproduce:

  1. start up a bootnode with the provided genesis
  2. mine a couple of blocks on geth classic or multi-geth
  3. wire the nodes together (admin.addPeer)
  4. see parity stable panicking
@soc1c soc1c added P2-asap 🌊 No need to stop dead in your tracks, however issue should be addressed as soon as possible. M4-core ⛓ Core client code / Rust. F1-panic 🔨 The client panics and exits without proper error handling. labels Oct 2, 2019
@niklasad1
Copy link
Collaborator

niklasad1 commented Oct 3, 2019

@soc1c is ecip1017EraRounds
"really" supposed to be zero? Seems to be a bug in the chain spec

https://github.com/paritytech/parity-ethereum/blob/master/ethcore/engines/ethash/src/lib.rs#L467 it will panic by block_number % era_rounds because it is zero.

era_rounds == self.ethash_params.ecip1017_era_rounds

EDIT:

The geth chain spec seems to use 2000000?

We should maybe change the deserialization to fail if it is zero or return an error in fn ecip1017_eras_block_reward if era_rounds == 0

@soc1c soc1c added Z9-invalid 👮‍♀️ Issue is invalid. Closer should comment why. and removed F1-panic 🔨 The client panics and exits without proper error handling. M4-core ⛓ Core client code / Rust. P2-asap 🌊 No need to stop dead in your tracks, however issue should be addressed as soon as possible. labels Oct 3, 2019
@soc1c
Copy link
Contributor Author

soc1c commented Oct 3, 2019

Thank you, Niklas. That's my fault!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Z9-invalid 👮‍♀️ Issue is invalid. Closer should comment why.
Projects
None yet
Development

No branches or pull requests

2 participants