View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002878 | UA | Implementation Bug | public | 2014-11-05 12:49 | 2015-06-18 13:52 |
Reporter | Zbynek Zahradnik | Assigned To | |||
Priority | high | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | Windows | ||||
Summary | 0002878: .NET client stack - infinite hang in CreateSession | ||||
Description | Observed with .NET stack 1.02.334.6. Opc.Ua.Client.Session.Open, when called with m_endpoint.Description.SecurityPolicyUri == SecurityPolicies.None, and m_endpoint.EndpointUrl which represents an unknown host, hangs indefinitely. The actual issue can be wider - it may affect more methods, and almost certainly happens with other errors (not just unknown host) as well. | ||||
Steps To Reproduce | Call Opc.Ua.Client.Session.Open with the values indicated in Description. It will first try to call CreateSession with a NULL client certificate. Because of the unknown host, this throws a SocketException somewhere in the stack. This is caught in Opc.Ua.Client.Session.Open and traced as "Create session failed with client certificate NULL. ". The code then proceeds to a second CreateSession call, now with the actual client certificate. It hangs indefinitely in there. I can guess that the issue has to with either 1) the fact that a SocketException leaves the session or the channel are left in an incorrect state, or 2) in case of errors like this (as opposed to service-level errors), the second CreateSession should not be made at all, or 3) both. | ||||
Additional Information | Call stack of the thread that is forever blocked: mscorlib.dll!System.Threading.WaitHandle.InternalWaitOne(System.Runtime.InteropServices.SafeHandle waitableSafeHandle, long millisecondsTimeout, bool hasThreadAffinity, bool exitContext) Line 243 + 0x14 bytes C#
string serverUri, string endpointUrl, string sessionName, byte[] clientNonce, byte[] clientCertificate, double requestedSessionTimeout, uint maxResponseMessageSize, out Opc.Ua.NodeId sessionId, out Opc.Ua.NodeId authenticationToken, out double revisedSessionTimeout, out byte[] serverNonce, out byte[] serverCertificate, out Opc.Ua.EndpointDescriptionCollection serverEndpoints, out Opc.Ua.SignedSoftwareCertificateCollection serverSoftwareCertificates, out Opc.Ua.SignatureData serverSignature, out uint maxRequestMessageSize) Line 108 + 0x1d bytes C# System.Collections.Generic.IList<string> preferredLocales) Line 2039 + 0x154 bytes C# | ||||
Tags | No tags attached. | ||||
Fix Due Date | |||||
|
Fixed bug. When connecting to an unknown host an exception is thrown in the Socket.BeginConnect method called by TcpClientChannel.BeginConnect, resulting in an improper "connecting" state for the socket (no cleanup will be performed). Fix: The Socket.BeginConnect in TcpClientChannel.BeginConnect method has been surrounded by a try-catch block to shutdown the socket in case of an System.Net.Sockets.SocketException. |
Date Modified | Username | Field | Change |
---|---|---|---|
2014-11-05 12:49 | Zbynek Zahradnik | New Issue | |
2015-06-18 13:52 | Alin Moldovean | Note Added: 0006151 | |
2015-06-18 13:52 | Alin Moldovean | Status | new => resolved |
2015-06-18 13:52 | Alin Moldovean | Resolution | open => fixed |
2015-06-18 13:52 | Alin Moldovean | Assigned To | => Nathan Pocock |