gwaldron/osgearth — Issue #46: Runtime Error (VS2010 Debug) in LRUCache
Author: remoe
Created: 2011-11-10 08:16:48+00:00
State: open

Hi

I have sometimes a "list erase iterator outside range" runtime error at:

```c++
Record get( const K& key ) {
_queries++;
map_iter mi = _map.find( key );
if ( mi != _map.end() ) {
_lru.erase( mi->second.second ); // <<<<<<<<<<<<<
```

Callstack:

```c++
>	msvcp100d.dll!std::_Debug_message(const wchar_t * message, const wchar_t * file, unsigned int line) Line 15	C++
osgEarthd.dll!std::list,std::allocator >,std::allocator,std::allocator > > >::erase(std::_List_const_iterator,std::allocator >,std::allocator,std::allocator > > > > * _Where) Line 1058	C++
osgEarthd.dll!osgEarth::LRUCache,std::allocator >,std::pair,osgEarth::Config> >::get(const std::basic_string,std::allocator > & key) Line 132 + 0x5c bytes	C++
osgEarthd.dll!`anonymous namespace'::MemCacheBin::readObject(const std::basic_string,std::allocator > & key, double maxAge) Line 49	C++
osgEarthd.dll!osgEarth::TileSource::createHeightField(const osgEarth::TileKey & key, osgEarth::TileSource::HeightFieldOperation * prepOp, osgEarth::ProgressCallback * progress) Line 226 + 0x97 bytes	C++
osgEarthd.dll!osgEarth::ElevationLayer::createHeightFieldFromTileSource(const osgEarth::TileKey & key, osgEarth::ProgressCallback * progress) Line 215 + 0x49 bytes	C++
osgEarthd.dll!osgEarth::ElevationLayer::createHeightField(const osgEarth::TileKey & key, osgEarth::ProgressCallback * progress) Line 370 + 0x1d bytes	C++
osgEarthd.dll!`anonymous namespace'::s_getHeightField(const osgEarth::TileKey & key, const std::vector,std::allocator > > & elevLayers, const osgEarth::Profile * mapProfile, bool fallback, osgEarth::ElevationInterpolation interpolation, osgEarth::ElevationSamplePolicy samplePolicy, osg::ref_ptr & out_result, bool * out_isFallback, osgEarth::ProgressCallback * progress) Line 1026 + 0x25 bytes	C++
osgEarthd.dll!osgEarth::MapFrame::getHeightField(const osgEarth::TileKey & key, bool fallback, osg::ref_ptr & out_hf, bool * out_isFallback, osgEarth::ElevationInterpolation interpolation, osgEarth::ElevationSamplePolicy samplePolicy, osgEarth::ProgressCallback * progress) Line 1373	C++
osgdb_osgearth_engine_osgterraind.dll!BuildElevLayer::execute() Line 112 + 0x5d bytes	C++
osgdb_osgearth_engine_osgterraind.dll!TileBuilder::createTile(const osgEarth::TileKey & key, bool parallelize, osg::ref_ptr & out_tile, bool & out_hasRealData, bool & out_hasLodBlendedLayers) Line 398 + 0xd bytes	C++
osgdb_osgearth_engine_osgterraind.dll!SerialKeyNodeFactory::createNode(const osgEarth::TileKey & key) Line 135	C++
osgdb_osgearth_engine_osgterraind.dll!OSGTerrainEngineNode::createNode(const osgEarth::TileKey & key) Line 378 + 0x3c bytes	C++
osgdb_osgearth_engine_osgterraind.dll!OSGTerrainEnginePlugin::readNode(const std::basic_string,std::allocator > & uri, const osgDB::Options * options) Line 103 + 0x1d bytes	C++
osg90-osgDBd.dll!osgDB::Registry::ReadNodeFunctor::doRead(osgDB::ReaderWriter & rw) Line 926 + 0x67 bytes	C++

```

Sorry, i don't have more information. Just a warning ;)

Cheers
Remo