Message301079
> So the first non-zero alloc_delta really has a snowball effect, as it creates new memory block which will produce a non-zero alloc_delta on the next run, etc.
Oh, I suspected an issue around this code but I was unable to explain it. I focused strongly on test_current_frames(), whereas this function is just fine... It's really strange that the bug only triggers on very specific conditions.
"""
Actually, it's quite simple :-) On 64-bit Python:
>>> id(82914 - 82913) == id(1)
True
On 32-bit Python:
>>> id(82914 - 82913) == id(1)
False
"""
That's very strange.
Another workaround:
diff --git a/Lib/test/libregrtest/refleak.py b/Lib/test/libregrtest/refleak.py
index efe52107cb..35d3f8e42d 100644
--- a/Lib/test/libregrtest/refleak.py
+++ b/Lib/test/libregrtest/refleak.py
@@ -56,9 +56,10 @@ def dash_R(the_module, test, indirect_test, huntrleaks):
abcs)
print('.', end='', file=sys.stderr, flush=True)
if i >= nwarmup:
- rc_deltas[i] = rc_after - rc_before
- alloc_deltas[i] = alloc_after - alloc_before
- fd_deltas[i] = fd_after - fd_before
+ def maybe_small_long(x): return int(str(x))
+ rc_deltas[i] = maybe_small_long(rc_after - rc_before)
+ alloc_deltas[i] = maybe_small_long(alloc_after - alloc_before)
+ fd_deltas[i] = maybe_small_long(fd_after - fd_before)
alloc_before = alloc_after
rc_before = rc_after
fd_before = fd_after |
|
Date |
User |
Action |
Args |
2017-09-01 00:32:20 | vstinner | set | recipients:
+ vstinner, brett.cannon, pitrou, zach.ware |
2017-09-01 00:32:20 | vstinner | set | messageid: <1504225940.94.0.287896503006.issue31217@psf.upfronthosting.co.za> |
2017-09-01 00:32:20 | vstinner | link | issue31217 messages |
2017-09-01 00:32:20 | vstinner | create | |
|