Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Doc/library/unittest.mock.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2539,7 +2539,7 @@ Alternatively you can just use ``vars(my_mock)`` (instance members) and
mock_open
~~~~~~~~~

.. function:: mock_open(mock=None, read_data=None)
.. function:: mock_open(mock=None, read_data='')

A helper function to create a mock to replace the use of :func:`open`. It works
for :func:`open` called directly or used as a context manager.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Fix impossible stack traces (callers and callees cross called, orphans and
incorrect lines) in the Tachyon profiler when caching frames, by snapshotting
the stack chunks before walking the frame chain on a cache miss. Patch by
Maurycy Pawłowski-Wieroński.
8 changes: 8 additions & 0 deletions Modules/_remote_debugging/frames.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,14 @@ collect_frames_with_cache(
return full_hit < 0 ? -1 : 0;
}

assert(ctx->chunks != NULL);

if (ctx->chunks->count == 0) {
if (copy_stack_chunks(unwinder, ctx->thread_state_addr, ctx->chunks) < 0) {
PyErr_Clear();
}
}

Py_ssize_t frames_before = PyList_GET_SIZE(ctx->frame_info);

if (process_frame_chain(unwinder, ctx) < 0) {
Expand Down
Loading