loading multiple VRML files in parallel. Christopher R. Baker has detected this bug and crafted a patch. In addition, libcoin has to be also built with the "--enable-threadsafe" option. I copy here his report, extracted from (https://bugs.launchpad.net/ubuntu/+source/openscenegraph/+bug/1211993) and attach his fix. All credit is due to him: « There are three instances of a classical method-local-static multithreaded initialization bug in the Inventor plugin for OSG that trigger various memory faults when reading multiple VRML files in parallel via osgDB::readNodeFile. These bugs are of the form: static std::map<Stuff,OtherStuff> myHandyMap; static bool once = true; if(once) { ...fill myHandyMap; once = false } ... use myHandyMap; To repeat: try loading multiple VRML files from multiple threads. The liklihood of the bug depends on many factors, but my application, which parallel-loads some dozens of small (<100K) VRML files on startup, triggers this problem 25% of the time or more. The attached patch (inventor-plugin-multithread.patch) rectifies this problem by: 1 - Inheriting MyHandyMap from std::map, then 2 - Moving the map initialization into the derived constructor, which 3 - Is intrinsically protected from multithread issues by g++ (and is part of the C++ standard), unless you pass -fno-threadsafe-statics, which is strongly discouraged by the man page. » "
########################################################
# #
# Inventor plugin #
# #
# Supported import formats: #
# - iv (ascii, binary) file format #
# - VRML 1.0 #
# - VRML 2.0 (when using Coin) #
# #
# Supported export formats: #
# - iv format #
# - VRML 1.0 #
# #
########################################################
The plugin requires one of Inventor libraries:
- Coin - GPL, support of VRML 2.0
(http://www.coin3d.org)
- SGI Inventor - LGPL
(http://oss.sgi.com/projects/inventor/)
- TGS Inventor - commercial
(http://www.tgs.com/)
Contributors:
Sean Spicer - Vivek (c) Magic-Earth - Original author of the Inventor reader
Gerrick Bivins
PCJohn - Jan Peciva, Cadwork (c) - author of Inventor writer, number of
contributions and improvements to the reader
Minor fixes:
Ruben
Eric Sokolosky
Martin Aumueller