Directly constructed `uvloop.loop.Server(None)` segfaults in `close()`
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 68/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 技術堆疊
- python
- 領域
- backend, networking
研究方向
從 uvloop/loop.c 中識別出的 Server.close 和 Server._unref 路徑開始,然後使用 Server(None) 的 Python 程式碼片段重現該故障。在 ASan 下追蹤 close 路徑,並確認重現程式會引發 Python 例外,或以其他方式完成而不會終止直譯器。
由索引模型根據 Issue 內容生成。
描述
Summary
uvloop.loop.Server(None) constructs an object, but calling close() on it terminates the interpreter.
I found this while fuzzing Python C extension modules.
I realize this is not a realistic input or usage pattern, but I would expect a Python exception rather than a process crash.
Versions
uvloop 0.22.1, CPython 3.12.3, Debian 12 x86_64, glibc 2.36
Reproducer
from uvloop.loop import Server
server = Server(None)
server.close()
Segmentation fault (core dumped)
ASan/UBSan result
I built uvloop 0.22.1 from source with Clang 18 using ASan and UBSan instrumentation.
ASan reports a read from address 0x158 on the Server.close() path:
AddressSanitizer:DEADLYSIGNAL
ERROR: AddressSanitizer: SEGV on unknown address 0x000000000158
The signal is caused by a READ memory access.
Hint: address points to the zero page.
#0 PyType_IsSubtype
#1 CPython set operation
#2 __Pyx_PySet_Discard uvloop/loop.c:194862:17
#3 Server._unref uvloop/loop.c:160673:15
#4 Server.close uvloop/loop.c:161676:19
SUMMARY: AddressSanitizer: SEGV in PyType_IsSubtype
The sanitizer process exits with code 134 after ASan aborts.
UBSan did not emit a separate diagnostic before the ASan failure.
- 主要語言
- Cython
- 星號
- 11.9k
- 分支
- 615
- PR 合併指標
- 30 天內沒有已合併 PR
貢獻指南
這個儲存庫沒有索引到貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
MagicStack/uvloop 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 68/100
MagicStack/uvloop#759 ·
-
難度 2/5 1-3 小時 新手友好度 68/100
MagicStack/uvloop#741 · 2 個 reaction ·
-
難度 2/5 1-3 小時 新手友好度 68/100
MagicStack/uvloop#702 · 8 則留言 · 9 個 reaction ·
-
難度 3/5 1-2 天 新手友好度 68/100
MagicStack/uvloop#763 ·
-
難度 4/5 3-5 天 新手友好度 48/100
MagicStack/uvloop#754 · 1 則留言 · 1 個 reaction ·
查看 MagicStack/uvloop 的全部 Issue
相似的 Issue
-
area/sessions comp/cron comp/gateway P2 sweeper:risk-message-delivery sweeper:risk-session-state type/bug
難度 2/5 1-3 小時 新手友好度 78/100
NousResearch/hermes-agent#118863 ·
-
難度 2/5 1-3 小時 新手友好度 76/100
-
難度 2/5 1-3 小時 新手友好度 78/100
use-agent-os/agent-os#3312 ·
-
難度 2/5 1-3 小時 新手友好度 85/100
-
needs-acceptance wg/data-plane-networking
難度 2/5 1-3 小時 新手友好度 78/100
vllm-project/semantic-router#4024 · 1 則留言 ·