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
test_descr fails randomly when executed with -R : #87802
Comments
❯ ./python -m test test_descr -m test_slots -R 3:3
0:00:00 load avg: 0.26 Run tests sequentially
0:00:00 load avg: 0.26 [1/1] test_descr
beginning 6 repetitions
123456
test test_descr failed -- Traceback (most recent call last):
File "/home/pablogsal/github/cpython/Lib/test/test_descr.py", line 1201, in test_slots
c.abc = 5
AttributeError: 'C' object has no attribute 'abc' test_descr failed == Tests result: FAILURE == 1 test failed: Total duration: 72 ms |
Bisecting points at: commit ee48c7d
|
Dino, could you take a look? |
Looking! |
Seems that the problem is removing the check:
|
It's probably worth having an assert that the version tag is valid, that'll make it easier to see what's going wrong in the cache hit case. We should have the version tag being 0 now when it's not valid. I may not be able to debug it anymore tonight, but if no will look tomorrow. |
And it looks like we have an entry with a 0 version, but with a valid name: (type_cache_entry) $3 = { |
I think I have it, we still neet to validate that the version tag is correct. Can you take a look at #25032 ? |
I think the issue here is that in assign_version_tag there's this code: if (type->tp_version_tag == 0) {
// Wrap-around or just starting Python - clear the whole cache
type_cache_clear(cache, 1);
return 1;
} the return 1 is incorrect, it should be return 0 as a valid version tag hasn't been assigned. |
Yup, that makes sense. Let me update the PR |
Is _PyType_Lookup() still faster after the fix? The optimization is mentioned at: |
@vstinner - The fix doesn't change the behavior of _PyType_Lookup and instead just fixes a previous unrelated bug. The condition will typically ever be hit once (at startup) as it's very unlikely that versions will wrap, so there should be no performance difference after the fix. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: