Skip to content

Commit d18b522

Browse files
committed
Add NEWS entry
1 parent 8dc7a48 commit d18b522

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix several crashes due to reading invalid memory in the new Tachyon
2+
sampling profiler. Patch by Pablo Galindo

Modules/_remote_debugging/asyncio.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -828,21 +828,15 @@ append_awaited_by_for_thread(
828828
return -1;
829829
}
830830

831-
// Validate next_node to prevent underflow when computing task_addr
832-
uintptr_t task_node_offset = (uintptr_t)unwinder->async_debug_offsets.asyncio_task_object.task_node;
833-
if (next_node < task_node_offset) {
834-
set_exception_cause(unwinder, PyExc_RuntimeError,
835-
"Invalid task node pointer (corrupted remote memory)");
836-
return -1;
837-
}
838-
uintptr_t task_addr = next_node - task_node_offset;
831+
uintptr_t task_addr = next_node
832+
- (uintptr_t)unwinder->async_debug_offsets.asyncio_task_object.task_node;
839833

840834
if (process_single_task_node(unwinder, task_addr, NULL, result) < 0) {
841835
set_exception_cause(unwinder, PyExc_RuntimeError, "Failed to process task node in awaited_by");
842836
return -1;
843837
}
844838

845-
// Read next node (use already-validated next_node)
839+
// Read next node
846840
if (_Py_RemoteDebug_PagedReadRemoteMemory(
847841
&unwinder->handle,
848842
next_node,

0 commit comments

Comments
 (0)