Title: test_asyncio fails with application verifier!
Type: Stage:
Components: asyncio, Tests Versions: Python 3.8
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Alexander Riccio, asvetlov, samjonas, yselivanov
Priority: normal Keywords:

Created on 2019-05-04 00:10 by Alexander Riccio, last changed 2019-05-15 00:11 by Alexander Riccio.

File name Uploaded Description Edit
python_test_invalid_handle_failure.TXT Alexander Riccio, 2019-05-04 00:10 Windbg output for the failure
python_invalid_handle.PNG Alexander Riccio, 2019-05-04 00:13 screencap of tracebacj
Messages (5)
msg341365 - (view) Author: Alexander Riccio (Alexander Riccio) * Date: 2019-05-04 00:10
I compiled PCBuild Debug x64 from an updated clone of upstream, and when running the testsuite under Application Verifier with handle verification, the test triggers an invalid handle access by passing an invalid overlapped handle to CancelIoEx with this code: Py_CancelIoEx(self->handle, &self->overlapped) (where self->handle appears to be the offending variable).

I have no idea who's calling _overlapped.cancel, and a quick spelunking through the codebase only confuses me more.
msg341366 - (view) Author: Alexander Riccio (Alexander Riccio) * Date: 2019-05-04 00:13
Hmm, proceeding a bit further pointed to finish_recv in
msg342459 - (view) Author: sam jonas (samjonas) Date: 2019-05-14 13:07
Thanks for the solution...
msg342460 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2019-05-14 13:11
What is "Application Verifier"?
Could you provide an instruction on how to install and run it to reproduce the issue?
msg342526 - (view) Author: Alexander Riccio (Alexander Riccio) * Date: 2019-05-15 00:11
It's part of the Windows SDK, and is installed with it. To enable for this error, add the Python executable in Application Verifier, and check the Handles box.
Date User Action Args
2019-05-15 00:11:50Alexander Ricciosetmessages: + msg342526
2019-05-14 13:11:13asvetlovsetmessages: + msg342460
2019-05-14 13:07:12samjonassetnosy: + samjonas
messages: + msg342459
2019-05-06 11:28:16asvetlovsetcomponents: + asyncio
2019-05-04 00:19:06xtreaksetnosy: + asvetlov, yselivanov
2019-05-04 00:13:49Alexander Ricciosetfiles: + python_invalid_handle.PNG

messages: + msg341366
2019-05-04 00:10:11Alexander Ricciocreate