.NET API AccessViolationException

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
2 posts • Page 1 of 1
DKuchev@croc.ru
Posts:10
Joined: Tue Feb 12, 2019 7:19 pm

.NET API AccessViolationException

Post by DKuchev@croc.ru »

Hello, I get exception when reading query results
var _queryRes = _manager.ProcessValues.QueryDpValue(<query for offline values>)
_queryRes.GetData(i, 1); // Here I usualy get System.AccessViolationException when trying to call this method in parallel tasks at the same time

I get around this exception using locks, but, now i get same exception but in WCCOA .net wrapper.
I guess, wrapper call GetData method at the same time that I do
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
at ETM.WCCOA.Internal.CSharpBridgePINVOKE.Manager_GetId(System.String, System.Runtime.InteropServices.HandleRef)
at ETM.WCCOA.Internal.Manager.GetId(System.String, ETM.WCCOA.Internal.DpIdentifier)
at ETM.WCCOA.OaProcessModel.DoGetInternalDpIdentifierByDpPathUnsafe(System.String, ETM.WCCOA.DpConfigAutoCompleteMode)
at ETM.WCCOA.ActiveObjects.DpSetAction.GetDpItems()
at ETM.WCCOA.ActiveObjects.DpSetAction.ExecuteAction()
at ETM.WCCOA.OaManager.CommunicationThreadWorker()
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()

DKuchev@croc.ru
Posts:10
Joined: Tue Feb 12, 2019 7:19 pm

Re: .NET API AccessViolationException

Post by DKuchev@croc.ru »

In adittion:

Code below does nothing, just creating an object.

private void _subs_ValuesChanged(object sender, OaSubscriptionMultiValueChangedEventArgs args)
{
var _arr = (IList<OaDpValueItem>)args.Values;
TagResult res = new TagResult
{
Name = _arr[0].DpName,
Value = toNetValue(_arr[0].DpValue),
Timestamp = _arr[1].DpValue
};

}
Sometimes it crushes when I broke network connection, and restore it.
My subscribtion containts only remote system DP's (WinCC OA 3.15\3.14).
Local system runs on WinCC OA 3.16 P15
Also I checked this code on local DP's subscriptions, and it works fine.

Exceptions :
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
at ETM.WCCOA.Internal.CSharpBridgePINVOKE.Manager_GetName__SWIG_0(System.Runtime.InteropServices.HandleRef, System.String ByRef)
at ETM.WCCOA.Internal.Manager.GetName(ETM.WCCOA.Internal.DpIdentifier, System.String ByRef)
at ETM.WCCOA.OaProcessModel.DoGetDpPathByInternalDpIdentifierUnsafe(ETM.WCCOA.Internal.DpIdentifier)
at ETM.WCCOA.OaDpValueItem..ctor(ETM.WCCOA.OaManager, ETM.WCCOA.Internal.DpVCItem)
at ETM.WCCOA.ActiveObjects.DpHotlinkMessage.ProcessHotlinkReply(ETM.WCCOA.Internal.DpHLGroup)
at ETM.WCCOA.InternalHotlinkWaitForAnswer.HotLinkCallBack(ETM.WCCOA.Internal.DpHLGroup)
at ETM.WCCOA.Internal.HotLinkWaitForAnswer.SwigDirectorHotLinkCallBack__SWIG_2(IntPtr)
at ETM.WCCOA.Internal.CSharpBridgePINVOKE.Manager_DoReceiveSwigExplicitManager__SWIG_0(System.Runtime.InteropServices.HandleRef, System.Runtime.InteropServices.HandleRef)
at ETM.WCCOA.Internal.Manager.DoReceive(ETM.WCCOA.Internal.DpMsg)
at ETM.WCCOA.Internal.ManagerWrapper.DoReceive(ETM.WCCOA.Internal.DpMsg)
at ETM.WCCOA.Internal.Manager.SwigDirectorDoReceive__SWIG_0(IntPtr)
at ETM.WCCOA.Internal.CSharpBridgePINVOKE.Manager_Dispatch__SWIG_2(Double)
at ETM.WCCOA.Internal.Manager.Dispatch(Double)
at ETM.WCCOA.OaManager.CommunicationThreadWorker()
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()

Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
at ETM.WCCOA.Internal.CSharpBridgePINVOKE.ErrClass___toString__(System.Runtime.InteropServices.HandleRef)
at ETM.WCCOA.Internal.ErrClass.__toString__()
at ETM.WCCOA.OaErrorException.get_Message()
at CROC.Industrial.WCCOAOnlineComm.SyncWithAnotherWCC.SynchronizationWCCOA._subs_ValuesChanged(System.Object, ETM.WCCOA.OaSubscriptionMultiValueChangedEventArgs)
at ETM.WCCOA.OaDpValueSubscriptionBase.<StartListSubscription>b__41_0(System.Object, ETM.WCCOA.ActiveObjects.DpHotlinkEventArgs)
at ETM.WCCOA.ActiveObjects.DpConnectAction.<CreateHotlink>b__26_0(System.Object, ETM.WCCOA.ActiveObjects.DpHotlinkEventArgs)
at ETM.WCCOA.ActiveObjects.DpHotlinkMessage.ExecuteReply()
at ETM.WCCOA.OaManager.PerformReplyQueue(ETM.WCCOA.ActiveObjectQueue)
at ETM.WCCOA.OaManager.HotlinkThreadWorker()
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()


Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
at ETM.WCCOA.Internal.CSharpBridgePINVOKE.ErrClass___toString__(System.Runtime.InteropServices.HandleRef)
at ETM.WCCOA.Internal.ErrClass.__toString__()
at ETM.WCCOA.OaErrorException.get_Message()
at CROC.Industrial.WCCOAOnlineComm.SyncWithAnotherWCC.SynchronizationWCCOA._subs_ValuesChanged(System.Object, ETM.WCCOA.OaSubscriptionMultiValueChangedEventArgs)
at ETM.WCCOA.OaDpValueSubscriptionBase.<StartListSubscription>b__41_0(System.Object, ETM.WCCOA.ActiveObjects.DpHotlinkEventArgs)
at ETM.WCCOA.ActiveObjects.DpConnectAction.<CreateHotlink>b__26_0(System.Object, ETM.WCCOA.ActiveObjects.DpHotlinkEventArgs)
at ETM.WCCOA.ActiveObjects.DpHotlinkMessage.ExecuteReply()
at ETM.WCCOA.OaManager.PerformReplyQueue(ETM.WCCOA.ActiveObjectQueue)
at ETM.WCCOA.OaManager.HotlinkThreadWorker()
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()


Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
at ETM.WCCOA.Internal.CSharpBridgePINVOKE.Manager_GetName__SWIG_0(System.Runtime.InteropServices.HandleRef, System.String ByRef)
at ETM.WCCOA.Internal.Manager.GetName(ETM.WCCOA.Internal.DpIdentifier, System.String ByRef)
at ETM.WCCOA.OaProcessModel.DoGetDpPathByInternalDpIdentifierUnsafe(ETM.WCCOA.Internal.DpIdentifier)
at ETM.WCCOA.OaDpValueItem..ctor(ETM.WCCOA.OaManager, ETM.WCCOA.Internal.DpVCItem)
at ETM.WCCOA.ActiveObjects.DpHotlinkMessage.ProcessHotlinkReply(ETM.WCCOA.Internal.DpHLGroup)
at ETM.WCCOA.InternalHotlinkWaitForAnswer.HotLinkCallBack(ETM.WCCOA.Internal.DpHLGroup)
at ETM.WCCOA.Internal.HotLinkWaitForAnswer.SwigDirectorHotLinkCallBack__SWIG_2(IntPtr)
at ETM.WCCOA.Internal.CSharpBridgePINVOKE.Manager_DoReceiveSwigExplicitManager__SWIG_0(System.Runtime.InteropServices.HandleRef, System.Runtime.InteropServices.HandleRef)
at ETM.WCCOA.Internal.Manager.DoReceive(ETM.WCCOA.Internal.DpMsg)
at ETM.WCCOA.Internal.ManagerWrapper.DoReceive(ETM.WCCOA.Internal.DpMsg)
at ETM.WCCOA.Internal.Manager.SwigDirectorDoReceive__SWIG_0(IntPtr)
at ETM.WCCOA.Internal.CSharpBridgePINVOKE.Manager_Dispatch__SWIG_2(Double)
at ETM.WCCOA.Internal.Manager.Dispatch(Double)
at ETM.WCCOA.OaManager.CommunicationThreadWorker()
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()


Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
at ETM.WCCOA.Internal.CSharpBridgePINVOKE.ErrClass___toString__(System.Runtime.InteropServices.HandleRef)
at ETM.WCCOA.Internal.ErrClass.__toString__()
at ETM.WCCOA.OaErrorException.get_Message()
at CROC.Industrial.WCCOAOnlineComm.SyncWithAnotherWCC.SynchronizationWCCOA._subs_ValuesChanged(System.Object, ETM.WCCOA.OaSubscriptionMultiValueChangedEventArgs)
at ETM.WCCOA.OaDpValueSubscriptionBase.<StartListSubscription>b__41_0(System.Object, ETM.WCCOA.ActiveObjects.DpHotlinkEventArgs)
at ETM.WCCOA.ActiveObjects.DpConnectAction.<CreateHotlink>b__26_0(System.Object, ETM.WCCOA.ActiveObjects.DpHotlinkEventArgs)
at ETM.WCCOA.ActiveObjects.DpHotlinkMessage.ExecuteReply()
at ETM.WCCOA.OaManager.PerformReplyQueue(ETM.WCCOA.ActiveObjectQueue)
at ETM.WCCOA.OaManager.HotlinkThreadWorker()
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()


Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
at ETM.WCCOA.Internal.CSharpBridgePINVOKE.Manager_GetName__SWIG_0(System.Runtime.InteropServices.HandleRef, System.String ByRef)
at ETM.WCCOA.Internal.Manager.GetName(ETM.WCCOA.Internal.DpIdentifier, System.String ByRef)
at ETM.WCCOA.OaProcessModel.DoGetDpPathByInternalDpIdentifierUnsafe(ETM.WCCOA.Internal.DpIdentifier)
at ETM.WCCOA.OaDpValueItem..ctor(ETM.WCCOA.OaManager, ETM.WCCOA.Internal.DpVCItem)
at ETM.WCCOA.ActiveObjects.DpHotlinkMessage.ProcessHotlinkReply(ETM.WCCOA.Internal.DpHLGroup)
at ETM.WCCOA.InternalHotlinkWaitForAnswer.HotLinkCallBack(ETM.WCCOA.Internal.DpHLGroup)
at ETM.WCCOA.Internal.HotLinkWaitForAnswer.SwigDirectorHotLinkCallBack__SWIG_2(IntPtr)
at ETM.WCCOA.Internal.CSharpBridgePINVOKE.Manager_DoReceiveSwigExplicitManager__SWIG_0(System.Runtime.InteropServices.HandleRef, System.Runtime.InteropServices.HandleRef)
at ETM.WCCOA.Internal.Manager.DoReceive(ETM.WCCOA.Internal.DpMsg)
at ETM.WCCOA.Internal.ManagerWrapper.DoReceive(ETM.WCCOA.Internal.DpMsg)
at ETM.WCCOA.Internal.Manager.SwigDirectorDoReceive__SWIG_0(IntPtr)
at ETM.WCCOA.Internal.CSharpBridgePINVOKE.Manager_Dispatch__SWIG_2(Double)
at ETM.WCCOA.Internal.Manager.Dispatch(Double)
at ETM.WCCOA.OaManager.CommunicationThreadWorker()
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()

2 posts • Page 1 of 1