HI David, I have my brain focused on some big topics today without much scope with thinking other complicated areas so won't dive into this one right now.
I recall a discussion about thread safety of Notify from last year with a user who was heavily using notification in a multi-threaded environement and found issues like yourself, I don't know if they are the same though,I don't recall the details. He may of submitted changes or proposed some, but if they had been straight forward and without a performance compromise I would have merged them. It might be searching the archives on osg-users and osg-submissions to look at the discussions, it might help. I did merge some changes w.r.t threading though: r13094 | robert | 2012-06-22 16:21:08 +0000 (Fri, 22 Jun 2012) | 2 lines Restructed the way that the global notify variables are initialized to avoid problems with multi-threaded initialization of these variables. This is at start up though. As for the assumptions that cerr and cout are thread safe, normally I'd stick with this assumption, but I'm not sure it's always the case across all compilers etc. Robert. On 5 August 2013 16:10, David Fries <[email protected]> wrote: > Hi Robert, > > I tested against the svn 3.2 and trunk branches today on Linux and get > the same results with the test program I posted. > > ./ThreadedNotify 48 10000000 2 2 > Segmentation fault > ./ThreadedNotify 48 10000000 2 2 > *** glibc detected *** ./ThreadedNotify: free(): invalid pointer: > 0x0000000000d81500 *** > Segmentation fault > ./ThreadedNotify 48 10000000 2 2 > *** glibc detected *** ./ThreadedNotify: double free or corruption (!prev): > 0x000000000189b500 *** > Segmentation fault > > On Sun, Aug 04, 2013 at 11:48:56AM +0000, Robert Osfield wrote: >> Hi David, >> >> There were various changes to osg::Notify during the 3.1.x dev cycle. >> Could you try out OSG-3.2 and see how you get on. >> >> Robert. >> >> On 2 August 2013 22:54, David Fries <[email protected]> wrote: >> > I spent a few days tracking down a crash I was having generally when a >> > terrapage terrain was paging. This is using OSG 3.1, when I finally >> > caught the corruption I found that both the DatabasePager thread and >> > the Draw thread were calling OSG_NOTIFY. >> > >> > I wrote up a test that does little more than start up a bunch of >> > threads and print messages and found it too crashes. I am testing on >> > both Linux x86-64 gcc 4.7.2, and Windows 7 Visual Studio 10 and both >> > crash, though it crashes much quicker on Windows. >> > >> > It will crash pretty quickly with the default (no arguments) on Windows. >> > >> > The following arguments are working for me to crash on Linux on a 12 >> > core (24 with hyperthreading), x86-64 system. >> > ./ThreadedNotify 48 10000000 2 2 >> > >> > It has been pointed out that cout/cerr are thread safe, so it should >> > be possible to make osg::notify thread safe as well. In this program >> > it helps when I reduce the notification level, at least with the low >> > number of messages being printed it seems to be unlikely. >> > >> > -- >> > David Fries <[email protected]> PGP pub CB1EE8F0 >> > http://fries.net/~david/ >> > >> > _______________________________________________ >> > osg-users mailing list >> > [email protected] >> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >> > >> _______________________________________________ >> osg-users mailing list >> [email protected] >> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > -- > David Fries <[email protected]> PGP pub CB1EE8F0 > http://fries.net/~david/ > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

