`_remote_debugging`: `BinaryWriter.write_sample()` trivial segfault
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 77.2k
- Fork
- 35.9k
- Metriche di merge delle PR
- Metriche PR in attesa
Descrizione
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)] 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:
It only checks if it's a list, and then it trusts completely:
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 versions tested on:
CPython main branch
Operating systems tested on:
macOS
Linked PRs
- gh-157228
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Iniziare in Modules/_remote_debugging/binary_io_writer.c, in BinaryWriter.write_sample() e nelle posizioni unchecked-accessor referenziate. Riprodurre il crash con la chiamata fornita BinaryWriter(...).write_sample([42], 2000), quindi verificare che gli input pubblici non validi non causino più un segfault e che il comportamento sia coperto da test di regressione appropriati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- c, python
- Ambito
- devtools
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 25/100