gh-144316: Fix missing exception in _remote_debugging with debug=False (#144442)

This commit is contained in:
Taegyun Kim 2026-02-26 22:14:34 +01:00 committed by GitHub
parent 4401f23cbf
commit c2d3d6b0dd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 21 additions and 5 deletions

View file

@ -446,6 +446,9 @@ parse_code_object(RemoteUnwinderObject *unwinder,
if (tlbc_entry) {
// Validate index bounds (also catches negative values since tlbc_index is signed)
if (ctx->tlbc_index < 0 || ctx->tlbc_index >= tlbc_entry->tlbc_array_size) {
PyErr_Format(PyExc_RuntimeError,
"Invalid tlbc_index %d (array size %zd, corrupted remote memory)",
ctx->tlbc_index, tlbc_entry->tlbc_array_size);
set_exception_cause(unwinder, PyExc_RuntimeError,
"Invalid tlbc_index (corrupted remote memory)");
goto error;