Crash bug

Hi,

Lots of changes today, esp. commit #197. In particular, I checked in the
Camera class and reworked GLWidget a bit.

Since today, creating an atom and dragging it around using the ‘draw’ tool
often (but not always) results in a crash. The crash happens in
GLWidget::removePrimitive(). The change that triggers this bug is that since
today, when the molecule gets redrawn after having been changed,
Molecule::computeGeomInfo() gets called and runs through the atoms of the
molecule.

Molecule::computeGeomInfo() is not the culprit though. When it gets called, a
primitive that has just been removed is still in the list! It crashes when it
reaches it.

If in GLWidget::removePrimitive() I replace updateGL() with update(), the
crash disappears. The difference is that updateGL() forces immediate redraw,
while update() only schedules redraw. So it seems that the removal of the
primitive eventually occurs, only not immediately.

I hope the one who wrote that code will be able to fix it :slight_smile:

Side note: in my experience, unless one is writing a benchmark, there is no
reason to use updateGL(). I prefer update(), so I’ll change that unless you
disagree. However I won’t do it before the above issue is resolved, as this
would hide it.

Cheers,
Benoit

There is also a bug when a blank molecule is used for the GLWidget. If
there is a blank then i cannot add new atoms. When i add one, it
doesn’t show up on the screen and the GLWidget doesn’t respond anymore.
Will continue to try and debug this.

-Donald

(Sun, Mar 18, 2007 at 10:58:26PM +0100) Benoît Jacob jacob@math.jussieu.fr:

Hi,

Lots of changes today, esp. commit #197. In particular, I checked in the
Camera class and reworked GLWidget a bit.

Since today, creating an atom and dragging it around using the ‘draw’ tool
often (but not always) results in a crash. The crash happens in
GLWidget::removePrimitive(). The change that triggers this bug is that since
today, when the molecule gets redrawn after having been changed,
Molecule::computeGeomInfo() gets called and runs through the atoms of the
molecule.

Molecule::computeGeomInfo() is not the culprit though. When it gets called, a
primitive that has just been removed is still in the list! It crashes when it
reaches it.

If in GLWidget::removePrimitive() I replace updateGL() with update(), the
crash disappears. The difference is that updateGL() forces immediate redraw,
while update() only schedules redraw. So it seems that the removal of the
primitive eventually occurs, only not immediately.

I hope the one who wrote that code will be able to fix it :slight_smile:

Side note: in my experience, unless one is writing a benchmark, there is no
reason to use updateGL(). I prefer update(), so I’ll change that unless you
disagree. However I won’t do it before the above issue is resolved, as this
would hide it.

Cheers,
Benoit


Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net’s Techsay panel and you’ll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


Avogadro-devel mailing list
Avogadro-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avogadro-devel

Ok, so the cause of the problem is that EndModify() was being called
after DestroyAtom() and so the molecule was in an unstable state. Most
likely from bad conformer information. I am going to push these changes
to OB. I hope this ok with Geoff. I know we are close to the release
but this change makes sense and will directly impact the Avogadro
release. Ran all the tests and they came back excellent. I think that
will at some point need to consider when we’re actually “inside” a
BeginModify and EndModify and are using Avogadro. I’m not sure how this
would work.

Anyways, like i said i committed the changes in revision 1879.

-Donald

(Sun, Mar 18, 2007 at 10:58:26PM +0100) Benoît Jacob jacob@math.jussieu.fr:

Hi,

Lots of changes today, esp. commit #197. In particular, I checked in the
Camera class and reworked GLWidget a bit.

Since today, creating an atom and dragging it around using the ‘draw’ tool
often (but not always) results in a crash. The crash happens in
GLWidget::removePrimitive(). The change that triggers this bug is that since
today, when the molecule gets redrawn after having been changed,
Molecule::computeGeomInfo() gets called and runs through the atoms of the
molecule.

Molecule::computeGeomInfo() is not the culprit though. When it gets called, a
primitive that has just been removed is still in the list! It crashes when it
reaches it.

If in GLWidget::removePrimitive() I replace updateGL() with update(), the
crash disappears. The difference is that updateGL() forces immediate redraw,
while update() only schedules redraw. So it seems that the removal of the
primitive eventually occurs, only not immediately.

I hope the one who wrote that code will be able to fix it :slight_smile:

Side note: in my experience, unless one is writing a benchmark, there is no
reason to use updateGL(). I prefer update(), so I’ll change that unless you
disagree. However I won’t do it before the above issue is resolved, as this
would hide it.

Cheers,
Benoit


Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net’s Techsay panel and you’ll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


Avogadro-devel mailing list
Avogadro-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avogadro-devel