Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Trying to fix an issue, when py-spy would not parse a stack trace containing functions with cyrillic names.
py-spy/src/python_data_access.rs
Lines 26 to 31 in 4a11c44
Seems like UCS-2 strings are in use by some (maybe all?) pre-built Python binaries (tested on
mcr.microsoft.com/devcontainers/rust:1-1-bullseye
Dev Container, our company's CentOS environment, as well as my local environment with Python 3.7 and 3.11 versions installed using pyenv).If there's a function with a UCS-2 encoded name on the first recorded stack trace, py-spy just fails.
Example
Outputs (
profile.svg
will not be created in this case):$ py-spy record -o profile.svg -- python3 tests/scripts/cyrillic.py Error: Failed to find a python interpreter in the .data section
If py-spy successfully started the recorder, we'll get a flamegraph built without stack traces with UCS-2 strings, so final data/graph will look strange or even misleading.
Example
Outputs (
profile.svg
will be created):