Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix decoding Python 3.13 stacks without symbols #209

Merged

Conversation

godlygeek
Copy link
Contributor

The eager isValid check that we implemented originally fails when symbols aren't available, as we're unable to look up PyCode_Type to compare the type of f_executable against it.

Instead, let's treat every f_executable as though it's a PyCode_Type without checking in advance. If it's not able to be interpreted as a PyCode_Type, we'll expect a RemoteMemCopyError from chasing an invalid pointer at some point, and can handle that the way that we have been handling !isValid.

Closes #205

I tested this manually and confirmed that it does allow us to successfully decode a Python 3.13 core's Python stack even without the correct executable being available. There's no automated test added here, but in fairness the old isValid behavior that's being replaced was also not covered by any automated test.

@godlygeek godlygeek self-assigned this Sep 11, 2024
@godlygeek godlygeek force-pushed the fix_decoding_3.13_stacks_without_symbols branch from ed51a42 to d10e300 Compare September 11, 2024 22:55
The eager `isValid` check that we implemented originally fails when
symbols aren't available, as we're unable to look up `PyCode_Type` to
compare the type of `f_executable` against it.

Instead, let's treat every `f_executable` as though it's a `PyCode_Type`
without checking in advance. If it's not able to be interpreted as
a `PyCode_Type`, we'll expect a `RemoteMemCopyError` from chasing an
invalid pointer at some point, and can handle that the way that we have
been handling `!isValid`.

Signed-off-by: Matt Wozniski <[email protected]>
@godlygeek godlygeek force-pushed the fix_decoding_3.13_stacks_without_symbols branch from d10e300 to 3db2f8e Compare September 11, 2024 22:56
@godlygeek
Copy link
Contributor Author

Adding "skip news" since this fixes a bug that never made it into a release.

@pablogsal pablogsal merged commit f956375 into bloomberg:main Sep 12, 2024
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't get even a pure-Python stack from a 3.13 without symbols or ELF files
2 participants