Fatal error loading old ES_Landscape.esp in Store<ESM::LandTexture>::search
So I've found another crash, and even partially diagnosed the fix, but as usual it got complicated before I could figure out how to really fix it.
I was trying to evaluate the status of Example Suite, and found this old post:
http://forum.openmw.org/viewtopic.php?f=28&p=9361
When running both the ES_MAIN.esm, and the ES_Landscape.esp plugin, I received a fatal error. I'm fairly certain that the problem is in apps/openmw/mwworld/store.cpp:351:
assert(plugin < mStatic.size()); const LandTextureList <exl = mStatic[plugin]; assert(index < ltexl.size()); return <exl.at(index);
For some reason, the asserts do not work, the ltexl reference is invalid, and the returned LandTexture pointer is an invalid address. Changing mStatic[plugin] to mStatic.at(plugin) results in a proper assertion during startup, and that might be the "fix". But there's still lots of things I don't understand:
Was the assert disabled? Why? Is using .at() the fix? If so the same bug probably exists in begin(), end(), and getSize() as well. Or was the bug really the comment in store.hpp which reads:
// Must be threadsafe! Called from terrain background loading threads. // Not a big deal here, since ESM::LandTexture can never be modified or inserted/erased
So as usual, I reached the point where reporting it seemed like the right thing to do...
(RM-3037 from redmine: created on 2015-11-27 by Cory Cohen, , closed on 2015-11-28 by scrawl .)
Attachments: landtex-crash.log