Demangle Cython __pyx_* symbols in native stack frames
@alexander-alderman-webb y travaille déjà.
Depuis le 12/6/2026.
Évaluation
Cette issue n'a pas encore été évaluée.
Description
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.
- Langage dominant
- Python
- Étoiles
- 2.2k
- Forks
- 672
- Merge moyen
- 22 h 47 min
- PR mergées (30 j)
- 224
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de getsentry/sentry-python
-
Python
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
getsentry/sentry-python#7569 · 1 commentaire ·
-
Python
Difficulté 1/5 Moins d'une heure Accessibilité débutants 85/100
getsentry/sentry-python#7568 · 2 commentaires ·
-
Python
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
getsentry/sentry-python#7567 · 1 commentaire ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
getsentry/sentry-python#7543 · 2 commentaires · 1 personne assignée ·
-
Python
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
getsentry/sentry-python#6992 · 1 commentaire ·
Toutes les issues de getsentry/sentry-python
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
anthropics/skills#1811 · 1 commentaire ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
speaches-ai/speaches#678 ·
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
datalayer/mcp-compose#42 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
conda-forge/spacy-feedstock#177 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
UKGovernmentBEIS/inspect_evals#2523 ·