Mypyc produces module that crashes (segmentation fault) when executed
まだ誰も着手していません。
評価
調査の方向性
compiled.py を python3 -m mypyc でコンパイルし、Python 3.13.1 で test.py を実行してクラッシュを再現します。コンパイル後の動作と Python の直接実行を比較し、ジェネリックディスクリプタと Foo.bar へのアクセスに焦点を当てます。コンパイルされたモジュールが segmentation fault を起こさずに hello、start、test を出力すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Python
- スター
- 20.6k
- フォーク
- 3.3k
- 平均マージ
- 1日 18時間
- マージ済み PR(30日)
- 54
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
python/mypy のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
bug topic-configuration topic-error-reporting
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
似ている issue
-
area/auth bug comp/agent P3 platform/discord type/security
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
NousResearch/hermes-agent#117848 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
bancolombia/sentinel#23 ·
-
test md オープンCI
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
langchain-ai/deepagents#6450 ·
-
bug client
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100