Skip to content

Commit 24ef36a

Browse files
taegyunkimpablogsal
authored andcommitted
[3.14] pythongh-144316: Fix missing exception in _remote_debugging with debug=False (pythonGH-144442)
(cherry picked from commit c2d3d6b) Co-authored-by: Taegyun Kim <taegyun.kim@datadoghq.com>
1 parent 856fdc6 commit 24ef36a

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
@@ -1134,6 +1134,7 @@ _Py_RemoteDebug_PagedReadRemoteMemory(proc_handle_t *handle,
11341134
if (entry->data == NULL) {
11351135
entry->data = PyMem_RawMalloc(page_size);
11361136
if (entry->data == NULL) {
1137+
PyErr_NoMemory();
11371138
_set_debug_exception_cause(PyExc_MemoryError,
11381139
"Cannot allocate %zu bytes for page cache entry "
11391140
"during read from PID %d at address 0x%lx",
@@ -1143,7 +1144,7 @@ _Py_RemoteDebug_PagedReadRemoteMemory(proc_handle_t *handle,
11431144
}
11441145

11451146
if (_Py_RemoteDebug_ReadRemoteMemory(handle, page_base, page_size, entry->data) < 0) {
1146-
// Try to just copy the exact ammount as a fallback
1147+
// Try to just copy the exact amount as a fallback
11471148
PyErr_Clear();
11481149
goto fallback;
11491150
}

0 commit comments

Comments
 (0)