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 Issue #18527: Upgrade internal copy of zlib to 1.2.8 2013-10-21 12:03:09 +02:00
_bisectmodule.c Issue #19514: Deduplicate some _Py_IDENTIFIER declarations. 2013-11-07 18:46:53 +01:00
_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 Issue #18408: Fix PyInit__curses_panel(), handle import_curses() failure 2013-07-18 02:31:21 +02:00
_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 Now all error paths of _freeze_importlib use 'goto error' and the error label cleans up all used resources. 2013-07-21 23:05:11 +02:00
_functoolsmodule.c Issue #6083: Fix multiple segmentation faults occured when PyArg_ParseTuple 2013-02-04 12:54:04 +02:00
_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 Cleanup locale.localeconv(): move Py_DECREF() closer to the error 2013-10-29 19:28:20 +01:00
_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 Issue #15477: Add workaround for log1p(-0.0) on platforms where it's broken. 2012-08-18 12:24:30 +01:00
_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 Issue #11016: Don't define macros and constants that are already set by pyport.h 2013-06-24 00:13:14 +02:00
_struct.c - Modules/_struct.c (unpackiter_type): Define static. 2013-11-23 16:07:55 +01:00
_testbuffer.c Re #18521: fix not-quite-C syntax that works only because the PyXXX_Check are macros defined with () around them. 2013-10-14 06:46:12 +02:00
_testcapimodule.c Issue #22588: Fix typo in _testcapi.test_incref_decref_API() 2014-10-09 22:15:41 +02:00
_testembed.c Issue #16129: Add Py_SetStandardStreamEncoding 2013-10-17 22:35:35 +10:00
_testimportmultiple.c Remove compile warnings for _testimportmodule 2012-12-15 18:16:47 +02:00
_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 Issue #18619: Fix atexit leaking callbacks registered from sub-interpreters, and make it GC-aware. 2013-08-01 20:56:12 +02:00
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 Issue #14605: Stop having implicit entries for sys.meta_path. 2012-04-27 14:01:58 -04:00
errnomodule.c Fix #13210. Port the Windows build from VS2008 to VS2010. 2012-05-13 11:19:23 -05:00
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 Issue #13575: there is only one class type. 2011-12-12 18:54:29 +01:00
gcmodule.c Issue #21435: Segfault in gc with cyclic trash 2014-05-08 17:42:19 -05:00
getaddrinfo.c Issue #15538: Fix compilation of the getnameinfo() / getaddrinfo() emulation code. 2012-08-02 20:37:12 +02:00
getbuildinfo.c
getnameinfo.c Issue #15538: Fix compilation of the getnameinfo() / getaddrinfo() emulation code. 2012-08-02 20:37:12 +02:00
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 Closes #18627: merge from 3.3 2013-08-01 22:13:30 -07:00
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 Issue #18742: Expose the internal hash type object for ABCs. 2013-10-22 15:05:23 +02:00
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 Issue #4591: Uid and gid values larger than 2**31 are supported now. 2013-02-12 09:24:16 +02:00
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 Issue #15893: Improve error handling in main() and Py_FrozenMain() 2013-07-27 02:39:09 +02:00
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 Issue #18742: Expose the internal hash type object for ABCs. 2013-10-22 15:05:23 +02:00
sha256module.c Issue #18742: Expose the internal hash type object for ABCs. 2013-10-22 15:05:23 +02:00
sha512module.c Issue #18742: Expose the internal hash type object for ABCs. 2013-10-22 15:05:23 +02:00
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 Issue #15359: Add CAN_BCM protocol support to the socket module. Patch by Brian 2013-02-05 19:42:01 +01:00
spwdmodule.c #18678: Correct names of spwd struct members. 2013-11-03 19:54:05 -05:00
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 merge 3.3 (#19393) 2013-10-26 13:22:08 -04:00
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 Issue #9530: Fix undefined behaviour due to signed overflow in testcapi_long.h. 2011-11-19 17:58:15 +00:00
timemodule.c Issue #19748: On AIX, time.mktime() now raises an OverflowError for year 2014-02-21 09:27:17 +01:00
tkappinit.c Avoid main_window unused compiler warning. 2012-03-13 23:21:53 -07:00
tkinter.h
unicodedata.c Issue #23181: More "codepoint" -> "code point". 2015-01-18 11:28:37 +02:00
unicodedata_db.h upgrade unicode db to 6.3.0 (closes #19221) 2013-10-10 17:24:45 -04:00
unicodename_db.h upgrade unicode db to 6.3.0 (closes #19221) 2013-10-10 17:24:45 -04:00
xxlimited.c Issue #17162: Add PyType_GetSlot. 2014-02-04 09:33:05 +01:00
xxmodule.c Make indentation consistent 2013-01-01 07:41:51 -08:00
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