This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients eryksun, giampaolo.rodola, izbyshev, paul.moore, steve.dower, tim.golden, vstinner, zach.ware
Date 2021-03-04.03:03:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1614827034.76.0.904362011707.issue36067@roundup.psfhosted.org>
In-reply-to
Content
> I don't understand why any patch for CPython is needed at all.

If and operation on self._handle fails as an invalid handle (due to an underlying STATUS_INVALID_HANDLE or STATUS_OBJECT_TYPE_MISMATCH), then call self._handle.Detach() and re-raise the exception.

It wouldn't hurt to also address the case in which coincidentally the handle value currently references another process. When the process is spawned, save the (process_id, creation_time) via GetProcessId() and GetProcessTimes(). Implement a function that validates these values before calling WaitForSingleObject(), GetExitCodeProcess(), or TerminateProcess(). If validation fails, call self._handle.Detach() and raise OSError.
History
Date User Action Args
2021-03-04 03:03:54eryksunsetrecipients: + eryksun, paul.moore, vstinner, giampaolo.rodola, tim.golden, zach.ware, steve.dower, izbyshev
2021-03-04 03:03:54eryksunsetmessageid: <1614827034.76.0.904362011707.issue36067@roundup.psfhosted.org>
2021-03-04 03:03:54eryksunlinkissue36067 messages
2021-03-04 03:03:53eryksuncreate