vegaprotocol / vega

A Go implementation of the Vega Protocol, a protocol for creating and trading derivatives on a fully decentralised network.
https://vega.xyz
GNU Affero General Public License v3.0
37 stars 22 forks source link

Fix nil pointer in Order Amend #601

Closed ashleyvega closed 4 years ago

ashleyvega commented 4 years ago

In GitLab by @cdm on Dec 18, 2019, 12:02

When amending an order, if not found the error logging will try and reference a nil order and panic with:

panic: runtime error: invalid memory address or nil pointer dereference
    /builds/vega-protocol/trading-core/go/src/execution/market.go:992 +0x168
code.vegaprotocol.io/vega/execution.(*Engine).AmendOrder(0xc000162120, 0xc0bbae3ce0, 0x31, 0xc01dcf5c80, 0x1)
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xf53e18]
goroutine 97 [running]:
code.vegaprotocol.io/vega/execution.(*Market).AmendOrder(0xc000162900, 0xc0bbae3ce0, 0x0, 0x0, 0x0)
    /builds/vega-protocol/trading-core/go/src/execution/engine.go:357 +0x9e4
code.vegaprotocol.io/vega/blockchain.(*abciService).AmendOrder(0xc000162b40, 0xc0bbae3ce0, 0x55, 0x5b)
code.vegaprotocol.io/vega/blockchain.(*Processor).Process(0xc0001c2630, 0xc01cb0bb80, 0x7a, 0x80, 0x0, 0x0)
code.vegaprotocol.io/vega/blockchain/tm.(*AbciApplication).DeliverTx(0xc01ac0ed00, 0xc01cb0bb80, 0x7a, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    /builds/vega-protocol/trading-core/go/pkg/mod/github.com/tendermint/tendermint@v0.31.5/abci/server/socket_server.go:181 +0x1312
github.com/tendermint/tendermint/abci/server.(*SocketServer).handleRequests(0xc000191540, 0xc01ac3ecc0, 0x16f3620, 0xc00000c7e8, 0xc01ac3ed20)
    /builds/vega-protocol/trading-core/go/src/blockchain/service.go:226 +0x27c
    /builds/vega-protocol/trading-core/go/src/blockchain/processor.go:168 +0x746
    /builds/vega-protocol/trading-core/go/src/blockchain/tm/abci.go:210 +0xc6
github.com/tendermint/tendermint/abci/server.(*SocketServer).handleRequest(0xc000191540, 0xc0352095f0, 0xc01ac3ed20)
    /builds/vega-protocol/trading-core/go/pkg/mod/github.com/tendermint/tendermint@v0.31.5/abci/server/socket_server.go:163 +0xe5
created by github.com/tendermint/tendermint/abci/server.(*SocketServer).acceptConnectionsRoutine
    /builds/vega-protocol/trading-core/go/pkg/mod/github.com/tendermint/tendermint@v0.31.5/abci/server/socket_server.go:119 +0x269
ashleyvega commented 4 years ago

In GitLab by @cdm on Dec 18, 2019, 12:04

mentioned in merge request !501

ashleyvega commented 4 years ago

In GitLab by @cdm on Dec 18, 2019, 12:04

created merge request !501 to address this issue

ashleyvega commented 4 years ago

In GitLab by @cdm on Dec 18, 2019, 12:33

closed via merge request !501

ashleyvega commented 4 years ago

In GitLab by @cdm on Dec 18, 2019, 12:33

mentioned in commit 8a419834e405b18e6b5746a33579be6a7b21e97d