Sorry, something went wrong.
|
@vstinner seems like your gut feeling about UnTrack was right |
Sorry, something went wrong.
|
test_httplib doesn't use asyncio, so it's unrelated. The test_httplib crash is: https://bugs.python.org/issue44252 python_d.exe -m test test_httplib -m test_local_bad_hostname
...\cpython\Modules\gcmodule.c:446: update_refs: Assertion "gc_get_refs(gc) != 0" failed
Enable tracemalloc to get the memory block allocation traceback
|
Sorry, something went wrong.
|
If you want to modify overlapped_dealloc(), I suggest to also remove the compatibility code for Windows XP. if (self->pending) {
if (check_CancelIoEx() &&
Py_CancelIoEx(self->handle, &self->overlapped) &&
GetOverlappedResult(self->handle, &self->overlapped, &bytes, TRUE))
{
/* The operation is no longer pending -- nothing to do. */
}
else if (_Py_IsFinalizing())
{
/* The operation is still pending -- give a warning. This
will probably only happen on Windows XP. */
PyErr_SetString(PyExc_RuntimeError,
"I/O operations still in flight while destroying "
"Overlapped object, the process may crash");
PyErr_WriteUnraisable(NULL);
}
else
{
/* The operation is still pending, but the process is
probably about to exit, so we need not worry too much
about memory leaks. Leaking self prevents a potential
crash. This can happen when a daemon thread is cleaned
up at exit -- see #19565. We only expect to get here
on Windows XP. */
CloseHandle(self->overlapped.hEvent);
SetLastError(err);
return;
}
}
check_CancelIoEx() can be removed and CancelIoEx() can be used directly. It's available since Windows Vista and Python 3.11 requires Windows Vista or newer: See also bpo-32592 "Drop support of Windows Vista and Windows 7". Please open a separated PR for that. I don't think that it's worth it to only move the PyObject_GC_UnTrack() call. |
Sorry, something went wrong.
|
test_httplib doesn't use asyncio, so it's unrelated. The test_httplib crash is: https://bugs.python.org/issue44252 python_d.exe -m test test_httplib -m test_local_bad_hostname
...\cpython\Modules\gcmodule.c:446: update_refs: Assertion "gc_get_refs(gc) != 0" failed
Enable tracemalloc to get the memory block allocation traceback
Sorry, I was referring to another crash. These 2 build bots crashed when running in python debug mode due to my previous commit: Both due to assertion errors in the GC. So I wanted to fix those first. The Windows support ones can come another time. |
Sorry, something went wrong.
|
Sorry, I was referring to another crash. These 2 build bots crashed when running in python debug mode due to my previous commit: Ah ok, I merged your PR. |
Sorry, something went wrong.
|
Can you please create a 3.10 backport which contains your two commits? Use git cherry-pick -x. |
Sorry, something went wrong.
|
I closed #26431 which only contained the first fix. |
Sorry, something went wrong.
|
Can you please create a 3.10 backport which contains your two commits? Use git cherry-pick -x. Yep, #26430 has both fixes. Thanks! |
Sorry, something went wrong.
See #26381 (comment). This untracks a possible 'bad' object earlier so the GC stops having weird race conditions. Fixes a gc assertion error in debug mode in test_httplib.
https://bugs.python.org/issue42972