Message388331
when sub interpreter finalize.
_PyType_ClearCache set next_version_tag = 0.
Type shared between interpreters.
another interpreter assign_version_tag "1" for a type, the type is first assign.
the dealloc interpreter had assign_version_tag "1" for another type.
now, two different type has same version tag. it cause method cache wrong.
static unsigned int
_PyType_ClearCache(struct type_cache *cache)
{
#if MCACHE_STATS
size_t total = cache->hits + cache->collisions + cache->misses;
fprintf(stderr, "-- Method cache hits = %zd (%d%%)\n",
cache->hits, (int) (100.0 * cache->hits / total));
fprintf(stderr, "-- Method cache true misses = %zd (%d%%)\n",
cache->misses, (int) (100.0 * cache->misses / total));
fprintf(stderr, "-- Method cache collisions = %zd (%d%%)\n",
cache->collisions, (int) (100.0 * cache->collisions / total));
fprintf(stderr, "-- Method cache size = %zd KiB\n",
sizeof(cache->hashtable) / 1024);
#endif
unsigned int cur_version_tag = next_version_tag - 1;
next_version_tag = 0;
type_cache_clear(cache, 0);
return cur_version_tag;
} |
|
Date |
User |
Action |
Args |
2021-03-09 06:24:28 | JunyiXie | set | recipients:
+ JunyiXie |
2021-03-09 06:24:28 | JunyiXie | set | messageid: <1615271068.71.0.551794909377.issue43441@roundup.psfhosted.org> |
2021-03-09 06:24:28 | JunyiXie | link | issue43441 messages |
2021-03-09 06:24:28 | JunyiXie | create | |
|