Professional OPC
Development Tools

logos

UnsubscribeAllItems. SEHException

More
15 Oct 2019 12:02 #7829 by Andriy
Hello,

I have added additional logging and found that UnsubscribeAllItems() method is called but does not complete. It lasts more than 15 sec.
The cleanup order is:
  1. daClient.UnsubscribeAllItems
  2. daClient.ItemChanged -= OnItemChanged
  3. daClient.Dispose
Regards

Please Log in or Create an account to join the conversation.

More
12 Oct 2019 12:51 #7823 by support
Hello.

Can you please verify (by debugging or logging, not just by looking at the code) that your finalization actually is called and also completes (the UnsubscribeAllItems and Dispose methods return)? This exception seem to happen on call stack that is not yours, but has to do with the final app teardown. So, I'd like to deternmine whether somehow this app teardown happens before or in parallel with your code, or whether your code runs fine and *then* it crashes.

Thank you

Please Log in or Create an account to join the conversation.

More
11 Oct 2019 14:28 #7822 by Andriy
Hello,

It happens when I close my Windows Service application. This is an ordinary app shutdown.
When application is closing I cleanup opened OPC connections: call UnsubscribeAllItems, Dispose
OPC communication mode: subscription

Regards

Please Log in or Create an account to join the conversation.

More
11 Oct 2019 14:14 #7821 by support
Please describe the situation this is happening in.
What kind of project is this? (desktop, web app, etc.)
Is that an orderly application shutdown?
Have you called the UnsubscribeAllItems from your code yourself? (probably not, looking at the call stack).

Thank you

Please Log in or Create an account to join the conversation.

More
11 Oct 2019 13:36 #7820 by Andriy
Hello,

UnsubscribeAllItems method call cause SEHException
Library version: 5.54.1133.1

System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception.
at AfxThrowInvalidArgException()
at OpcLabs.EasyOpcRaw.DataAccess.RawEasyDAClient.InternalUnsubscribeAllItems()
at OpcLabs.EasyOpcRaw.DataAccess.CDAInnerItem.UnsubscribeAllFromParent(CDAInnerItem* )
at CEDAAbstractEngine.Abort(CEDAAbstractEngine* )
at CEasyAbstractModule.ModuleDestroy(CEasyAbstractModule* )
at OpcLabs.EasyOpcRaw.CInnerModule.ModuleTerminate(CInnerModule* )
at ProcessExitHandler(Object sender, EventArgs e)

System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception.
at AfxThrowInvalidArgException()
at OpcLabs.EasyOpcRaw.DataAccess.RawEasyDAClient.InternalUnsubscribeAllItems()
at OpcLabs.EasyOpcRaw.DataAccess.CDAInnerItem.UnsubscribeAllFromParent(CDAInnerItem* )
at CEDAAbstractEngine.Abort(CEDAAbstractEngine* )
at CEasyAbstractModule.ModuleDestroy(CEasyAbstractModule* )
at OpcLabs.EasyOpcRaw.CInnerModule.ModuleTerminate(CInnerModule* )
at OpcLabs.EasyOpcRaw.CInnerModule.{dtor}(CInnerModule* )
at _exit_callback()
at <CrtImplementationDetails>.LanguageSupport._UninitializeDefaultDomain(Void* cookie)
at <CrtImplementationDetails>.LanguageSupport.UninitializeDefaultDomain()
at <CrtImplementationDetails>.LanguageSupport.DomainUnload(Object A_0, EventArgs A_1)
at <CrtImplementationDetails>.ModuleUninitializer.SingletonDomainUnload(Object source, EventArgs arguments)

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.187 seconds

      

 Recommend this on Google