<div class="gmail_quote">On Thu, Jul 19, 2012 at 2:40 AM, Florian Beck <span dir="ltr"><<a href="mailto:Flo.44@gmx.de" target="_blank">Flo.44@gmx.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
In the debugger is the adress of my vector at the beginning and the end the same, but if I look inside the vector the adress of ops, map and data are 0x0 after I call the function VecDuplicate(). Is there a function to synchronize the vectors before I destroy them?</blockquote>
</div><br><div>Sounds like a reference-counting bug. The most common cause is basically</div><div><br></div><div>Vec X,Y;</div><div>VecCreate(comm,&X);</div><div>...</div><div>Y = X;</div><div>...</div><div>VecDestroy(&X);</div>
<div>VecDestroy(&Y);<br><br>(perhaps spread across multiple functions, and perhaps with a reference obtained through a function that does not give you an "ownership share" by incrementing reference count).</div>
<div><br></div><div>You can use "watch -l X->hdr.refct" in recent gdb to follow all the locations where reference count was changed (this includes the library), if you need a heavyweight methodology for tracking down the error.</div>