Title: `_remote_debugging`: `BinaryWriter.write_sample()` trivial segfault · Issue #157227 · python/cpython · GitHub
Open Graph Title: `_remote_debugging`: `BinaryWriter.write_sample()` trivial segfault · Issue #157227 · python/cpython
X Title: `_remote_debugging`: `BinaryWriter.write_sample()` trivial segfault · Issue #157227 · python/cpython
Description: Bug report Bug description: [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...
Open Graph Description: Bug report Bug description: [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:...
X Description: Bug report Bug description: [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:...
Opengraph URL: https://github.com/python/cpython/issues/157227
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`_remote_debugging`: `BinaryWriter.write_sample()` trivial segfault","articleBody":"# Bug report\n\n### Bug description:\n\n```\n[139] 2026-09-09T18:57:09.249268000+0200 maurycy@gimel /Users/maurycy/work/cpython (main 52ffffe) % ./python.exe \nPython 3.16.0a0 (heads/main:83dbe6ae9f4, Sep 6 2026, 18:18:16) [Clang 21.0.0 (clang-2100.1.1.101)] on darwin\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> import _remote_debugging\n>>> _remote_debugging.BinaryWriter(\"/tmp/o.bin\", 1000, 1000000).write_sample([42], 2000)\nzsh: segmentation fault ./python.exe\n```\n\nThere's many more variants, easy to come up with.\n\nThis is the place:\n\nhttps://github.com/python/cpython/blob/52ffffe0a23bf0f4a57ee00377c5aeb965b3a29a/Modules/_remote_debugging/binary_io_writer.c#L1013\n\nIt only checks if it's a list, and then it trusts completely:\n\nhttps://github.com/python/cpython/blob/52ffffe0a23bf0f4a57ee00377c5aeb965b3a29a/Modules/_remote_debugging/binary_io_writer.c#L841-L848\n\nhttps://github.com/python/cpython/blob/52ffffe0a23bf0f4a57ee00377c5aeb965b3a29a/Modules/_remote_debugging/binary_io_writer.c#L928-L930\n\nhttps://github.com/python/cpython/blob/52ffffe0a23bf0f4a57ee00377c5aeb965b3a29a/Modules/_remote_debugging/binary_io_writer.c#L1020-L1023\n\nThe 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.\n\nI will submit a PR soon.\n\nref #148178\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nmacOS\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-157228\n* gh-162241\n* gh-162264\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/maurycy","@type":"Person","name":"maurycy"},"datePublished":"2026-09-09T18:10:40Z","url":"https://github.com/python/cpython/issues/157227"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a4565524-6139-41c6-852e-4b3e32c45706 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ED6C:2C4BED:3B4E5EF:4B50759:6B020213 |
| html-safe-nonce | 70a3da195e54d2707c581abf38102074f880fa3a392f15556ecbe6a3161861aa |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRDZDOjJDNEJFRDozQjRFNUVGOjRCNTA3NTk6NkIwMjAyMTMiLCJ2aXNpdG9yX2lkIjoiODU0OTYyOTI4OTI0OTc2Nzk1NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 933b263041627db5f041051b81e99cde85eedf32ffaa78a07375c59202b14105 |
| hovercard-subject-tag | issue:5403091934 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/157227/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e064053288a0561076888548cf481f9d075802b05f8f01bfa9f512947165ecc0/python/cpython/issues/157227 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e064053288a0561076888548cf481f9d075802b05f8f01bfa9f512947165ecc0/python/cpython/issues/157227 |
| og:image:alt | Bug report Bug description: [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:... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | maurycy |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width