yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #05249
Re: [Branch ~yade-dev/yade/trunk] Rev 2344: - miniEigen : memory leak source suspected (FIXME added)
-
To:
yade-dev@xxxxxxxxxxxxxxxxxxx
-
From:
Janek Kozicki <janek_listy@xxxxx>
-
Date:
Mon, 12 Jul 2010 12:09:31 +0200
-
Face:
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAALVBMVEUBAQEtLS1KSkpRUVFXV1dYWFhjY2Nzc3N3d3eHh4eKioqdnZ24uLjLy8vc3NxVIagyAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH2AIVEzgS1fgQtQAAAjRJREFUOMtt1DFv00AUAOAzFQNbjigSyoQaRaBMhKgLUyKXpVNNeUpk9vyDqFJhQ1kiBuaqAwJCqvPtSLY7RlTn5+5IdnYkkt/AOyfxXVLe5vf53Z1875kd34tOEax8djmj6GyjhB5bxz50GdsVZr9fqRjZwAtKOJw5Wqs2MMZ16ALHsaDncF7xAHix1oEFHAB8f+pRjcO4gfZDykcYzbiucRolOLUJ6kjA0xtVt+A6TySlM0RajIpK6DzwKZ/nOYbF/gclHMo1ZOHYY/+Ha+AWuM+3oMS4eeqYzZ8FiCltgUqI8cd2wwAVpJk+8LWYjBtnJdQpHQqJMd4Oxt4bU9ESiFGc5hkqaH74asAX4iabP5I5gZ+qjgGlJCqZa3h3lxhoeVcSE1qLQC4sqKOK9MGW9E3izFqqHokoztLFEgXg31sbZEKnWi2T74A4NxfVQqlkjKtcAWD+zcArFEES01dR0E/nnV0IgugmDd/2L84sOAouRBBHEc7gtc8teDkRlE0iNQPo2w3Xhh/D4TCIQ4LRLoTvgwjj6RRgavdurxYGMaIuGOyAW/PpNlCcU9/93AHenAWYjPoAwa+G3e3to/MgFNTAEKvKDjzuCzHTnY3qqdXtx24VijzQfZ0yewZ5cwRFQaa+mIYr1uI0I76+3W4xhlvoVRwOA0Fdl64HlJnxP6T8YpX/Lga4Wv4A3ErrU5oTfN7Mu/llXMl8RXEPji/lQkN3H7qXqgC2By47EXeU/7PJ/wPxRKMnuZwIeAAAAABJRU5ErkJggg==
-
In-reply-to:
<4C3AE2FC.6000208@hmg.inpg.fr>
Bruno Chareyre said: (by the date of Mon, 12 Jul 2010 11:40:12 +0200)
>
> > - CohFrictLaw : Eigen is returning nan quaternions after trivial operations, it is workarounded in the law.
> >
> Raising attention on this fix, as other functors could have the same
> problem.
>
> Take quaternions q1init,q1, q2init,q2, with q1 (resp. q2) close to
> q1init (resp. q2init). In that case,
> AngleAxisr(q1*q1init.conjugate*q2init*q2.conjugate) will sometimes
> return nan rotation while it should be null.
>
> The fix in cohesiveFrictionalContactLaw.cpp:133 is :
> if (isnan(aa.angle())) aa.angle()=0;
OMG, guys. we need to either modify eigen, or write a wrapper for
quaternions. It is not possible to put such stupid lines everywhere
in the code. Same goes about quaternions losing their norm()==1.0
> Bruno
>
> p.s. This is the sort a jokes I was expecting from eigen move, when I
> was asking for strong testing... It took me 2 hours to find the
> problem. Who knows if there are other surprises left?
>
> p.s.2 : There is I think a potential memory leak with functions below,
> are they used?
> +//FIXME : risk of memory leak with these "new"?
> static Quaternionr* Quaternionr_fromAxisAngle(const Vector3r& axis, const Real angle){ return new Quaternionr(AngleAxisr(angle,axis)); }
> static Quaternionr* Quaternionr_fromAngleAxis(const Real angle, const Vector3r& axis){ return new Quaternionr(AngleAxisr(angle,axis)); }
use bzr blame to find who wrote this. This code is crazy wrong.
--
Janek Kozicki http://janek.kozicki.pl/ |
Follow ups
References