Comments (4)
Seems non-deterministic for some reason https://github.com/zhuyifei1999/guppy3/runs/4731656956?check_suite_focus=true observes failure only when both coverage and sdist are disabled, whereas most of my attempts show the exact reverse.
Targeting the same code to all targets got a new reproduction on ubuntu Python 3.9, with both coverage and sdist disabled: https://github.com/zhuyifei1999/guppy3/runs/4731739323?check_suite_focus=true
from guppy3.
In this recent PR the target that is failing has changed to Python 3.10 for some wild reason. #43 Also seems to happen when codecov = true
from guppy3.
Test passing again after 6e1d780 & 9c9dccc
I'm honestly wondering if it has something to do with being an ediable install and the big warning banner:
********************************************************************************
Please be careful with folders in your working directory with the same
Successfully built guppy3
name as your package as they may take precedence during imports.
********************************************************************************
!!
Even though the test script is in /tmp, and /tmp/test.py
seems unable to import CWD without installing: https://github.com/zhuyifei1999/guppy3/actions/runs/4970663631/jobs/8894682618, there may still be some sort of shenanigans with import path going on.
from guppy3.
Figured out the root cause. RefPat calls a set's .referrers
, and the way it works is subject to a race with the GC, which can cause it to unintentionally return an empty set.
The logic of referrers
performs operation on the reference graph (rg
):
Lines 456 to 496 in 5a35ccb
The reference graph is populated at line 481, but is used at 493. If between this time, the cyclic GC runs, we have:
Lines 107 to 119 in 5a35ccb
Here c
is a cyclic object, so clear_callback
gets called whenever GC runs, and what's inside clear_methods
?
Lines 124 to 126 in 5a35ccb
Lines 177 to 190 in 5a35ccb
The reference graph is cleared upon GC. This makes sense, because reference graph holds strong references to everything it contains, and we don't want objects staying alive forever just because guppy has seen them.
However this is a problem, because if GC runs between the populating of the reference graph and the usage of the reference graph, reference graph would now be empty when it's used, and ... we return bogus results.
This theory is tested in commit 6c7c84d. I'll now port it to master branch.
from guppy3.
Related Issues (20)
- Feature: replace/patch an imported class at runtime HOT 15
- Question: How to analyze guppy heap files HOT 2
- Getting text output from tool HOT 3
- Idea: Save the entire reference graph (to make profile browsers more useful)
- Feature: monitor external python process, possibly by injecting a stub? HOT 3
- pywin32<300 causes NULL pointer deference during referrer graph generation HOT 32
- Provide `guppy.__version__` HOT 1
- Use commas for big numbers HOT 5
- Add support to release aarch64 wheels HOT 2
- [Question] How does `theone` return the Python object? HOT 8
- python.exe crashed on hpy.heap() after Import Official Dropbox SDK for Python HOT 2
- Is it possible to dump the memory snapshot for offline analysis? HOT 3
- Usage with JAX HOT 8
- TypeError: '<' not supported between instances of 'weakref' and 'weakref' HOT 4
- AttributeError with guppy.heapy.UniSet.IdentitySetMulti.partition HOT 3
- Fails to build on Python 3.11 RC2: fatal error: longintrepr.h: No such file or directory HOT 13
- Profile Browser fails with AttributeError: 'bool' object has no attribute '_root' HOT 4
- Remote monitor mode not available for python >3.8 ? HOT 1
- Exception in creating hpy instance
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from guppy3.