<div dir="ltr"><div>Hi Ravi,</div><div><br></div><div>My guess is that the new text implementation isn't the cause of the crash, only it's the straw that broke the camels back, and actually there is an underlying limitation with the OSG w..r.t you specific usage case.</div><div><br></div><div>Could you create a small test program that reproduces the crash.  Details on your OS/dev tools/hardware will be useful too.<br></div><div><br></div><div>Cheers.<br></div><div>Robert.<br></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, 18 Dec 2018 at 08:50, Ravi Mathur <<a href="mailto:ravidavi@utexas.edu">ravidavi@utexas.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello all,<div><br></div><div>I'm seeing a crash on the OpenSceneGraph-3.6 branch that occurs when I have two CompositeViewers that contain Text objects in their scenes. My simplified scenario is this:</div><div>- 2 CompositeViewers, each in singlethreaded mode, but being run at the same time in separate threads (via OpenThreads::Thread wrappers)</div><div>- The viewers do not share scenes or contexts, and each has a single Text object as its scene</div><div>- Each viewer is destroyed immediately after its run() loop returns (needed for my application)</div><div><br></div><div>Both viewers animate just fine in their own windows. The crash happens if one viewer is being destroyed while the other is actively rendering. Note that it only seems to crash if there are Text objects in each scene, and did not crash with the old (pre-3.6) Text implementation. </div><div><br></div><div>Is this usage model ok in the first place? Robert, I read your post <a href="http://forum.openscenegraph.org/viewtopic.php?t=16844" target="_blank">in this recent thread</a> in which you advise against manually destroying viewers. Should I assume that I was just lucky in getting away with this until now? The new Text implementation seems to be the only thing that triggers the crash.</div><div><br></div><div>In case anybody is interested, the crash happens due to this sequence of calls:</div><div>- ~CompositeViewer() calls GraphicsContext::close(), which deletes its State</div><div>- ~CompositeViewer() then destroys its osgViewer::View, which in turn destroys its Camera</div><div>- ~Camera() eventually calls osgText::releaseGLObjects() with a null State.</div><div>- osgText::releaseGLObjects(null) deletes text-related objects (Programs) on ALL contexts</div><div>- The other CompositeViewer, which is actively rendering its Text on another context, crashes with an access violation since its Text-related Programs were just deleted.</div><div><br></div><div>Thanks,</div><div>Ravi</div></div>
_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
</blockquote></div>