Thread: [Quickfix-developers] NewOrderList addgroup threw "Attempted to read or write protected memory. Thi
Brought to you by:
orenmnero
From: Gehani, N. <nee...@ci...> - 2009-01-22 20:25:02
|
Here is the log of exception this threw. This is the first time this problem has surfaced. App has been used for almost half year. Any Ideas. 2009-01-22 13:30:06,515 [35] FATAL TradeManager - Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at FIX.FieldMap.addGroup(FieldMap* , Int32 , FieldMap* , Boolean ) at QuickFix.Message.addGroup(Group group) at FixUtil.createNewOrderList(FixRequestDetails frd) at Communicator.SendNewOrderList(FixRequestDetails frd) at TradeManager.Execute(Queue`1 queue) at TradeManager.Manage(Object state) Code statements int listSeqNo = 0; QuickFix44.NewOrderList newOrderList = new QuickFix44.NewOrderList(); Hashtable listsCache = null; QuickFix.ListID listID = null; listsCache = PortfolioManager.Instance.getListsCache(frd.PortfolioID); listID = new ListID("ABC"); newOrderList.setField(listID); QuickFix.BidType bidType = new QuickFix.BidType(QuickFix.BidType.DISCLOSED_STYLE); newOrderList.setField(bidType); QuickFix44.NewOrderList.NoOrders sequenceGroup = null; foreach (Order order in orders.Values) { sequenceGroup = new QuickFix44.NewOrderList.NoOrders(); SoupLogger.getLogger().InfoFormat("Processing Frd={0} Order {1}", frd.getTag66(),order.ToString()); sequenceGroup.setField(new QuickFix.Account(order.ActMnc)); sequenceGroup.setField(new QuickFix.ClOrdID(order.OrderId)); sequenceGroup.setField(new QuickFix.ListSeqNo(++listSeqNo)); sequenceGroup.setField(new QuickFix.Symbol(order.Ticker)); if (order.TickerSuff != null && order.TickerSuff.Length != 0 ) sequenceGroup.setField(new QuickFix.SymbolSfx(order.TickerSuff)); if (order.Side == OMConstants.BUY) { sequenceGroup.setField(new QuickFix.Side(QuickFix.Side.BUY)); } else if (order.Side == OMConstants.SELL) { sequenceGroup.setField(new QuickFix.Side(QuickFix.Side.SELL)); } else if (order.Side == OMConstants.SELLSHORT) { sequenceGroup.setField(new QuickFix.Side(QuickFix.Side.SELL_SHORT)); } else if (order.Side == OMConstants.SELLSHORTEXEMPT) { sequenceGroup.setField(new QuickFix.Side(QuickFix.Side.SELL_SHORT_EXEMPT)); } string[] locateIdArr = order.LocateIds.Split(':'); sequenceGroup.setField(FixConstants.LOCATEBROKERNAME, locateIdArr[0]); sequenceGroup.setField(FixConstants.LOCATEBROKERID, locateIdArr[1]); sequenceGroup.setField(new QuickFix.OrderQty(order.Quantity)); sequenceGroup.setField(FixConstants.SUBLISTID, order.ListId); sequenceGroup.setField(FixConstants.TRADERSOEID, order.ClientName); sequenceGroup.setField(new IntField(FixConstants.SRCSYSTEMID,srcSystemId)); sequenceGroup.setField(new IntField(FixConstants.AGGUNIT, 999); sequenceGroup.setField(new QuickFix.SenderCompID(senderCompId)); sequenceGroup.setField(new QuickFix.TargetCompID(targetCompId)); sequenceGroup.setField(new QuickFix.OrderID(order.OrderId)); sequenceGroup.setField(new QuickFix.TimeInForce(TimeInForce.DAY)); sequenceGroup.setField(new QuickFix.OrderCapacity(OrderCapacity.AGENCY)); sequenceGroup.setField(new QuickFix.UtcTimeStampField( FixConstants.ORDERFLOWENTRYTIME, DateTime.UtcNow)); newOrderList.addGroup(sequenceGroup); } |
From: Djalma R. d. S. F. <drs...@gm...> - 2009-01-24 00:56:52
|
This error occurs because the .NET runtime sometimes moves the objects in memory to compact the GC Heap, this cheats the unmanaged code and leads to an access violation. The solution is pinning the objects involved. void addGroup( Group* group ) { QF_STACK_TRY if ( !group ) { throw new System::ArgumentNullException(); } Group __pin *pThis = this; Group __pin *pGroup = group; pThis->unmanaged().addGroup( pGroup->unmanaged() ); QF_STACK_CATCH } On Thu, Jan 22, 2009 at 5:44 PM, Gehani, Neeraj <nee...@ci...>wrote: > QuickFIX Documentation: > http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > Here is the log of exception this threw. > > This is the first time this problem has surfaced. App has been used for > almost half year. Any Ideas. > > 2009-01-22 13:30:06,515 [35] FATAL TradeManager - Attempted to read or > write protected memory. This is often an indication that other memory is > corrupt. at FIX.FieldMap.addGroup(FieldMap* , Int32 , FieldMap* , > Boolean ) > at QuickFix.Message.addGroup(Group group) > at FixUtil.createNewOrderList(FixRequestDetails frd) > at Communicator.SendNewOrderList(FixRequestDetails frd) > at TradeManager.Execute(Queue`1 queue) > at TradeManager.Manage(Object state) > > Code statements > > int listSeqNo = 0; > > QuickFix44.NewOrderList newOrderList = new > QuickFix44.NewOrderList(); > Hashtable listsCache = null; > > QuickFix.ListID listID = null; > > listsCache = > PortfolioManager.Instance.getListsCache(frd.PortfolioID); > > listID = new ListID("ABC"); > newOrderList.setField(listID); > > QuickFix.BidType bidType = new > QuickFix.BidType(QuickFix.BidType.DISCLOSED_STYLE); > newOrderList.setField(bidType); > > QuickFix44.NewOrderList.NoOrders sequenceGroup = null; > > foreach (Order order in orders.Values) > { > > sequenceGroup = new > QuickFix44.NewOrderList.NoOrders(); > SoupLogger.getLogger().InfoFormat("Processing > Frd={0} Order {1}", frd.getTag66(),order.ToString()); > sequenceGroup.setField(new > QuickFix.Account(order.ActMnc)); > sequenceGroup.setField(new > QuickFix.ClOrdID(order.OrderId)); > sequenceGroup.setField(new > QuickFix.ListSeqNo(++listSeqNo)); > sequenceGroup.setField(new > QuickFix.Symbol(order.Ticker)); > if (order.TickerSuff != null && > order.TickerSuff.Length != 0 ) sequenceGroup.setField(new > QuickFix.SymbolSfx(order.TickerSuff)); > > if (order.Side == OMConstants.BUY) > { > sequenceGroup.setField(new > QuickFix.Side(QuickFix.Side.BUY)); > } > else if (order.Side == OMConstants.SELL) > { > sequenceGroup.setField(new > QuickFix.Side(QuickFix.Side.SELL)); > } > else if (order.Side == OMConstants.SELLSHORT) > { > sequenceGroup.setField(new > QuickFix.Side(QuickFix.Side.SELL_SHORT)); > } > else if (order.Side == OMConstants.SELLSHORTEXEMPT) > { > sequenceGroup.setField(new > QuickFix.Side(QuickFix.Side.SELL_SHORT_EXEMPT)); > } > > string[] locateIdArr = order.LocateIds.Split(':'); > > sequenceGroup.setField(FixConstants.LOCATEBROKERNAME, locateIdArr[0]); > > sequenceGroup.setField(FixConstants.LOCATEBROKERID, locateIdArr[1]); > > > sequenceGroup.setField(new > QuickFix.OrderQty(order.Quantity)); > sequenceGroup.setField(FixConstants.SUBLISTID, > order.ListId); > sequenceGroup.setField(FixConstants.TRADERSOEID, > order.ClientName); > sequenceGroup.setField(new > IntField(FixConstants.SRCSYSTEMID,srcSystemId)); > sequenceGroup.setField(new > IntField(FixConstants.AGGUNIT, 999); > > sequenceGroup.setField(new > QuickFix.SenderCompID(senderCompId)); > sequenceGroup.setField(new > QuickFix.TargetCompID(targetCompId)); > sequenceGroup.setField(new > QuickFix.OrderID(order.OrderId)); > sequenceGroup.setField(new > QuickFix.TimeInForce(TimeInForce.DAY)); > sequenceGroup.setField(new > QuickFix.OrderCapacity(OrderCapacity.AGENCY)); > sequenceGroup.setField(new > QuickFix.UtcTimeStampField( FixConstants.ORDERFLOWENTRYTIME, > DateTime.UtcNow)); > > > > newOrderList.addGroup(sequenceGroup); > } > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > SourcForge Community > SourceForge wants to tell your story. > http://p.sf.net/sfu/sf-spreadtheword > _______________________________________________ > Quickfix-developers mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-developers > |
From: NeerajG <nee...@ci...> - 2009-07-08 15:00:14
|
Per the suggestion in the past I pinned just the addGroup and took away the problem until we stumbled on it yesterday. Still shows error in addGroup which I have already pinned in my dll. Any other ideas. Failed in SendNewOrderList Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at FIX.FieldMap.addGroup(FieldMap* , Int32 , FieldMap* , Boolean ) at QuickFix.Message.addGroup(Group group) at Citi.DerivsAnalytics.Soup.Server.FixUtil.createNewOrderList(FixRequestDetails frd) at Citi.DerivsAnalytics.Soup.Server.RFQCommunicator.SendNewOrderList(FixRequestDetails frd)' QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html QuickFIX Support: http://www.quickfixengine.org/services.html Here is the log of exception this threw. This is the first time this problem has surfaced. App has been used for almost half year. Any Ideas. 2009-01-22 13:30:06,515 [35] FATAL TradeManager - Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at FIX.FieldMap.addGroup(FieldMap* , Int32 , FieldMap* , Boolean ) at QuickFix.Message.addGroup(Group group) at FixUtil.createNewOrderList(FixRequestDetails frd) at Communicator.SendNewOrderList(FixRequestDetails frd) at TradeManager.Execute(Queue`1 queue) at TradeManager.Manage(Object state) -- View this message in context: http://www.nabble.com/NewOrderList-addgroup-threw-%22Attempted-to-read-or-write-protected-memory.-This-is-often-an-indication-that-other-memory-is-corrupt%22-tp21612600p24393018.html Sent from the QuickFIX - Dev mailing list archive at Nabble.com. |
From: Djalma R. d. S. F. <drs...@gm...> - 2009-07-12 22:49:47
|
Hi Neeraj, This worked for me (and for you during almost 6 months), my suggestion now is that you take a look if maybe you are disposing related objects to cause the access violation. If you don't see anything wrong in your code, better make use of dr. watson / windbg to capture and analyse a full dump. Regards, Djalma On Wed, Jul 8, 2009 at 12:00 PM, NeerajG<nee...@ci...> wrote: > QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > > Per the suggestion in the past I pinned just the addGroup and took away the > problem until we stumbled on it yesterday. Still shows error in addGroup > which I have already pinned in my dll. Any other ideas. > > Failed in SendNewOrderList Attempted to read or write protected memory. This > is often an indication that other memory is corrupt. at > FIX.FieldMap.addGroup(FieldMap* , Int32 , FieldMap* , Boolean ) > at QuickFix.Message.addGroup(Group group) > at > Citi.DerivsAnalytics.Soup.Server.FixUtil.createNewOrderList(FixRequestDetails > frd) > at > Citi.DerivsAnalytics.Soup.Server.RFQCommunicator.SendNewOrderList(FixRequestDetails > frd)' > > > QuickFIX Documentation: > http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > Here is the log of exception this threw. > > This is the first time this problem has surfaced. App has been used for > almost half year. Any Ideas. > > 2009-01-22 13:30:06,515 [35] FATAL TradeManager - Attempted to read or > write protected memory. This is often an indication that other memory is > corrupt. at FIX.FieldMap.addGroup(FieldMap* , Int32 , FieldMap* , > Boolean ) > at QuickFix.Message.addGroup(Group group) > at FixUtil.createNewOrderList(FixRequestDetails frd) > at Communicator.SendNewOrderList(FixRequestDetails frd) > at TradeManager.Execute(Queue`1 queue) > at TradeManager.Manage(Object state) > > > -- > View this message in context: http://www.nabble.com/NewOrderList-addgroup-threw-%22Attempted-to-read-or-write-protected-memory.-This-is-often-an-indication-that-other-memory-is-corrupt%22-tp21612600p24393018.html > Sent from the QuickFIX - Dev mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to $100,000 in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full prize > details at: http://p.sf.net/sfu/Challenge > _______________________________________________ > Quickfix-developers mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-developers > |