When I try to load two meshes using the same texture, the ZipDataStream::read fails with "data error". If I load each file individually or with sufficent time in between, both models load just fine. The error points towards a race condition. I work with 2.2.7 (Windows10 / Dx11) and already backported one fix (84c80a5). Sadly, the error persists.
My first guess was the missing locks in the ZipDataStream class and its cache usage, but after adding locks, I still get the exception and realize that I seem to have two distinct ZipArchive objects / ZipDataStreams managing the same zziplib handle.
Any advise on how to fix the problem?
I can provide the offending models, but a two random low poly, big texture files should suffice.
The following code can be used to provoke the exceptions:
Code: Select all
Ogre::SceneManager *sceneManager = mGraphicsSystem->getSceneManager();
std::vector<Ogre::String> MeshNames = { "VZ244.3_G2.mesh", "VZ244.3_G3.mesh" };
Ogre::String GroupName = "Popular";
for (int i = 0; i < MeshNames.size(); ++i)
{
Ogre::MeshPtr Mesh = Ogre::MeshManager::getSingleton().load( MeshNames[i], GroupName );
Ogre::Item *item = sceneManager->createItem(Mesh, Ogre::SCENE_DYNAMIC );
Ogre::SceneNode *sceneNode = sceneManager->getRootSceneNode( Ogre::SCENE_DYNAMIC )
->createChildSceneNode( Ogre::SCENE_DYNAMIC );
sceneNode->attachObject( item );
sceneNode->setPosition( i, 0.f, 0.f );
sceneNode->scale( 1.f, 1.f, 1.f );
}
Code: Select all
16:07:52: Mesh: Loading VZ244.3_G2.mesh.
16:07:52: Corrupted chunk detected! Stream name: 'VZ244.3_G2.mesh' Chunk id: 12800
16:07:52: Corrupted chunk detected! Stream name: 'VZ244.3_G2.mesh' Chunk id: 3947
16:07:52: Corrupted chunk detected! Stream name: 'VZ244.3_G2.mesh' Chunk id: 26746
16:07:52: Mesh: Loading VZ244.3_G3.mesh.
16:07:55: OGRE EXCEPTION(7:InternalErrorException): Col.jpg - error from zziplib: data error in ZipDataStream::read at C:\pathX\ogre-next\OgreMain\src\OgreZip.cpp (line 377)
16:07:56: OGRE EXCEPTION(7:InternalErrorException): VZ244.3_G3.mesh - error from zziplib: data error in ZipDataStream::read at C:\pathX\ogre-next\OgreMain\src\OgreZip.cpp (line 377)
16:07:56: OGRE EXCEPTION(7:InternalErrorException): Col.jpg - error from zziplib: data error in ZipDataStream::read at C:\pathX\ogre-next\OgreMain\src\OgreZip.cpp (line 377)