Skip to content

gh-158550: _remote_debugging: Do not advance prev_timestamp when write_sample fails - #158551

Open
maurycy wants to merge 3 commits into
python:mainfrom
maurycy:fix-remote-debugging-writer-prev-timestamp
Open

maurycy wants to merge 3 commits into
python:mainfrom
maurycy:fix-remote-debugging-writer-prev-timestamp

Conversation

@maurycy

@maurycy maurycy commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

See #158550 for more details.

maurycy@gimel cpython (fix-remote-debugging-writer-prev-timestamp e867c1d?) % cat repro.py 
import _remote_debugging

w = _remote_debugging.BinaryWriter("/tmp/o.bin", 1000, 0)
try:
    w.write_sample([(0, [(1, 0, [(42, None, "f", None)])])], 5000)
except TypeError:
    pass
w.write_sample([(0, [(1, 0, [("a.py", None, "f", None)])])], 6000)
w.finalize()

class C:
    def collect(self, frames, timestamps_us=None, **kw):
        print(timestamps_us)

_remote_debugging.BinaryReader("/tmp/o.bin").replay(C())
maurycy@gimel cpython (fix-remote-debugging-writer-prev-timestamp e867c1d?) % ./python.exe repro.py 
[6000]

Present in 3.15.

Fixes #158550

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

_remote_debugging: write_sample advances the timestamp before writing the sample

1 participant