Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • Q quickfix
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 48
    • Issues 48
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 25
    • Merge requests 25
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • quickfixgo
  • quickfix
  • Issues
  • #91
Closed
Open
Issue created Apr 18, 2016 by Administrator@rootContributor

Potential Fix50 Market Data marshaling bug

Created by: daino3

// _test.go
package main

import (
    "os"
    "testing"

    "github.com/davecgh/go-spew/spew"
    . "github.com/onsi/ginkgo"
    . "github.com/onsi/gomega"
    "github.com/quickfixgo/quickfix"
    "github.com/quickfixgo/quickfix/enum"
    "github.com/quickfixgo/quickfix/fix50/marketdatarequest"
)

func TestSubscriptionManager(t *testing.T) {
    RegisterFailHandler(Fail)
    RunSpecs(t, "Books Suite")
}

var _ = Describe("Subscription Manager", func() {
    var mdMsg marketdatarequest.Message

    BeforeEach(func() {
        one := 1
        truthy := true

        mdMsg = marketdatarequest.Message{
            FIXMsgType:              "V",
            MDReqID:                 "1-A",
            SubscriptionRequestType: "1",
            MarketDepth:             0,
            MDUpdateType:            &one,
            AggregatedBook:          &truthy,
        }
    })

    FDescribe("SubscriptionsBySessionID", func() {
        It("returns a map of session IDs to subscriptions", func() {
                // This panics in Fix50, but is fine with FIX42
                    msg := quickfix.Marshal(mdMsg)
        })
    })
})

Backtrace:

•! Panic [0.064 seconds]
Subscription Manager
/home/vagrant/go/src/github.com/connamara/longford-services/longford-fix-market-data-gateway/main_test.go:90
  SubscriptionsBySessionID
  /home/vagrant/go/src/github.com/connamara/longford-services/longford-fix-market-data-gateway/main_test.go:89
    returns a map of session IDs to subscriptions [It]
    /home/vagrant/go/src/github.com/connamara/longford-services/longford-fix-market-data-gateway/main_test.go:88

    Test Panicked
    strconv.ParseInt: parsing "": invalid syntax
    /usr/local/go/src/runtime/panic.go:426

    Full Stack Trace

        /usr/local/go/src/runtime/panic.go:426 +0x4e9
    github.com/connamara/longford-services/vendor/github.com/quickfixgo/quickfix.encoder.encodeValue.func1(0x7fd70bb6e0a8, 0x8e4e80)
        /home/vagrant/go/src/github.com/connamara/longford-services/vendor/github.com/quickfixgo/quickfix/marshal.go:82 +0x1f2
    github.com/connamara/longford-services/vendor/github.com/quickfixgo/quickfix.encoder.encodeValue.func1(0x7fd70bb6e0a8, 0x8ab5a0)
        /home/vagrant/go/src/github.com/connamara/longford-services/vendor/github.com/quickfixgo/quickfix/marshal.go:76 +0xde
    github.com/connamara/longford-services/vendor/github.com/quickfixgo/quickfix.encoder.encodeValue(0xc820339650, 0x9ca650, 0x92, 0x784260, 0xc8200f0790, 0x97, 0x4deb00, 0x0)
        /home/vagrant/go/src/github.com/connamara/longford-services/vendor/github.com/quickfixgo/quickfix/marshal.go:89 +0x6a1
    github.com/connamara/longford-services/vendor/github.com/quickfixgo/quickfix.encoder.encodeField(0xc820339650, 0x9ca650, 0x8f7750, 0xc, 0x0, 0x0, 0x7fd70bb6e0a8, 0x784260, 0x8fd
6a0, 0x9, ...)
        /home/vagrant/go/src/github.com/connamara/longford-services/vendor/github.com/quickfixgo/quickfix/marshal.go:17 +0x127
    github.com/connamara/longford-services/vendor/github.com/quickfixgo/quickfix.encoder.encodeField(0xc820339650, 0x9ca650, 0x8f6c30, 0xf, 0x0, 0x0, 0x7fd70bb6e0a8, 0x84a480, 0x0,
0x0, ...)
        /home/vagrant/go/src/github.com/connamara/longford-services/vendor/github.com/quickfixgo/quickfix/marshal.go:28 +0x45f
    github.com/connamara/longford-services/vendor/github.com/quickfixgo/quickfix.Marshal(0x8c5600, 0xc8200f0600, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /home/vagrant/go/src/github.com/connamara/longford-services/vendor/github.com/quickfixgo/quickfix/marshal.go:139 +0x53a
    github.com/connamara/longford-services/longford-fix-market-data-gateway.glob.func1.3.1()
        /home/vagrant/go/src/github.com/connamara/longford-services/longford-fix-market-data-gateway/main_test.go:84 +0x198
    github.com/connamara/longford-services/vendor/github.com/onsi/ginkgo/internal/leafnodes.(*runner).runSync(0xc82001a9c0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /home/vagrant/go/src/github.com/connamara/longford-services/longford-fix-market-data-gateway/main_test.go:17 +0x7c
    testing.tRunner(0xc82008c3f0, 0xb5f890)
        /usr/local/go/src/testing/testing.go:473 +0x98
    created by testing.RunTests
        /usr/local/go/src/testing/testing.go:582 +0x892

Assignee
Assign to
Time tracking