I'm no expert at this but I will try to explain what I think is the cause.
From
Wikipedia:
"A segmentation fault occurs when a program attempts to access a memory location that it is not allowed to access, or attempts to access a memory location in a way that is not allowed (for example, attempting to write to a read-only location, or to overwrite part of the operating system)."
Browse this file in CVSThe message can be found in source/shared_lib/include/graphics/model.cpp
in the method void Model::loadG3d(const string &path)
catch(exception &e){
throw runtime_error("Exception caught loading 3d file: " + path +"\n"+ e.what());
}
Eljay Love-Jensen wrote:
"When new fails to allocate the memory for an object, or new[] fails to allocate the memory for an object array, a std::bad_alloc object is thrown. In GCC, the RTTI mangled name of std::bad_alloc is, I'm guessing, St9bad_alloc."
In the method new[] occurs like this (three dots have been put in for left out source):
...
...
ModelHeader modelHeader;
fread(&modelHeader, sizeof(ModelHeader), 1, f);
meshCount= modelHeader.meshCount;
...
meshes= new Mesh[meshCount];
for(uint32 i=0; i<meshCount; ++i){
meshes[i].load(dir, f, textureManager);
meshes[i].buildInterpolationData();
}
...
...
In
model_header.h meshCount is defined in the ModelHeader struct as being uint16 which has a range from 0 to positive 65,535. So the problem might be something to do with the size of the ModelHeader.
meshes
.buildInterpolationData(); also has new in it.
void Mesh::buildInterpolationData(){
interpolationData= new InterpolationData(this);
}
I'm not really sure how to fix this problem or why it is occuring but I'd say this is getting close to where the problem is. I hope this helps.
Looking at the source it seems that there is a version 4.