Author vstinner
Recipients gvanrossum, larry, loewis, pitrou, sbt, vstinner, zach.ware
Date 2014-02-11.23:54:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1392162876.79.0.114881732292.issue20414@psf.upfronthosting.co.za>
In-reply-to
Content
> Victor, you really shouldn't submit code that you don't understand.

In fact I do understand overlapped_dealloc.patch, it's "quite simple". On Windows XP, if you have exit Python with pending overlapped operations, you must not release the read or write buffer of the operation, or the process may crash because Windows tries to read from or write into freed memory. The trick is to not release the read/write buffer (but close the Windows handle of the overlapped operation) if the operation is pending and python is exiting.

On more recent version, you can safetly cancel a pending operations, so the issue is specific to Windows XP (and older, but we don't support Windows 2000 anymore, right?).

Martin: I didn't understand your suggestion on Rietveld:
"Why is this the default case? I think it should be the ERROR_IO_INCOMPLETE case, because only this error handled. Any other error should IMO be raised as is, and the resources still be released."

I wrote a patch just to ask you if it is the change you suggested, and you still didn't answer to this question ("is overlapped_dealloc-2.patch what you wanted?")

I'm not sure that it is safe to release the memory if the state is different than ERROR_IO_INCOMPLETE. Well, it is safer to never release memory at exit, but it may leeak memory. So maybe Martin's suggestion can be delayed after Python 3.4 (to give more time to buildbots to test it), but Richard's fix (overlapped_dealloc.patch) can be applied (on _overlapped) to Python 3.4?

--

Sorry for mixing two different issues in the same issue, in fact  overlapped_dealloc.patch is just the follow up of #19565 for the _overlapped module. I didn't expect so long discussions for such patch :-(
History
Date User Action Args
2014-02-11 23:54:36vstinnersetrecipients: + vstinner, gvanrossum, loewis, pitrou, larry, sbt, zach.ware
2014-02-11 23:54:36vstinnersetmessageid: <1392162876.79.0.114881732292.issue20414@psf.upfronthosting.co.za>
2014-02-11 23:54:36vstinnerlinkissue20414 messages
2014-02-11 23:54:36vstinnercreate