← Back to team overview

yade-dev team mailing list archive

fixing crash after toggling intrAllWire

 

Hi all,

While investigating examples/PotentialParticles/cubePPscaled.py I had a crash 
when toggling intrAllWire.

That was due to trying to draw an interaction to a body which has been deleted.
So in OpenGLRenderer.cpp:227 I added a safeguard to not draw such interactions.

But there is still a bug looming in there:

A body can get deleted between lines 227 and line 238 in OpenGLRenderer.cpp
And I am right now not sure what happens if we requestErase from separate thread.
Because OpenGLRenderer runs in separate thread.

Also this code seems to be a duplicate of similar codes in Dispatching.cpp:123
and InteractionLoop.cpp:73
Maybe better to move these four lines (check if body was deleted, then
requestErase interaction) somewhere and just call this function from
these three places?

I marked all these places in this commit, so that it will be easier to discuss it:

https://gitlab.com/yade-dev/trunk/commit/8eca8eb7121491df25639d8fc7b966acef1c92c0


Also these messages:

InteractionLoop.cpp:73 action: Body #76 vanished, erasing intr #76+#97!
InteractionLoop.cpp:73 action: Body #21 vanished, erasing intr #21+#96!
InteractionLoop.cpp:73 action: Body #21 vanished, erasing intr #21+#2!

Are really spamming the terminal. Yes they are nice. But we should do something
about default setting of LOG_DEBUG messages to not spam people who don't
understand what's going on. Actually that was a reason for which
I marked some examples as either suspicious or not working. And that
wasn't an error introduced by the author of the example.

best regards 
Janek Kozicki


Follow ups