Details
-
Type:
Bug
-
Status: Closed
-
Priority:
P1: Critical
-
Resolution: Done
-
Affects Version/s: 5.6.1, 5.7.0 Beta
-
Component/s: Network: Sockets
-
Labels:None
-
Environment:WinRT MSVC2015
-
Platform/s:
-
Commits:eba979f6956f8d74bf5a3cb6ed0d585396b790f1 and a1dccd0708ae805b014489b5b16cc055d3001c50 in 5.6.1
Description
Hard crash when closing QUdpSocket or QTcpServer.
Regression caused by Change-Id: Idc75178f7d05057b610ac7000e95486d6a52cb85
qnativesocketengine_winrt.cpp -> void QNativeSocketEngine::close()
hr = d->tcpSocket()->QueryInterface(IID_PPV_ARGS(&socket3));
Will fail and then cause a null pointer deference few lines below with QUdpSocket.
hr = socket3->CancelIOAsync(&action);
Or with QTcpServer (tcpListener) it will trigger ASSERT since CancelIOAsync is not a supported action for StreamSocketListener.
hr = QWinRTFunctions::await(action);
See patch for possible fix by excluding this code path to QTcpSocket only.