[139] 2026-09-09T18:57:09.249268000+0200 maurycy@gimel /Users/maurycy/work/cpython (main 52ffffe) % ./python.exe Python 3.16.0a0 (heads/main:83dbe6ae9f4, Sep 6 2026, 18:18:16) [Clang 21.0.0 (clang-2100.1.1.101)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import _remote_debugging >>> _remote_debugging.BinaryWriter("/tmp/o.bin", 1000, 1000000).write_sample([42], 2000) zsh: segmentation fault ./python.exe
There's many more variants, easy to come up with.
This is the place:
cpython/Modules/_remote_debugging/binary_io_writer.c
Line 1013 in 52ffffe
It only checks if it's a list, and then it trusts completely:
Lines 841 to 848 in 52ffffe
Lines 928 to 930 in 52ffffe
Lines 1020 to 1023 in 52ffffe
The comment says Use unchecked accessors since we control the data structures but I still think that segmentation fault on a public method is not great.
I will submit a PR soon.
ref #148178
CPython main branch
macOS
Activity