<div dir="ltr">Kevin,<div><br></div><div>libc itself can have some globally initialized variables which are out of our control. It is important to understand that there possible (and are) false-positive reports. We can&#39;t solve all of them.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 12, 2016 at 11:51 PM, Kévin Dietrich <span dir="ltr">&lt;<a href="mailto:kevin.dietrich@mailoo.org" target="_blank">kevin.dietrich@mailoo.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="font-size:10pt">
<p>Hi,</p>
<p><br></p>
<p>The other day, I quickly tried my hand at implementing Alembic in Cycles standalone, didn&#39;t really work out partly since Alembic files don&#39;t store lights. Anyway, I did notice the following leak report from GCC:</p>
<p><br></p>
<p>=================================================================<br>==643==ERROR: LeakSanitizer: detected memory leaks</p>
<p>Direct leak of 32816 byte(s) in 1 object(s) allocated from:<br> #0 0x7f591193444a in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x9444a)<br> #1 0x7f590fbe4dd0 (/lib/x86_64-linux-gnu/libc.so.6+0xbcdd0)</p>
<p>SUMMARY: AddressSanitizer: 32816 byte(s) leaked in 1 allocation(s).</p>
<p><br></p>
<p>It&#39;s not very detailed, but I just tried again with master and it&#39;s still there, though I don&#39;t know if it&#39;s the same issue as Thomas&#39; or just GCC being confused. Thought I&#39;d share.</p>
<p><br></p>
<p>Cheers,</p>
<p>Kévin</p><div><div class="h5">
<p><br></p>
<p>Le 2016-07-12 20:12, Sergey Sharybin a écrit :</p>
<blockquote type="cite" style="padding:0 0.4em;border-left:#1010ff 2px solid;margin:0">
<div dir="ltr">Hi,
<div> </div>
<div>In Blender we do use guarded allocator everywhere, including Cycles (at least for it&#39;s major parts). I did not see any leaks reported. So can you elaborate a bit more which exact memory is leaking?</div>
<div> </div>
<div>Think it worth addressing the issue unless it leads to some nasty code workaorunds or makes integration into other software creepier.</div>
<div> </div>
<div>But all that being said, please make sure you&#39;re doing similar thing to what we do in blender_python.cpp:exit_func(). This was the trick to make staticly initialized data to be freed and make Blender&#39;s integration happy.</div>
<div> </div>
<div>We should probably need to move that code to ccl::Session::exit() and call from standalone app as well.</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Jul 12, 2016 at 6:31 PM, Thomas Krebs <span>&lt;<a href="mailto:Thomas.Krebs@mecadtron.de" target="_blank">Thomas.Krebs@mecadtron.de</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br><br> We are currently trying to integrate cycles into our 3d app.<br> We have successfully implemented a collada exporter from our app<br> and produced some nice images in Blender.<br> Now we got the standalone cycles app compiled and running.<br> We found that cycles leaks quite some bit from some static<br> initializers. As we try to solve leaks by monitoring leaks reports from<br> MSVC this is somewhat problematic.<br> Personally I would prefer not to have static initializers rather than<br> some initialize/terminate functions, which would make cycles even more<br> usable for integration in other systems.<br> Is there some effort going on to address that situation or would such<br> an effort be welcome?<br> We might supply changes for that but we would leave it up to more<br> experienced submitters to integrate such changes, if at all.<br><br> Thomas<br> _______________________________________________<br> Bf-cycles mailing list<br><a href="mailto:Bf-cycles@blender.org" target="_blank">Bf-cycles@blender.org</a><br><a href="https://lists.blender.org/mailman/listinfo/bf-cycles" rel="noreferrer" target="_blank">https://lists.blender.org/mailman/listinfo/bf-cycles</a></blockquote>
</div>
<br><br clear="all">
<div> </div>
-- <br>
<div>
<div><span style="color:#666666">With best regards, Sergey Sharybin</span></div>
</div>
</div>
<br>
<div style="margin:0;padding:0;font-family:monospace">_______________________________________________<br> Bf-cycles mailing list<br><a href="mailto:Bf-cycles@blender.org" target="_blank">Bf-cycles@blender.org</a><br><a href="https://lists.blender.org/mailman/listinfo/bf-cycles" rel="noreferrer" target="_blank">https://lists.blender.org/mailman/listinfo/bf-cycles</a></div>
</blockquote>
<p><br></p>

</div></div></div>
<br>_______________________________________________<br>
Bf-cycles mailing list<br>
<a href="mailto:Bf-cycles@blender.org">Bf-cycles@blender.org</a><br>
<a href="https://lists.blender.org/mailman/listinfo/bf-cycles" rel="noreferrer" target="_blank">https://lists.blender.org/mailman/listinfo/bf-cycles</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div><span style="color:rgb(102,102,102)">With best regards, Sergey Sharybin</span></div></div>
</div>