Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QuickFIX app crashes panic: runtime error: index out of range quickfix.ParseMessageWithDataDictionary #371

Open
hunghoang opened this issue Mar 22, 2019 · 0 comments

Comments

@hunghoang
Copy link

I have a QuickFIX App that acts as a Proxy: Convert from Fix44 to Fix42 before sending message to server and convert response from Fix42 to Fix44 before sending response to client.

When I try to send 100 msg from client, My app throws:

panic: runtime error: index out of range

goroutine 44 [running]:
vendor/github.com/quickfixgo/quickfix.ParseMessageWithDataDictionary(0xc0004dc0d0, 0xc00038efc0, 0x0, 0x0, 0xd, 0x10)
/order-proxy/src/vendor/github.com/quickfixgo/quickfix/message.go:199 +0x20f2
vendor/github.com/quickfixgo/quickfix.inSession.resendMessages(0xc00013a400, 0x6b, 0x77, 0xc000100c60, 0xc000018880, 0x7, 0x8, 0x1439d60, 0xc000100cc0, 0xc000016998, ...)
/entrade/order-proxy/src/vendor/github.com/quickfixgo/quickfix/in_session.go:220 +0x456
vendor/github.com/quickfixgo/quickfix.inSession.handleResendRequest(0xc00013a400, 0xc000194410, 0x1, 0xc0002be012)/order-proxy/src/vendor/github.com/quickfixgo/quickfix/in_session.go:186 +0x52c
vendor/github.com/quickfixgo/quickfix.inSession.FixMsgIn(0xc00013a400, 0xc000194410, 0x3, 0xc0002be058)
/order-proxy/src/vendor/github.com/quickfixgo/quickfix/in_session.go:33 +0x61a
vendor/github.com/quickfixgo/quickfix.(*stateMachine).fixMsgIn(0xc00013a500, 0xc00013a400, 0xc000194410)
/order-proxy/src/vendor/github.com/quickfixgo/quickfix/session_state.go:87 +0x69
vendor/github.com/quickfixgo/quickfix.(*stateMachine).Incoming(0xc00013a500, 0xc00013a400, 0xc000101110, 0xbf1d397766949e10, 0x8196a0d1e8, 0x16b6da0)
/order-proxy/src/vendor/github.com/quickfixgo/quickfix/session_state.go:77 +0x4d5

And with race detector, I have this warning. Does not know it's related to the problem:

WARNING: DATA RACE
Read at 0x00c0002be0d1 by goroutine 10:
vendor/github.com/quickfixgo/quickfix.TagValue.total()
/order-proxy/src/vendor/github.com/quickfixgo/quickfix/tag_value.go:56 +0x5a
vendor/github.com/quickfixgo/quickfix.FieldMap.total()
/order-proxy/src/vendor/github.com/quickfixgo/quickfix/field_map.go:273 +0x21a
vendor/github.com/quickfixgo/quickfix.(*Message).cook()
/order-proxy/src/vendor/github.com/quickfixgo/quickfix/message.go:379 +0x2d2
vendor/github.com/quickfixgo/quickfix.(*Message).build()
/order-proxy/src/vendor/github.com/quickfixgo/quickfix/message.go:367 +0x50
vendor/github.com/quickfixgo/quickfix.(*Message).String()
/order-proxy/src/vendor/github.com/quickfixgo/quickfix/message.go:358 +0x14a
main.(*ClientConnector).Send()
/order-proxy/src/app/client_connector.go:85 +0x105
main.MessageForwarder.forwardBrokerToClient.func1()
/order-proxy/src/app/message_forwarder.go:42 +0x13b

Previous write at 0x00c0002be0d0 by goroutine 72:
runtime.slicecopy()
/usr/local/go/src/runtime/slice.go:197 +0x0
bytes.(*Buffer).Write()
/usr/local/go/src/bytes/buffer.go:177 +0x116
vendor/github.com/quickfixgo/quickfix.(*parser).ReadMessage()
/order-proxy/src/vendor/github.com/quickfixgo/quickfix/parser.go:150 +0x279
vendor/github.com/quickfixgo/quickfix.readLoop()
/order-proxy/src/vendor/github.com/quickfixgo/quickfix/connection.go:22 +0xcf

Goroutine 10 (running) created at:
main.MessageForwarder.forwardBrokerToClient()
/order-proxy/src/app/message_forwarder.go:36 +0x6a
main.MessageForwarder.Forward()
/order-proxy/src/app/message_forwarder.go:18 +0x86
main.main()
/order-proxy/src/app/main.go:28 +0x1e9
Goroutine 72 (running) created at:
vendor/github.com/quickfixgo/quickfix.(*Initiator).handleConnection()
/order-proxy/src/vendor/github.com/quickfixgo/quickfix/initiator.go:181 +0xa56
vendor/github.com/quickfixgo/quickfix.(*Initiator).Start.func1()
/order-proxy/src/vendor/github.com/quickfixgo/quickfix/initiator.go:46

@hunghoang hunghoang changed the title QuickFIX app crashes QuickFIX app crashes panic: runtime error: index out of range quickfix.ParseMessageWithDataDictionary Mar 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant