Mypyc produces module that crashes (segmentation fault) when executed
Aperta
Nessuno ha ancora preso questa issue.
crash
topic-mypyc
- Lingua principale
- Python
- Stelle
- 20.6k
- Fork
- 3.3k
- Metriche di merge delle PR
- Metriche PR in attesa
Descrizione
compiled.py:
from typing import Generic, TypeVar
_T = TypeVar("_T")
class Bar(Generic[_T]):
def __init__(self) -> None:
self.value: str = 'start'
def __get__(self, instance: _T, owner: type[_T] | None = None) -> str:
return self.value
def __set__(self, instance: _T, value: str) -> None:
self.value = value
class Foo(object):
bar: Bar = Bar()
Compiled with python3 -m mypyc compiled.py.
test.py:
import compiled
print("hello")
f = compiled.Foo()
print(f.bar)
f.bar = 'test'
print(f.bar)
And running with:
$ python3 test.py
hello
<compiled.Bar object at 0x7464e7774310>
Segmentation fault
Using current master of mypyc:
$ python3 -m mypyc --version
mypy 1.16.0+dev.7b4f6311e29452cc8d4ddb78331d0047c8b17e93.dirty (compiled: no)
Using Python 3.13.1
If running with python3 directly:
$ python3 test.py
hello
start
test
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
Riproduci il crash compilando compiled.py con python3 -m mypyc ed eseguendo test.py con Python 3.13.1. Confronta il comportamento compilato con l’esecuzione diretta in Python, concentrandoti sul descrittore generico e sull’accesso a Foo.bar. Il lavoro è completato quando il modulo compilato stampa hello, start e test senza un segmentation fault.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- compilers
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 35/100