Hi,
I was working on OSG export related code and I noticed some interesting
problems with osgDB::Registry::writeNodeImplementation() and other
similar functions within Registry.cpp.
The first issue is that performing the same task twice gives different
result. Reproduction case:
1. Create a file named 'osg-export.osgb' (the file can be created using
any method you wish, it can be an empty file).
2. Open 'osg-export.osgb' in a process or program that opens the file in
a mode in which no other process is allowed to modify the file.
Essentially, we are trying to force write operations on the file to
fail. On Windows I opened the file with FILE_SHARE_EXCLUSIVE flag in
another process.
3. Use osgDB::Registry::writeNodeImplementation() to export a model to
'osg-export.osgb'.
4. Take note of the ReaderWriter::WriteResult.
5. Re-export the model (like in step 3).
6. Notice that the ReaderWriter::WriteResult is not the same as in step
4 although the user performed the same operation.
A secondary problem is that writeNodeImplementation() returns
results.front() at the end, but (if I am reading the code correctly),
the correct error status depends on which reader/writer is associated
with the current file extension, and is not guaranteed to be the first
one. This is a non issue if each plugin only contains a single
reader/writer, but that does not seem to be the case.
Finally, I am concerned with the possibility of binary planting. I see
comments in osgDB::appendPlatformSpecificLibraryFilePaths() that try to
account for the problem. I will look into this some more on Monday.
The same issues apply for other plugin related features, such as image
exports and others.
Regards,
Judson
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org