cpython/Modules
Victor Stinner d0a28dee78 Issue #23095, asyncio: Rewrite _WaitHandleFuture.cancel()
This change fixes a race conditon related to _WaitHandleFuture.cancel() leading
to Python crash or "GetQueuedCompletionStatus() returned an unexpected event"
logs. Before, the overlapped object was destroyed too early, it was possible
that the wait completed whereas the overlapped object was already destroyed.
Sometimes, a different overlapped was allocated at the same address, leading to
unexpected completition.

_WaitHandleFuture.cancel() now waits until the wait is cancelled to clear its
reference to the overlapped object. To wait until the cancellation is done,
UnregisterWaitEx() is used with an event instead of UnregisterWait().

To wait for this event, a new _WaitCancelFuture class was added. It's a
simplified version of _WaitCancelFuture. For example, its cancel() method calls
UnregisterWait(), not UnregisterWaitEx(). _WaitCancelFuture should not be
cancelled.

The overlapped object is kept alive in _WaitHandleFuture until the wait is
unregistered.

Other changes:

* Add _overlapped.UnregisterWaitEx()
* Remove fast-path in IocpProactor.wait_for_handle() to immediatly set the
  result if the wait already completed. I'm not sure that it's safe to
  call immediatly UnregisterWaitEx() before the completion was signaled.
* Add IocpProactor._unregistered() to forget an overlapped which may never be
  signaled, but may be signaled for the next loop iteration. It avoids to
  block forever IocpProactor.close() if a wait was cancelled, and it may also
  avoid some "... unexpected event ..." warnings.
2015-01-21 23:39:51 +01:00
..
_ctypes fix instances of consecutive articles (closes #23221) 2015-01-13 09:17:24 -05:00
_decimal Introduce and check for MPD_VERSION_HEX for precise management of builds 2014-08-26 21:31:47 +02:00
_io allow more operations to work on detached streams (closes #23093) 2014-12-21 20:51:50 -06:00
_multiprocessing Issue #21704: Fix build error for _multiprocessing when semaphores 2014-07-28 23:01:02 +01:00
_sqlite Issue #21147: sqlite3 now raises an exception if the request contains a null 2014-09-11 13:29:05 +03:00
cjkcodecs Issue #23181: More "codepoint" -> "code point". 2015-01-18 11:28:37 +02:00
clinic Issue #23280: Fix docstrings for binascii.(un)hexlify 2015-01-20 13:59:46 -06:00
expat merge 3.3 (#19186) 2014-02-04 10:12:18 -05:00
zlib
_bisectmodule.c
_bz2module.c Issue #20326: Argument Clinic now uses a simple, unique signature to 2014-01-28 05:00:08 -08:00
_codecsmodule.c Issue 19548: update codecs module documentation 2015-01-07 00:22:00 +10:00
_collectionsmodule.c merge 3.3 (#20250) 2014-01-13 23:56:30 -05:00
_cryptmodule.c Issue #20530: Argument Clinic's signature format has been revised again. 2014-02-08 22:15:29 -08:00
_csv.c Issue #18829: csv.Dialect() now checks type for delimiter, escapechar and 2013-12-19 16:28:04 +02:00
_curses_panel.c
_cursesmodule.c Issue #21088: Bugfix for curses.window.addch() regression in 3.4.0. 2014-05-04 04:41:18 -07:00
_datetimemodule.c Issue #22044: Fixed premature DECREF in call_tzinfo_method. 2014-07-25 14:59:48 -07:00
_dbmmodule.c Issue #20530: Argument Clinic's signature format has been revised again. 2014-02-08 22:15:29 -08:00
_elementtree.c Issue #19815: Fix segfault when parsing empty namespace declaration. 2013-11-28 06:35:40 -08:00
_freeze_importlib.c
_functoolsmodule.c
_gdbmmodule.c Close #19282: Native context management in dbm 2013-11-17 15:59:51 +10:00
_hashopenssl.c exclude _hashopenssl.c:_setException() from LCOV coverage 2013-12-05 07:38:13 +01:00
_heapqmodule.c Issue 21375: Fix possible Py_ssizet overflow in heapq. 2014-05-03 15:22:07 -07:00
_json.c Issue #22338: Fix a crash in the json module on memory allocation failure. 2014-09-10 23:31:42 +02:00
_localemodule.c
_lsprof.c Issue #20315: Removed support for backward compatibility with early 2.x versions. 2014-01-20 21:35:06 +02:00
_lzmamodule.c Issue #20326: Argument Clinic now uses a simple, unique signature to 2014-01-28 05:00:08 -08:00
_math.c Fix typo. 2014-10-28 22:24:46 +01:00
_math.h
_opcode.c Issue #20530: Argument Clinic's signature format has been revised again. 2014-02-08 22:15:29 -08:00
_operator.c use logical rather than bit and 2014-05-11 16:17:02 -07:00
_pickle.c Issue #15513: Added a __sizeof__ implementation for pickle classes. 2014-12-16 19:39:08 +02:00
_posixsubprocess.c Issue #22290: Fix error handling in the _posixsubprocess module. 2014-10-05 17:25:19 +02:00
_randommodule.c Fix compiler warning on Windows 64-bit: explicit cast size_t to unsigned long 2013-11-15 23:16:15 +01:00
_scproxy.c
_sre.c Issue #20998: Fixed re.fullmatch() of repeated single character pattern 2014-05-14 21:48:17 +03:00
_ssl.c Issue #21356: Make ssl.RAND_egd() optional to support LibreSSL. The 2015-01-06 13:54:58 +01:00
_ssl_data.h Issue #23248: Update ssl error codes from latest OpenSSL git master. 2015-01-18 17:39:32 +01:00
_stat.c
_struct.c - Modules/_struct.c (unpackiter_type): Define static. 2013-11-23 16:07:55 +01:00
_testbuffer.c
_testcapimodule.c Issue #22588: Fix typo in _testcapi.test_incref_decref_API() 2014-10-09 22:15:41 +02:00
_testembed.c
_testimportmultiple.c
_threadmodule.c threading.RLock._acquire_restore() now raises a TypeError instead of a 2014-01-02 12:47:24 +01:00
_tkinter.c Issue #21951: Fixed a crash in Tkinter on AIX when called Tcl command with 2014-09-11 10:57:13 +03:00
_tracemalloc.c Removed duplicated words in in comments and docs. 2014-12-01 18:28:43 +02:00
_weakref.c Issue #20530: Argument Clinic's signature format has been revised again. 2014-02-08 22:15:29 -08:00
_winapi.c Isuse #12328, #20978: Add _winapi.WAIT_ABANDONED_0 symbol, needed by 2014-03-20 09:26:55 +01:00
addrinfo.h
ar_beos
arraymodule.c Issue #22581: Use more "bytes-like object" throughout the docs and comments. 2014-12-05 22:25:22 +02:00
atexitmodule.c
audioop.c Issue #20326: Argument Clinic now uses a simple, unique signature to 2014-01-28 05:00:08 -08:00
binascii.c Issue #23280: Fix docstrings for binascii.(un)hexlify 2015-01-20 13:59:46 -06:00
cmathmodule.c Issue #21902: Replace incorrect 'hyperbolic arc sine' (etc.) with 'inverse hyperbolic sine' (etc.). Remove meaningless reference to radians. 2015-01-11 13:08:05 +00:00
config.c.in
errnomodule.c
faulthandler.c faulthandler: test_gil_released() now uses _sigsegv() instead of _read_null(), 2014-09-30 13:54:14 +02:00
fcntlmodule.c Issue #22821: Fixed fcntl() with integer argument on 64-bit big-endian 2014-11-10 10:42:26 +02:00
fpectlmodule.c Issue #16136: Remove VMS support and VMS-related code 2013-12-21 16:19:10 +01:00
fpetestmodule.c
gc_weakref.txt
gcmodule.c Issue #21435: Segfault in gc with cyclic trash 2014-05-08 17:42:19 -05:00
getaddrinfo.c
getbuildinfo.c
getnameinfo.c
getpath.c Issue #17095: Temporarily revert getpath.c change that added the Modules 2014-09-14 19:19:49 -07:00
grpmodule.c Closes #19342: improve docstrings in grp module. 2014-10-02 08:34:41 +02:00
hashlib.h
hashtable.c Closes #21892, #21893: Use PY_FORMAT_SIZE_T instead of %zi or %zu to format C 2014-07-01 08:57:10 +02:00
hashtable.h Issue #21036: Fix typo in macro name 2014-03-24 22:34:34 +01:00
itertoolsmodule.c Issue #19145: Fix handling of negative values for a "times" keyword argument to itertools.repeat()> 2014-06-24 21:36:58 -07:00
ld_so_aix.in
ld_so_beos
main.c Issue #16136: Remove VMS support and VMS-related code 2013-12-21 16:19:10 +01:00
makesetup Issue #17095: Fix Modules/Setup *shared* support. 2014-06-02 01:05:29 -07:00
makexp_aix
mathmodule.c Issue #21902: Replace incorrect 'hyperbolic arc sine' (etc.) with 'inverse hyperbolic sine' (etc.). Remove meaningless reference to radians. 2015-01-11 13:08:05 +00:00
md5module.c
mmapmodule.c Issue #15696: Add a __sizeof__ implementation for mmap objects on Windows. 2014-08-19 17:11:20 +03:00
nismodule.c
ossaudiodev.c Issue #22369: Change "context manager protocol" to "context management protocol". 2014-09-10 23:43:41 +03:00
overlapped.c Issue #23095, asyncio: Rewrite _WaitHandleFuture.cancel() 2015-01-21 23:39:51 +01:00
parsermodule.c (Merge 3.3) parser: fix usage of Py_BuildValue() to build a parser error 2014-01-02 11:50:10 +01:00
posixmodule.c Issue #23098: 64-bit dev_t is now supported in the os module. 2015-01-18 11:12:11 +02:00
posixmodule.h
pwdmodule.c Issue #16136: Remove VMS support and VMS-related code 2013-12-21 16:19:10 +01:00
pyexpat.c Issue #22462: Fix pyexpat's creation of a dummy frame to make it appear in exception tracebacks. 2014-10-08 20:00:09 +02:00
python.c
readline.c Issue #22773: fix failing test with old readline versions due to issue #19884. 2014-11-04 14:52:10 +01:00
resource.c Issue #19343: Expose FreeBSD-specific APIs in resource module. Original patch by Koobs. 2013-12-08 14:35:55 +01:00
rotatingtree.c
rotatingtree.h
selectmodule.c Issue #20656: Restore explicit downcast in select_select(). 2014-02-18 09:30:33 +01:00
Setup.config.in
Setup.dist Issue #18874: Implement the PEP 454 (tracemalloc) 2013-11-23 12:27:24 +01:00
sha1module.c
sha256module.c
sha512module.c
signalmodule.c Issue #20320: select.select() and select.kqueue.control() now round the timeout 2014-02-17 00:02:43 +01:00
socketmodule.c Issue #22581: Use more "bytes-like object" throughout the docs and comments. 2014-12-05 22:25:22 +02:00
socketmodule.h
spwdmodule.c
sre.h Issue #20998: Fixed re.fullmatch() of repeated single character pattern 2014-05-14 21:48:17 +03:00
sre_constants.h Issue #13592: Improved the repr for regular expression pattern objects. 2013-11-23 22:42:43 +02:00
sre_lib.h Issue #20998: Fixed re.fullmatch() of repeated single character pattern 2014-05-14 21:48:17 +03:00
symtablemodule.c
syslogmodule.c Issue #20437: Fixed 22 potential bugs when deleting objects references. 2014-02-09 13:46:20 +02:00
termios.c
testcapi_long.h
timemodule.c Issue #19748: On AIX, time.mktime() now raises an OverflowError for year 2014-02-21 09:27:17 +01:00
tkappinit.c
tkinter.h
unicodedata.c Issue #23181: More "codepoint" -> "code point". 2015-01-18 11:28:37 +02:00
unicodedata_db.h
unicodename_db.h
xxlimited.c Issue #17162: Add PyType_GetSlot. 2014-02-04 09:33:05 +01:00
xxmodule.c
xxsubtype.c
zipimport.c merge backout for #20621 2014-02-16 14:17:28 -05:00
zlibmodule.c Issue #8677: make the zlib module "ssize_t clean" for parsing parameters 2014-07-01 16:48:12 +02:00