<div dir="ltr">I too have seen thread-related issues when creating Text from multiple threads. I was never able to find the time to debug it to conclusion; but I suspect that a shared Font object that needs to create new Glyph textures isn't doing so in a thread-safe manner. For example, Font::assignGlyphToGlyphTexture() modifies some structures without Mutex protection. Just something to check.<div><br>Glenn Waldron / osgEarth<div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 30, 2020 at 4:36 AM OpenSceneGraph Users <<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</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"><div dir="ltr"><div>Hi Anna,</div><div><br></div></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 29 Jan 2020 at 22:38, OpenSceneGraph Users <<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</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"><div dir="ltr">In relation to the DefaultFont crash issue, I noticed that my code would occasionally crash on creation of osgText::Text. <br><div>Most of my osgText::Text is not created on the main thread. <br></div><div>In order to avoid the DefaultFont crash, I created a </div>osg::ref_ptr<osgText::Font> necessaryFont = osgText::Font::getDefaultFont();<br>which sticks around from the beginning of the program to the end and doesn't get used by anything.<br>After I did this, my code no longer crashed on osgText::Text creation.<br>The OpenSceneGraph version used is 3.6.4 and on both Windows (7 64-bit) and Linux (Ubuntu 16.04).<br>Also when I was previously using OpenSceneGraph version 3.6.2, osgText::Text creation never crashed.<br></div></div></blockquote><div><br></div><div>This sounds like a bug somewhere in the initialization of the Font, to investigate I'll need to reproduce the problem on my system.<br></div><div><br></div><div>Does the multi-theaded test code path in osgtext fail for you as well:</div><div><br></div><div> osgtext --mt <br></div><div><br></div><div>I have just tried this on my Kubunutu 18.04 system with the 3.6 branch and it works fine.<br></div><div><br></div><div>Could you create a small test program that illustrates what you are doing?</div><div><br></div><div>Cheers,<br></div><div>Robert.<br></div></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>