Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

"An invalid handle was specified" after app. 25 sec.

More
08 Jun 2018 05:31 #6402 by support
QuickOPC 2018.2 is now released, and it has an up-to-date version of the 3rd party library (which was causing the issue) in it. So hopefully it is resolved in 2018.2; and if it wasn't, we would be in position to report it to the vendor and ask them to look at it.

Best regards

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

More
07 Jun 2018 09:46 #6396 by Captain_Dash
Is this issue resolved in the new version? It was not mentioned in the release notes, or perhaps I missed.

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

More
19 Apr 2018 18:18 #6244 by support
QuickOPC 2018.2 should be released end of May/beginning of June.

The updated NuGet package is a new build of 2018.1, with minor bug fixes. It is true that we only publish changelogs between the "big" versions.

Regards

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

More
19 Apr 2018 14:43 - 19 Apr 2018 14:52 #6243 by Captain_Dash
Thanks for your explanation. Is there some kind of roadmap when QuickOPC 2018.2 will be released?
I saw a new Nuget Package was released today, where can we find the release Notes for the new package?

kb.opclabs.com/What%27s_New

There are only notes for the big releases.

Best Regards
Last edit: 19 Apr 2018 14:52 by Captain_Dash. Reason: added question

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

More
18 Apr 2018 16:39 #6237 by support
Hello,
I am glad it helped.

Most of the technical explanation is in the Knowledge base article. What it does not say is that in order to achieve what is described there, we use a 3rd party library, which sometimes has problems - as you have just found.

We will be updating this 3rd library to newest version, and this will be in the upcoming QuickOPC 2018.2. It may resolve the problem (I was able to see it as well, although under somewhat different circumstances, so I should be able to check whether it has been fixed or not). If upgrading to newest library does not resolve the problem, we will report the problem to the vendor - but that's the maximum we can realistically do.

The workaround with the configuration settings turns the boxing" altogether for the three different usage scenarios in QuickOPC, but if you are using only OPC UA, only one of them applies to you, and it is the UA Certificate Generator boxing. The UA Certificate Generator is a utility (an EXE) needed to generate client instance certificate for OPC UA. Using the boxing approach, we "pretend" that the utility is on the disk when we need it, so that the developers and/or users do not have to install it.

QuickOPC only really creates the certificate once for each application, and puts it into the store and then reuses it when available (and, it is only necessary for secure connections). You might be fine using the config change just for your debugging. The certificate is probably already created.

If the boxing is turned off and you still wanted to generate certificates, you will need to jave the UA Certificate Generator installed. It is part of many of the installs available for OPC UA on OPC Foundation web site.

Best regards
The following user(s) said Thank You: Captain_Dash

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

More
18 Apr 2018 14:16 #6236 by Captain_Dash
Hello,

it seemed to help with the crash. Our application is running longer than 25sec in Debug mode. Could you please give some more detailed information on this application configuration?

Best regards

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

More
16 Apr 2018 19:07 #6234 by support
Hello,

can you please modify your application configuration file as described here: kb.opclabs.com/How_to_disable_prerequisites_boxing ?

I think it should help. Let me know. If it does help, I will then give you more information to it.

Best regards

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

More
16 Apr 2018 10:15 #6233 by Captain_Dash
Hello,

There are some reasons for not enabling “native code debugging”.
1.)
Somewhere in OPC-UA code, an exception is thrown. It should be clarified, what is the reason for that.
2.)
“Native code debugging” slows down the debugging experience in two ways: the debugger itself runs slower and more (potentially unimportant) exceptions will show up, which slows down the developer.
3.)
This doesn’t seem to solve the problem in our main application, it just seems to work in your example code. Through enabling “native code debugging”, the program does not abort abnormally. But the exception itself would still occur. Using this option, we still have other strange behavior in our application. So it may be possible, that the strange exception leads to other problems when using the x64-debugger. But this is something, we still have to examine. I will try to find out, if the strange behavior still exists, if we don’t load the OPC-UA libraries. (So we find out, if this behavior depends on the exception in OPC-UA lib or not).

Best regards

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

More
14 Apr 2018 07:41 #6232 by support
Hello,
thank you for the detailed report. Before we go further, can you please clarify one thing:

You wrote

Activate "Enable native code debugging" in "Project->Properties->Debug" => no problem


If this is the case, why don't you debug with this setting on? Does it have some other negative effect?

Best regards

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

More
13 Apr 2018 14:14 #6231 by Captain_Dash
Hello,

we also do have some similiar problem, which seems to have the same root cause. But we were able to collect some more information and a way to reproduce the error behaviour with OPC-UA example-code.
This may become a long post. I will try to collect and present all information we were able to gather until now.

Our system environment is Win 7, VisualStudio 2015 Professional.

1.) What we see in our application
We also have a crash in our application after approx. 25 seconds with the following error message in an error window:
Exception thrown at 0x00007ffda760917a in XXX.exe: 0xC0000008: An invalid handle was specified.
I was able to find out, that this exception seems to occur in
Opc.Ua.CertificateValidator.Validate
Getting a helpful call stack is not possible. The call stack is just one line in depth and seems to be in ntdll

2.) What we found out until now
The crash seems to occur only when our program is started through the debugger and running in 64bit mode. As we added some libraries, that only support 64bit, our application starts automatically in 64bit mode. When we start the application without a debugger attached (e.g. through clicking on the exe in windows explorer), the application runs without any problems. We then could attach the debugger to the application without any problems.
So it seems, that the crash is associated to debugging a 64bit application.

3.) How to reproduce
You can reproduce a similiar behaviour on your site with the OPC-UA examples:
- Open solution "QuickOpcCSharpExamples"
- Set "ConsoleLiveMapping" as startup project (we simply chose the first project for tests)
- open project properties of "ConsoleLiveMapping", open "Build" tab and set "Platform target:" to "x64" for the current build configuration (Debug/AnyCPU)
- Debug the project (F5), wait until program ends (you may lower the waiting time to 1 sec), Press Enter after program finished. Now you should get an error window (see attached file "ErroWindow")

- Output window shows:
The program '[25700] ConsoleLiveMapping.vshost.exe: Managed (v4.0.30319)' has exited with code -1073741816 (0xc0000008) 'An invalid handle was specified'.
- So at least the error message in output window is similiar and the way, how the program ends is similiar

I also was able to reproduce this test in a new virtual machine with Win7 and VisualStudio 2015 Professional.

I used the following debugger settings (Tools->Options->Debugging):

We also tried to do some tests with other settings. Here are our results:
- Activate "Enable native code debugging" in "Project->Properties->Debug" => no problem
- Set "Platform target" to "Any CPU" in "Project->Properties->Build", Disable "native code debugging" => application shows the "crash"
- Set Build settings to "Any CPU" and enable "Prefer 32-bit" => no problem

4.) Conclusion
We are assuming, that the described behaviour may come from some "incompatibilities" due to debugging 64bit applications. But we are not able to track down the problem, since we do not have (and also don't want to have ;)) access to the sources of the OPC-UA libraries.
I don't think, that there is some interaction with firewalls or antivirus software, since I was able to reproduce the problem on a "clean, new" virtual machine installation (although Windows firewall and other Windows protection software was not disabled)

Could you please try to reproduce the problem? And, if you succeded, could you please try to track down the root cause of the problem, since currently we are not able to debug our software in an appropriate way.

Thank you in advance.
Attachments:

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

Moderators: support
Time to create page: 0.066 seconds