jim380 / Re

FIX protocol on blockchain
https://cyphercore.io/re
Apache License 2.0
3 stars 1 forks source link

Segmentation Violation in TradingSessionListRequest #114

Closed Ikpia closed 11 months ago

Ikpia commented 1 year ago

Issue Summary: When running the test suite for the TestTradingSessionListRequest in the KeeperTestSuite, I encountered a segmentation violation error. This issue appears to be a runtime error causing an invalid memory address or nil pointer dereference and this error is coming from line 75 in the msg_server_trading_session_list.go file in the fix folder.

Error Message: Running tool: /usr/local/go/bin/go test -timeout 30s -testify.m ^(TestTradingSessionListRequest)$ github.com/jim380/Re/x/fix/keeper

--- FAIL: TestKeeperTestSuite (0.38s) --- FAIL: TestKeeperTestSuite/TestTradingSessionListRequest (0.37s) --- FAIL: TestKeeperTestSuite/TestTradingSessionListRequest/Valid_Trading_Session_List_Request (0.02s) panic: runtime error: invalid memory address or nil pointer dereference [recovered] panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x10f6225]

goroutine 62 [running]: testing.tRunner.func1.2({0x1c525c0, 0x36aba00}) /usr/local/go/src/testing/testing.go:1526 +0x24e testing.tRunner.func1() /usr/local/go/src/testing/testing.go:1529 +0x39f panic({0x1c525c0, 0x36aba00}) /usr/local/go/src/runtime/panic.go:884 +0x213 github.com/jim380/Re/x/fix/keeper.msgServer.TradingSessionListRequest({{{0x27a88c0, 0xc000d50cf0}, {0x277b650, 0xc000dd6ec0}, {0x277b650, 0x0}, {{0x27a3500, 0xc000d50cf0}, 0xc0005147c0, {0x277b650, ...}, ...}, ...}}, ...)

/home/emmanuel/Re/x/fix/keeper/msg_server_trading_session_list.go:75 +0x5c5

github.com/jim380/Re/x/fix/keeper_test.(KeeperTestSuite).TestTradingSessionListRequest.func1() /home/emmanuel/Re/x/fix/keeper/msg_server_trading_session_list_test.go:563 +0x382 github.com/stretchr/testify/suite.(Suite).Run.func2(0xc000b09770?) /home/emmanuel/go/pkg/mod/github.com/stretchr/testify@v1.8.4/suite/suite.go:112 +0x36 testing.tRunner(0xc000d7a000, 0xc000d60f18) /usr/local/go/src/testing/testing.go:1576 +0x10b created by testing.(*T).Run /usr/local/go/src/testing/testing.go:1629 +0x3ea exit status 2 FAIL github.com/jim380/Re/x/fix/keeper 1.835s

Expected Behavior: The test suite for TestTradingSessionListRequest should pass without any runtime errors.

Actual Behavior: The test suite fails with a segmentation violation error, indicating an issue with memory access or pointer handling.