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

Use code object instead of (co_firstlineno, co_name, co_filename) for caching frame info. Fixes #837 Fixes #844 #851

Merged
merged 1 commit into from
Feb 25, 2022

Conversation

fabioz
Copy link
Collaborator

@fabioz fabioz commented Feb 24, 2022

This fixes the issue where the cache key used in the debugger was caching based on the information which could be sometimes repeated when the user generated code objects (and thus the debugger would think it had a cache hit when it didn't in reality).

With this change, the cache key for the information is the code object itself.

I hadn't done this previously because of the possibility of creating code object leaks (because any code object seen by the debugger will be kept alive forever), but after reviewing the code a bit it seems we already store those code-objects as cache keys in other places anyways (given that code objects are immutable it's hard to find a good place to store such info) so I gave in and just started to use the code object as the cache key as we "leak" those anyways already.

@sonarcloud
Copy link

sonarcloud bot commented Feb 24, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants