<br><br><div class="gmail_quote">On Wed, Jan 18, 2012 at 11:27, Antoine Pitrou <span dir="ltr">&lt;<a href="mailto:solipsis@pitrou.net">solipsis@pitrou.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im">On Wed, 18 Jan 2012 11:14:50 -0500<br>
Brett Cannon &lt;<a href="mailto:brett@python.org">brett@python.org</a>&gt; wrote:<br>
<br>
&gt; On Wed, Jan 18, 2012 at 10:56, Antoine Pitrou &lt;<a href="mailto:solipsis@pitrou.net">solipsis@pitrou.net</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt; On Thu, 19 Jan 2012 01:06:07 +1000<br>
&gt; &gt; Nick Coghlan &lt;<a href="mailto:ncoghlan@gmail.com">ncoghlan@gmail.com</a>&gt; wrote:<br>
&gt; &gt; &gt; On Wed, Jan 18, 2012 at 2:31 PM,  &lt;<a href="mailto:solipsis@pitrou.net">solipsis@pitrou.net</a>&gt; wrote:<br>
&gt; &gt; &gt; &gt; results for 12de1ad1cee8 on branch &quot;default&quot;<br>
&gt; &gt; &gt; &gt; --------------------------------------------<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; test_capi leaked [2008, 2008, 2008] references, sum=6024<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Yikes, you weren&#39;t kidding about that new subinterpreter code<br>
&gt; &gt; &gt; execution test upsetting the refleak detection...<br>
&gt; &gt;<br>
&gt; &gt; Well, these are real leaks, but I expect them to be quite difficult to<br>
&gt; &gt; track (I&#39;ve found a couple of them), because they can be scattered<br>
&gt; &gt; around in C module initialization routines and the like. I suggest we<br>
&gt; &gt; skip this test on refleak runs.<br>
&gt; &gt;<br>
&gt;<br>
&gt; Do we have any general strategy to help make it more fine-grained to detect<br>
&gt; where the leak might be coming from?<br>
<br>
</div>Unfortunately not. I&#39;ve tried to track down the remaining leaks (*) by<br>
using gc.get_objects(), but apart from a couple of false positives<br>
(dead weakrefs lingering in some tp_subclasses slots until the next<br>
subclasses take their place ;-)), most refleaks seem to be either on<br>
long-lived objects (meaning the leaks are not severe) or on<br>
non-gc-tracked objects.<br>
<br>
(*)<br>
<br>
$ ./python -m test -R 3:2 test_capi<br>
[1/1] test_capi<br>
beginning 5 repetitions<br>
12345<br>
.....<br>
test_capi leaked [152, 152] references, sum=304<br>
<div class="im"><br>
<br>
&gt; We could then maybe try to get some<br>
&gt; people pound on this at the PyCon sprints. Otherwise I&#39;m reluctant to skip<br>
&gt; it since they are legitimate leaks that should be get fixed.<br>
<br>
</div>Well it&#39;s the old well-known issue with pseudo-&quot;permanent&quot; references<br>
not being appropriately managed/cleaned up. Which only shows when<br>
calling Py_Initialize/Py_Finalize multiple times, or using<br>
sub-interpreters.<br></blockquote><div><br></div><div>Could we tweak the report to somehow ignore the permanent refcounts for just this test? If not then we might as well leave it out since that number will never hit 0. </div>

</div>