Demangle Cython __pyx_* symbols in native stack frames
@alexander-alderman-webb 已经在做这个了。
开始于 2026年6月12日。
评估
这个 Issue 还没有评估数据。
描述
Native crash frames generated by Cython-compiled code appear as mangled C
symbols (e.g. __pyx_pw_6module_3func) in sentry-native stack traces, making
them unreadable without manual demangling. The Python SDK captures Cython
frames correctly at the Python level (.pyx file, line number), but when a
crash occurs in the native layer of a Cython extension, the native stack frames
shown in Sentry are opaque.
Current behavior
- Python-level Cython frames (captured by sentry-python via
sys.exc_info())
show correct.pyxsource file and line number - Native frames from the C code generated by Cython (captured by sentry-native
on crash) show raw mangled symbols:__pyx_pw_6module_3func_1name,__pyx_f_6module_3ClassName_method, etc. - C++ demangling (
__cxa_demangle) does not apply to Cython's naming scheme - No Cython-specific demangling exists in sentry-python or the Sentry backend
Gap
Cython uses a deterministic, documented symbol naming convention for the C code
it generates. A demangler can reconstruct the original Python-facing name from
a __pyx_* symbol:
__pyx_pw_<module>_<n><name>→ Python wrapper for<module>.<name>__pyx_f_<module>_<ClassName>_<method>→ C-level function for<module>.<ClassName>.<method>
This demangling could be applied as a post-processing step in theGnuBacktraceIntegration or as a standalone CythonIntegration, enriching
native frames with human-readable Cython source names before the event is sent
to Sentry.
Options
- Extend
GnuBacktraceIntegrationto detect and demangle__pyx_*symbols
in parsed backtrace frames — lowest friction, reuses existing pipeline - Add a standalone
CythonIntegrationevent processor that post-processes
all native frames across exception and crash events — cleaner separation,
applicable beyondGnuBacktrace-formatted strings - Implement server-side demangling in the Sentry symbolicator for
__pyx_*
symbols — transparent to SDK users, but requires changes outside this repo
References
- Cython generated C naming conventions: https://cython.readthedocs.io/en/latest/src/userguide/debugging.html
- Existing
GnuBacktraceIntegration:sentry_sdk/integrations/gnu_backtrace.py
Action taken on behalf of Angelo de Voer.
- 主要语言
- Python
- 星标
- 2.2k
- 派生
- 672
- 平均合并
- 22 小时 47 分钟
- 30 天内合并 PR
- 224
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
getsentry/sentry-python 的其他 Issue
-
Python
难度 2/5 1-3 小时 新手友好度 65/100
getsentry/sentry-python#7569 · 1 条评论 ·
-
Python
难度 1/5 1 小时以内 新手友好度 85/100
getsentry/sentry-python#7568 · 2 条评论 ·
-
Python
难度 2/5 1-3 小时 新手友好度 65/100
getsentry/sentry-python#7567 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
getsentry/sentry-python#7543 · 2 条评论 · 已指派 1 人 ·
-
Python
难度 2/5 1-3 小时 新手友好度 68/100
getsentry/sentry-python#6992 · 1 条评论 ·
查看 getsentry/sentry-python 的全部 Issue
相似的 Issue
-
essnmx good first issue
难度 1/5 1 小时以内 新手友好度 95/100
-
难度 2/5 1-3 小时 新手友好度 65/100
syfoud/Simulated_Scepter#174 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
Giskard-AI/giskard-oss#2840 · 1 条评论 ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success 未关闭area: repo bug perceived difficulty: 2
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 75/100
yeti-platform/yeti#1380 ·