Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Demangle Cython __pyx_* symbols in native stack frames

Aberta
#6,500 3 comentários 0 reações 1 responsável Ver no GitHub

Mantenedores costumam responder em até 1 dia

@alexander-alderman-webb já está trabalhando nisso.

Desde 12/6/2026.

Avaliação

Esta issue ainda não foi avaliada.

Descrição

2. High Feature Python

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 .pyx source 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 the
GnuBacktraceIntegration or as a standalone CythonIntegration, enriching
native frames with human-readable Cython source names before the event is sent
to Sentry.

Options

  1. Extend GnuBacktraceIntegration to detect and demangle __pyx_* symbols
    in parsed backtrace frames — lowest friction, reuses existing pipeline
  2. Add a standalone CythonIntegration event processor that post-processes
    all native frames across exception and crash events — cleaner separation,
    applicable beyond GnuBacktrace-formatted strings
  3. Implement server-side demangling in the Sentry symbolicator for __pyx_*
    symbols — transparent to SDK users, but requires changes outside this repo

References

Action taken on behalf of Angelo de Voer.

Linguagem predominante
Python
Estrelas
2.2k
Forks
680
Merge médio
1d 3h
PRs com merge (30d)
234

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de getsentry/sentry-python

Todas as issues de getsentry/sentry-python

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.