AccessViolation in Render Loop


19-11-2010 21:08:01

Gentlemen -

I experiencing something pretty strange... I am using the latest (1.7.1) MOgre build in my project. Everything seems to work fine but every once in a while (seems pretty random to me), I get a Access Violation Exception in renderOneFrame().

The Access Violation is happening here:

ushort LodStrategy::getIndexDescending(Real value, const Material::LodValueList& materialLodValueList)
Material::LodValueList::const_iterator i, iend;
iend = materialLodValueList.end();
unsigned short index = 0;
for (i = materialLodValueList.begin(); i != iend; ++i, ++index)
if (*i < value)
return index ? index - 1 : 0;

// If we fall all the way through, use the highest value
return static_cast<ushort>(materialLodValueList.size() - 1);

In OgreLodStrategy.cpp

Debuggin depper,shows that this is happening somewhere in the vector implementation, where it is trying to access something that is not present. Did anyone experience this issue before and does anyone know how to fix it?




21-11-2010 22:17:53

Disabling shadows did the trick... well... for my application that is fine, however... is this some kind of wrapper bug? I mean is this expected behaviour if Materials are in place that are unaware / dont care about light soruces and / or shadow techniques?


13-12-2010 23:05:52

Oh, the shadow problem.
This bad bug I also had 2 years ago.
Unfortunately it wasn't solved until today.

Here is one thread about. (I don't think this thread is very useful, nevertheless I post it.)

The problem I also reported in the Ogre main forum one year ago. (In this thread is a further link - maybe it contains useful content.)

Thanks for reporting this bug. I did mention it again in the main forum.
Maybe one day will be a bugfix.

Great would be a tiny application which reproduce this problem.
In the best case it always after the first call of RenderOneFrame().
This would be good for debugging.
If you can create/offer such a "demo" application, then please publish it in this thread:


26-12-2010 13:38:04

In the topic of the main forum I got an answer, which could help.
Please try it and give feedback if this solves the problem.

Have you tried setting your shadow buffer to a higher value with SceneManager::setShadowIndexBufferSize? I think you usually get an error specific to that problem but worth throwing it out there since that's the one place that shadows have broken for me so far.

Also you can follow these posts - maybe there are useful answers:
viewtopic.php?p=77659#p77659 ... 23#p413523