I have some cryptic issues with IOCP backend on windows. Got this behavior using python 2.7.13 and Windows 7/x86 and Windows 10/x86_64.
Story goes like this. I wrote some kind of proxy server using asyncoro and rpyc. Once one side closes connection, remote backend also forces closing. After some time (very small) application crashes. Stack trace may be different, but looks like it:
python27!_PyObject_GC_Malloc(unsigned int64 basicsize = 0x1f)+0x120 [c:\build27\cpython\modules\gcmodule.c @ 1512]
python27!PyMethod_New(struct _object * func = 0x00000000`046719e8, struct _object * self = 0x00000000`00000000, struct _object * klass = 0x00000000`040eb1e0)+0xe1 [c:\build27\cpython\objects\classobject.c @ 2263]
python27!_PyObject_GenericGetAttrWithDict(struct _object * obj = 0x00000000`048feda0, struct _object * name = 0x00000000`048feda0, struct _object * dict = 0x00000000`040ee0ca)+0x1aa [c:\build27\cpython\objects\object.c @ 1440]
python27!PyEval_EvalFrameEx(struct _frame * f = 0x00000000`03f4a848, int throwflag = 0n1)+0x3124 [c:\build27\cpython\python\ceval.c @ 2544]
python27!PyEval_EvalCodeEx(struct PyCodeObject * co = 0x00000000`040e9bb0, struct _object * globals = 0x00000000`00000002, struct _object * locals = 0x00000000`00000002, struct _object ** args = 0x00000000`040b27a8, int argcount = 0n2, struct _object ** kws = 0x00000000`040d0f10, int kwcount = 0n2, struct _object ** defs = 0x00000000`00000000, int defcount = 0n0, struct _object * closure = 0x00000000`00000000)+0x911 [c:\build27\cpython\python\ceval.c @ 3584]
python27!function_call(struct _object * func = 0x00000000`04671908, struct _object * arg = 0x00000000`0429d308, struct _object * kw = 0x00000000`0427ad08)+0x178 [c:\build27\cpython\objects\funcobject.c @ 528]
python27!PyObject_Call(struct _object * func = 0x00000000`048feda0, struct _object * arg = 0x00000000`026147b8, struct _object * kw = 0x00000000`02191048)+0x83 [c:\build27\cpython\objects\abstract.c @ 2548]
python27!instancemethod_call(struct _object * func = 0x00000000`00000000, struct _object * arg = 0x00000000`00000020, struct _object * kw = 0x00000000`00000002)+0x219 [c:\build27\cpython\objects\classobject.c @ 2603]
python27!PyObject_Call(struct _object * func = 0x00000000`048feda0, struct _object * arg = 0x00000000`0466ebe0, struct _object * kw = 0x00000000`0427ad08)+0x83 [c:\build27\cpython\objects\abstract.c @ 2548]
python27!slot_tp_init(struct _object * self = 0x00000000`048feda0, struct _object * args = 0x00000000`0466ebe0, struct _object * kwds = 0x00000000`0427ad08)+0xd0 [c:\build27\cpython\objects\typeobject.c @ 5807]
python27!type_call(struct _typeobject * type = 0x00000000`0427ad08, struct _object * args = 0x00000000`0427ad08, struct _object * kwds = 0x00000000`00000000)+0xd6 [c:\build27\cpython\objects\typeobject.c @ 765]
python27!PyObject_Call(struct _object * func = 0x00000000`03f1bdc8, struct _object * arg = 0x00000000`0427ad08, struct _object * kw = 0x00000000`00000000)+0x83 [c:\build27\cpython\objects\abstract.c @ 2548]
python27!ext_do_call(struct _object * func = 0x00000000`03f1bdc8, struct _object *** pp_stack = 0x00000000`00000002, int flags = 0n141, int na = 0n1, int nk = 0n0)+0x2eb [c:\build27\cpython\python\ceval.c @ 4666]
python27!PyEval_EvalFrameEx(struct _frame * f = 0x00000000`040dbd30, int throwflag = 0n1)+0x3af3 [c:\build27\cpython\python\ceval.c @ 3031]
python27!PyEval_EvalCodeEx(struct PyCodeObject * co = 0x00000000`040e9f30, struct _object * globals = 0x00000000`00000001, struct _object * locals = 0x00000000`00000001, struct _object ** args = 0x00000000`00000000, int argcount = 0n1, struct _object ** kws = 0x00000000`0429d4e0, int kwcount = 0n1, struct _object ** defs = 0x00000000`00000000, int defcount = 0n0, struct _object * closure = 0x00000000`00000000)+0x911 [c:\build27\cpython\python\ceval.c @ 3584]
python27!function_call(struct _object * func = 0x00000000`04671ac8, struct _object * arg = 0x00000000`048fe240, struct _object * kw = 0x00000000`04904d08)+0x178 [c:\build27\cpython\objects\funcobject.c @ 528]
python27!PyObject_Call(struct _object * func = 0x00000000`048fe470, struct _object * arg = 0x00000000`67557038, struct _object * kw = 0x00000000`040e9e30)+0x83 [c:\build27\cpython\objects\abstract.c @ 2548]
python27!instancemethod_call(struct _object * func = 0x00000000`04904d08, struct _object * arg = 0x00000000`67540fe6, struct _object * kw = 0x00000000`04677ed8)+0x219 [c:\build27\cpython\objects\classobject.c @ 2603]
python27!PyObject_Call(struct _object * func = 0x00000000`04671ac8, struct _object * arg = 0x00000000`02191048, struct _object * kw = 0x00000000`04904d08)+0x83 [c:\build27\cpython\objects\abstract.c @ 2548]
It always crashes on malloc on creating some object. The path depends on actual python code. I believe it happens because at some step IOCP code write garbage to python object memory pool. The top caller always _schedule() function.
(10053, 'WSASend', 'An established connection was aborted by the software in your host machine.')
So I have feeling that there maybe an issue with IOCP request cancellation.
I can easily reproduce this behavior with my program, so I can share It and minidumps with full memory dump. But because it quite big maybe you can provide some assumptions what to check before that.