<div dir="ltr"><div><div>I only get the circular reference error on some operating systems. Ubuntu, for example does not give that error, it simply segfaults at that point in the code. On my Macbook, which gives the Circular Reference error, according to valgrind, there are 4 or 5 invalid reads before the Circular Reference error is printed. As far as I can tell, when CircuitCheck is called with a transform that has already been deleted, on some OSs it returns that there is a circular reference depending on the OS's policy about what happens to freed memory.<br>
<br></div>Looking at my code, there should never be a circular reference:<br></div>I create 3 transforms a, b, & c (trans1, trans2, trans3 in the code). I get the inverses to b & c. Then the loop alternates between setting b to some constant transform with Rotate() and Translate() and setting it so that b = a * c^-1. b is never concatenated to anything, so there should never be a circular reference, and b's inverse is only used to transform some points/vectors.<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 31, 2013 at 6:47 PM, Christopher Mullins <span dir="ltr"><<a href="mailto:christopher.mullins@kitware.com" target="_blank">christopher.mullins@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I'm getting the following error:<div><br><div><div>ERROR: In VTK/Common/Transforms/vtkTransform.cxx, line 242</div>
<div>vtkTransform (0x7f81c94172c0): Concatenate: this would create a circular reference.</div>
</div><div><br></div><div>pointing to this line [1]. Looks like it could be circuit you're creating when you concatenate those transforms in the loop, where CircuitCheck [2] is returning true. If you use trans2->Concatenate(inv3->GetMatrix()); instead of passing the transform directly it terminates correctly. Maybe someone else would know more about why, but it could be because GetMatrix() calls Update().</div>
<div><br></div><div>[1] <a href="https://github.com/Kitware/VTK/blob/master/Common/Transforms/vtkTransform.cxx#L242" target="_blank">https://github.com/Kitware/VTK/blob/master/Common/Transforms/vtkTransform.cxx#L242</a></div>
<div>[2] <a href="http://www.vtk.org/doc/nightly/html/classvtkTransform.html#a47c335c53f0917826db0e17724508640" target="_blank">http://www.vtk.org/doc/nightly/html/classvtkTransform.html#a47c335c53f0917826db0e17724508640</a></div>
<div>
<br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Fri, May 31, 2013 at 6:56 PM, Shawn Waldon <span dir="ltr"><<a href="mailto:swaldon@cs.unc.edu" target="_blank">swaldon@cs.unc.edu</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div><div>Hello all,<br><br></div>I have been using vtk for a project and I ran across a simple case where I can delete a vtkLinearTransform that I have a smart pointer to by concatenating it onto another transform and calling Identity on that transform. I have attached a stripped down example program the exhibits the error. Every time through the loop in the test program the inverse's reference count is decremented somehow until it is deleted and the program segfaults on the next call to TransformVector/TransformPoint.<br>
<br></div><div>Does anyone have any idea what is going on here?<br><br></div><div>Thank you,<br><br></div><div>Shawn Waldon<br></div></div>
<br></div></div>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br>Christopher Mullins<div>R&D Engineer</div><div>Kitware Inc.,</div><div><a href="tel:919.869.8871" value="+19198698871" target="_blank">919.869.8871</a></div>
</font></span></div>
</blockquote></div><br></div>