Skip to content

Commit dcd1c74

Browse files
taegyunkimpablogsal
authored andcommitted
pythongh-144316: Fix missing exception in _remote_debugging with debug=False (python#144442)
1 parent 6a3b861 commit dcd1c74

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix crash in ``_remote_debugging`` that caused ``test_external_inspection`` to intermittently fail. Patch by Taegyun Kim.

Python/remote_debug.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1095,6 +1095,7 @@ _Py_RemoteDebug_PagedReadRemoteMemory(proc_handle_t *handle,
10951095
if (entry->data == NULL) {
10961096
entry->data = PyMem_RawMalloc(page_size);
10971097
if (entry->data == NULL) {
1098+
PyErr_NoMemory();
10981099
_set_debug_exception_cause(PyExc_MemoryError,
10991100
"Cannot allocate %zu bytes for page cache entry "
11001101
"during read from PID %d at address 0x%lx",
@@ -1104,7 +1105,7 @@ _Py_RemoteDebug_PagedReadRemoteMemory(proc_handle_t *handle,
11041105
}
11051106

11061107
if (_Py_RemoteDebug_ReadRemoteMemory(handle, page_base, page_size, entry->data) < 0) {
1107-
// Try to just copy the exact ammount as a fallback
1108+
// Try to just copy the exact amount as a fallback
11081109
PyErr_Clear();
11091110
goto fallback;
11101111
}

0 commit comments

Comments
 (0)