panic: division by zero in settlement code #94

Closed
opened 2023-03-08 23:30:09 +00:00 by snegurochka · 1 comment
Member

Original issue: https://github.com/nspcc-dev/neofs-node/issues/2262

Expected Behavior

No panics.

Current Behavior

Feb 16 19:31:42 node2 neofs-ir[4736]: 2023/02/16 19:31:42 worker exits from a panic: division by zero
Feb 16 19:31:42 node2 neofs-ir[4736]: 2023/02/16 19:31:42 worker exits from panic: goroutine 148390 [running]:
Feb 16 19:31:42 node2 neofs-ir[4736]: github.com/panjf2000/ants/v2.(*goWorker).run.func1.1()
Feb 16 19:31:42 node2 neofs-ir[4736]:         github.com/panjf2000/ants/v2@v2.4.0/worker.go:58 +0x10c
Feb 16 19:31:42 node2 neofs-ir[4736]: panic({0xd0c800, 0xfb16a0})
Feb 16 19:31:42 node2 neofs-ir[4736]:         runtime/panic.go:1038 +0x215
Feb 16 19:31:42 node2 neofs-ir[4736]: math/big.nat.div({0x0, 0xfe3c28, 0xc00009d080}, {0x0, 0xc0017827e0, 0xc001405da0}, {0x0, 0xc0017827a0, 0xc00041db10}, {0x0, ...})
Feb 16 19:31:42 node2 neofs-ir[4736]:         math/big/natdiv.go:507 +0x348
Feb 16 19:31:42 node2 neofs-ir[4736]: math/big.(*Int).QuoRem(0xc00026da40, 0xc00026da40, 0xc00026da20, 0xc00041db58)
Feb 16 19:31:42 node2 neofs-ir[4736]:         math/big/int.go:239 +0x9c
Feb 16 19:31:42 node2 neofs-ir[4736]: math/big.(*Int).Div(0xc00026da40, 0xc00026da40, 0xc00026d9e0)
Feb 16 19:31:42 node2 neofs-ir[4736]:         math/big/int.go:250 +0x45
Feb 16 19:31:42 node2 neofs-ir[4736]: github.com/nspcc-dev/neofs-node/pkg/innerring/processors/settlement/basic.normalizedValue(0xc0016e0b90, 0xfd2900, 0xc001405e48)
Feb 16 19:31:42 node2 neofs-ir[4736]:         github.com/nspcc-dev/neofs-node/pkg/innerring/processors/settlement/basic/distribute.go:53 +0x7b
Feb 16 19:31:42 node2 neofs-ir[4736]: github.com/nspcc-dev/neofs-node/pkg/innerring/processors/settlement/basic.(*IncomeSettlementContext).Distribute.func1({0xc001754240, 0x21, 0x30}, 0x20)
Feb 16 19:31:42 node2 neofs-ir[4736]:         github.com/nspcc-dev/neofs-node/pkg/innerring/processors/settlement/basic/distribute.go:40 +0x2f1
Feb 16 19:31:42 node2 neofs-ir[4736]: github.com/nspcc-dev/neofs-node/pkg/innerring/processors/settlement/basic.(*NodeSizeTable).Iterate(0xc000291b40, 0xc00041ddf0)
Feb 16 19:31:42 node2 neofs-ir[4736]:         github.com/nspcc-dev/neofs-node/pkg/innerring/processors/settlement/basic/util.go:26 +0x8f
Feb 16 19:31:42 node2 neofs-ir[4736]: github.com/nspcc-dev/neofs-node/pkg/innerring/processors/settlement/basic.(*IncomeSettlementContext).Distribute(0xc0003ecdc0)
Feb 16 19:31:42 node2 neofs-ir[4736]:         github.com/nspcc-dev/neofs-node/pkg/innerring/processors/settlement/basic/distribute.go:27 +0x2ee
Feb 16 19:31:42 node2 neofs-ir[4736]: github.com/nspcc-dev/neofs-node/pkg/innerring/processors/settlement.(*Processor).HandleIncomeDistributionEvent.func1()
Feb 16 19:31:42 node2 neofs-ir[4736]:         github.com/nspcc-dev/neofs-node/pkg/innerring/processors/settlement/calls.go:117 +0x1d
Feb 16 19:31:42 node2 neofs-ir[4736]: github.com/panjf2000/ants/v2.(*goWorker).run.func1()
Feb 16 19:31:42 node2 neofs-ir[4736]:         github.com/panjf2000/ants/v2@v2.4.0/worker.go:68 +0x97
Feb 16 19:31:42 node2 neofs-ir[4736]: created by github.com/panjf2000/ants/v2.(*goWorker).run
Feb 16 19:31:42 node2 neofs-ir[4736]:         github.com/panjf2000/ants/v2@v2.4.0/worker.go:48 +0x68

Steps to Reproduce (for bugs)

Unknown.

Context

T5 testnet.

Your Environment

NeoFS Inner Ring node
Version: v0.34.0 
GoVersion: go1.17.13
Original issue: https://github.com/nspcc-dev/neofs-node/issues/2262 ## Expected Behavior No panics. ## Current Behavior ``` Feb 16 19:31:42 node2 neofs-ir[4736]: 2023/02/16 19:31:42 worker exits from a panic: division by zero Feb 16 19:31:42 node2 neofs-ir[4736]: 2023/02/16 19:31:42 worker exits from panic: goroutine 148390 [running]: Feb 16 19:31:42 node2 neofs-ir[4736]: github.com/panjf2000/ants/v2.(*goWorker).run.func1.1() Feb 16 19:31:42 node2 neofs-ir[4736]: github.com/panjf2000/ants/v2@v2.4.0/worker.go:58 +0x10c Feb 16 19:31:42 node2 neofs-ir[4736]: panic({0xd0c800, 0xfb16a0}) Feb 16 19:31:42 node2 neofs-ir[4736]: runtime/panic.go:1038 +0x215 Feb 16 19:31:42 node2 neofs-ir[4736]: math/big.nat.div({0x0, 0xfe3c28, 0xc00009d080}, {0x0, 0xc0017827e0, 0xc001405da0}, {0x0, 0xc0017827a0, 0xc00041db10}, {0x0, ...}) Feb 16 19:31:42 node2 neofs-ir[4736]: math/big/natdiv.go:507 +0x348 Feb 16 19:31:42 node2 neofs-ir[4736]: math/big.(*Int).QuoRem(0xc00026da40, 0xc00026da40, 0xc00026da20, 0xc00041db58) Feb 16 19:31:42 node2 neofs-ir[4736]: math/big/int.go:239 +0x9c Feb 16 19:31:42 node2 neofs-ir[4736]: math/big.(*Int).Div(0xc00026da40, 0xc00026da40, 0xc00026d9e0) Feb 16 19:31:42 node2 neofs-ir[4736]: math/big/int.go:250 +0x45 Feb 16 19:31:42 node2 neofs-ir[4736]: github.com/nspcc-dev/neofs-node/pkg/innerring/processors/settlement/basic.normalizedValue(0xc0016e0b90, 0xfd2900, 0xc001405e48) Feb 16 19:31:42 node2 neofs-ir[4736]: github.com/nspcc-dev/neofs-node/pkg/innerring/processors/settlement/basic/distribute.go:53 +0x7b Feb 16 19:31:42 node2 neofs-ir[4736]: github.com/nspcc-dev/neofs-node/pkg/innerring/processors/settlement/basic.(*IncomeSettlementContext).Distribute.func1({0xc001754240, 0x21, 0x30}, 0x20) Feb 16 19:31:42 node2 neofs-ir[4736]: github.com/nspcc-dev/neofs-node/pkg/innerring/processors/settlement/basic/distribute.go:40 +0x2f1 Feb 16 19:31:42 node2 neofs-ir[4736]: github.com/nspcc-dev/neofs-node/pkg/innerring/processors/settlement/basic.(*NodeSizeTable).Iterate(0xc000291b40, 0xc00041ddf0) Feb 16 19:31:42 node2 neofs-ir[4736]: github.com/nspcc-dev/neofs-node/pkg/innerring/processors/settlement/basic/util.go:26 +0x8f Feb 16 19:31:42 node2 neofs-ir[4736]: github.com/nspcc-dev/neofs-node/pkg/innerring/processors/settlement/basic.(*IncomeSettlementContext).Distribute(0xc0003ecdc0) Feb 16 19:31:42 node2 neofs-ir[4736]: github.com/nspcc-dev/neofs-node/pkg/innerring/processors/settlement/basic/distribute.go:27 +0x2ee Feb 16 19:31:42 node2 neofs-ir[4736]: github.com/nspcc-dev/neofs-node/pkg/innerring/processors/settlement.(*Processor).HandleIncomeDistributionEvent.func1() Feb 16 19:31:42 node2 neofs-ir[4736]: github.com/nspcc-dev/neofs-node/pkg/innerring/processors/settlement/calls.go:117 +0x1d Feb 16 19:31:42 node2 neofs-ir[4736]: github.com/panjf2000/ants/v2.(*goWorker).run.func1() Feb 16 19:31:42 node2 neofs-ir[4736]: github.com/panjf2000/ants/v2@v2.4.0/worker.go:68 +0x97 Feb 16 19:31:42 node2 neofs-ir[4736]: created by github.com/panjf2000/ants/v2.(*goWorker).run Feb 16 19:31:42 node2 neofs-ir[4736]: github.com/panjf2000/ants/v2@v2.4.0/worker.go:48 +0x68 ``` ## Steps to Reproduce (for bugs) Unknown. ## Context T5 testnet. ## Your Environment ``` NeoFS Inner Ring node Version: v0.34.0 GoVersion: go1.17.13 ```
Owner

Closed via #247.

Closed via #247.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#94
No description provided.