Skip to content

Python 3.14 tail call interpreter breaks native stack trace identification #822

@pablogsal

Description

@pablogsal

Python 3.14 introduces a new tail call interpreter that uses LLVM tail calls between small C functions implementing individual Python opcodes. This breaks Memray's ability to properly identify _PyEval_EvalFrameDefault in native stack traces.

With Python 3.14's tail call interpreter, native stack traces show LLVM-generated functions like _TAIL_CALL_INSTRUMENTED_CALL.llvm.10282351651392433962 instead of _PyEval_EvalFrameDefault. This causes native stack trace analysis to fail to properly identify Python frame boundaries, breaking stack trace correlation between native and Python frames.

The tail call interpreter is an opt-in feature in Python 3.14 (enabled with --with-tail-call-interp) that affects x86-64 and AArch64 architectures with Clang 19+.

Memray's native stack trace processing needs to recognize LLVM tail call function patterns (e.g., _TAIL_CALL_*.llvm.*) as equivalent to _PyEval_EvalFrameDefault for frame boundary detection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions