Hello, it's me again ;-)

I modified my test program to load and afterwards unload all nodes (see 
rotate function below). It crashes, after I delete all nodes and sync the 
threads.


'_pAspectStore' in 'FieldContainer *FieldContainer::getAspectPtr(UInt32 
uiAspect) const' is 0xfeeefeee (use of already deleted object).


Callstack:

        OSGBaseD.dll!std::vector<OSG::FieldContainer 
*,std::allocator<OSG::FieldContainer *> >::size()  Zeile 703 + 0x3 Bytes 
C++
        OSGBaseD.dll!OSG::AspectStore::getPtr(const unsigned int 
uiAspect=0)  Zeile 56 + 0x8 Bytes       C++
        OSGDrawableD.dll!OSG::FieldContainer::getAspectPtr(unsigned int 
uiAspect=0)  Zeile 303 + 0x12 Bytes     C++
        OSGDrawableD.dll!OSG::convertToCurrentAspect<OSG::Geometry 
*>(OSG::Geometry * pFC=0x06da9338)  Zeile 496 + 0x18 Bytes      C++
        OSGDrawableD.dll!OSG::MTPtr<OSG::Geometry>::get()  Zeile 53 + 0xb 
Bytes   C++
        OSGDrawableD.dll!OSG::get_pointer<OSG::Geometry>(const 
OSG::MTPtr<OSG::Geometry> & pIn={...})  Zeile 81        C++
        OSGDrawableD.dll!boost::_mfi::mf4<unsigned 
int,OSG::Geometry,OSG::DrawEnv *,unsigned int,enum 
OSG::Window::GLObjectStatusE,unsigned 
int>::call<OSG::MTPtr<OSG::Geometry>,OSG::DrawEnv *,unsigned int,enum 
OSG::Window::GLObjectStatusE,unsigned int>(OSG::MTPtr<OSG::Geometry> & 
u={...}, const void * __formal=0x06da954c, OSG::DrawEnv * & b1=0x048547ec, 
unsigned int & b2=34, OSG::Window::GLObjectStatusE & b3=initialize, 
unsigned int & b4=0)  Zeile 485 + 0x23 Bytes    C++
        OSGDrawableD.dll!boost::_mfi::mf4<unsigned 
int,OSG::Geometry,OSG::DrawEnv *,unsigned int,enum 
OSG::Window::GLObjectStatusE,unsigned 
int>::operator()<OSG::MTPtr<OSG::Geometry> >(OSG::MTPtr<OSG::Geometry> & 
u={...}, OSG::DrawEnv * a1=0x048547ec, unsigned int a2=34, 
OSG::Window::GLObjectStatusE a3=initialize, unsigned int a4=0)  Zeile 500 
C++
 
OSGDrawableD.dll!boost::_bi::list5<boost::_bi::value<OSG::MTPtr<OSG::Geometry> 
>,boost::arg<1>,boost::arg<2>,boost::arg<3>,boost::arg<4> 
>::operator()<unsigned int,boost::_mfi::mf4<unsigned 
int,OSG::Geometry,OSG::DrawEnv *,unsigned int,enum 
OSG::Window::GLObjectStatusE,unsigned int>,boost::_bi::list4<OSG::DrawEnv 
* &,unsigned int &,enum OSG::Window::GLObjectStatusE &,unsigned int &> 
>(boost::_bi::type<unsigned int> __formal={...}, boost::_mfi::mf4<unsigned 
int,OSG::Geometry,OSG::DrawEnv *,unsigned int,enum 
OSG::Window::GLObjectStatusE,unsigned int> & f={...}, 
boost::_bi::list4<OSG::DrawEnv * &,unsigned int &,enum 
OSG::Window::GLObjectStatusE &,unsigned int &> & a={...}, 
boost::_bi::type<unsigned int> __formal={...})  Zeile 495       C++
        OSGDrawableD.dll!boost::_bi::bind_t<unsigned 
int,boost::_mfi::mf4<unsigned int,OSG::Geometry,OSG::DrawEnv *,unsigned 
int,enum OSG::Window::GLObjectStatusE,unsigned 
int>,boost::_bi::list5<boost::_bi::value<OSG::MTPtr<OSG::Geometry> 
>,boost::arg<1>,boost::arg<2>,boost::arg<3>,boost::arg<4> > 
>::operator()<OSG::DrawEnv *,unsigned int,enum 
OSG::Window::GLObjectStatusE,unsigned int>(OSG::DrawEnv * & a1=0x048547ec, 
unsigned int & a2=34, OSG::Window::GLObjectStatusE & a3=initialize, 
unsigned int & a4=0)  Zeile 146 C++
 
OSGDrawableD.dll!boost::detail::function::function_obj_invoker4<boost::_bi::bind_t<unsigned
 
int,boost::_mfi::mf4<unsigned int,OSG::Geometry,OSG::DrawEnv *,unsigned 
int,enum OSG::Window::GLObjectStatusE,unsigned 
int>,boost::_bi::list5<boost::_bi::value<OSG::MTPtr<OSG::Geometry> 
>,boost::arg<1>,boost::arg<2>,boost::arg<3>,boost::arg<4> > >,unsigned 
int,OSG::DrawEnv *,unsigned int,enum OSG::Window::GLObjectStatusE,unsigned 
int>::invoke(boost::detail::function::function_buffer & 
function_obj_ptr={...}, OSG::DrawEnv * a0=0x048547ec, unsigned int a1=34, 
OSG::Window::GLObjectStatusE a2=initialize, unsigned int a3=0)  Zeile 132 
C++
        OSGSystemD.dll!boost::function4<unsigned int,OSG::DrawEnv 
*,unsigned int,enum OSG::Window::GLObjectStatusE,unsigned 
int>::operator()(OSG::DrawEnv * a0=0x048547ec, unsigned int a1=34, 
OSG::Window::GLObjectStatusE a2=initialize, unsigned int a3=0)  Zeile 989 
+ 0x23 Bytes    C++
        OSGSystemD.dll!OSG::Window::validateGLObject(unsigned int 
osgId=34, OSG::DrawEnv * pEnv=0x048547ec, unsigned int uiOptions=0)  Zeile 
734 + 0x1d Bytes        C++
        OSGDrawableD.dll!OSG::Geometry::drawPrimitives(OSG::DrawEnv * 
pEnv=0x048547ec)  Zeile 402 + 0x26 Bytes        C++
        OSGSystemD.dll!boost::_mfi::mf1<enum 
OSG::ActionBase::ResultE,OSG::MaterialDrawable,OSG::DrawEnv 
*>::operator()(OSG::MaterialDrawable * p=0x04bce028, OSG::DrawEnv * 
a1=0x048547ec)  Zeile 162 + 0x10 Bytes  C++
 OSGSystemD.dll!boost::_bi::list2<boost::_bi::value<OSG::MaterialDrawable 
*>,boost::arg<1> >::operator()<enum 
OSG::ActionBase::ResultE,boost::_mfi::mf1<enum 
OSG::ActionBase::ResultE,OSG::MaterialDrawable,OSG::DrawEnv 
*>,boost::_bi::list1<OSG::DrawEnv * &> >(boost::_bi::type<enum 
OSG::ActionBase::ResultE> __formal={...}, boost::_mfi::mf1<enum 
OSG::ActionBase::ResultE,OSG::MaterialDrawable,OSG::DrawEnv *> & f={...}, 
boost::_bi::list1<OSG::DrawEnv * &> & a={...}, boost::_bi::type<enum 
OSG::ActionBase::ResultE> __formal={...})  Zeile 283    C++
        OSGSystemD.dll!boost::_bi::bind_t<enum 
OSG::ActionBase::ResultE,boost::_mfi::mf1<enum 
OSG::ActionBase::ResultE,OSG::MaterialDrawable,OSG::DrawEnv 
*>,boost::_bi::list2<boost::_bi::value<OSG::MaterialDrawable 
*>,boost::arg<1> > >::operator()<OSG::DrawEnv *>(OSG::DrawEnv * & 
a1=0x048547ec)  Zeile 33        C++
 
OSGSystemD.dll!boost::detail::function::function_obj_invoker1<boost::_bi::bind_t<enum
 
OSG::ActionBase::ResultE,boost::_mfi::mf1<enum 
OSG::ActionBase::ResultE,OSG::MaterialDrawable,OSG::DrawEnv 
*>,boost::_bi::list2<boost::_bi::value<OSG::MaterialDrawable 
*>,boost::arg<1> > >,enum OSG::ActionBase::ResultE,OSG::DrawEnv 
*>::invoke(boost::detail::function::function_buffer & 
function_obj_ptr={...}, OSG::DrawEnv * a0=0x048547ec)  Zeile 132 C++
        OSGSystemD.dll!boost::function1<enum 
OSG::ActionBase::ResultE,OSG::DrawEnv *>::operator()(OSG::DrawEnv * 
a0=0x048547ec)  Zeile 989 + 0x17 Bytes  C++
        OSGSystemD.dll!OSG::TreeBuilderBase::drawNode(OSG::RenderTreeNode 
* pNode=0x06363e78, OSG::DrawEnv & denv={...}, OSG::RenderPartitionBase * 
part=0x048547b8)  Zeile 161     C++
        OSGSystemD.dll!OSG::TreeBuilderBase::drawNode(OSG::RenderTreeNode 
* pNode=0x06e16f78, OSG::DrawEnv & denv={...}, OSG::RenderPartitionBase * 
part=0x048547b8)  Zeile 166     C++
        OSGSystemD.dll!OSG::TreeBuilderBase::drawNode(OSG::RenderTreeNode 
* pNode=0x067f2ee0, OSG::DrawEnv & denv={...}, OSG::RenderPartitionBase * 
part=0x048547b8)  Zeile 166     C++
        OSGSystemD.dll!OSG::TreeBuilderBase::drawNode(OSG::RenderTreeNode 
* pNode=0x06e16e78, OSG::DrawEnv & denv={...}, OSG::RenderPartitionBase * 
part=0x048547b8)  Zeile 166     C++
        OSGSystemD.dll!OSG::TreeBuilderBase::drawNode(OSG::RenderTreeNode 
* pNode=0x04851348, OSG::DrawEnv & denv={...}, OSG::RenderPartitionBase * 
part=0x048547b8)  Zeile 166     C++
        OSGSystemD.dll!OSG::TreeBuilderBase::draw(OSG::DrawEnv & 
denv={...}, OSG::RenderPartitionBase * part=0x048547b8)  Zeile 102 C++
        OSGSystemD.dll!OSG::RenderPartition::doExecution()  Zeile 483 + 
0x31 Bytes      C++
        OSGSystemD.dll!OSG::RenderAction::drawBuffer(unsigned int buf=0) 
Zeile 851       C++
        OSGSystemD.dll!OSG::RenderAction::stop(OSG::ActionBase::ResultE 
res=Continue)  Zeile 775        C++
        OSGSystemD.dll!OSG::Action::callStop(OSG::ActionBase::ResultE 
res=Continue)  Zeile 479 + 0x13 Bytes   C++
        OSGSystemD.dll!OSG::Action::apply(std::_Vector_iterator<OSG::Node 
*,std::allocator<OSG::Node *> > begin=0xfdfdfdfd {_sfVolume={...} 
_sfTravMask={...} _sfParent={...} ...}, std::_Vector_iterator<OSG::Node 
*,std::allocator<OSG::Node *> > end=0xfdfdfdfd {_sfVolume={...} 
_sfTravMask={...} _sfParent={...} ...})  Zeile 295 + 0xc Bytes  C++
        OSGSystemD.dll!OSG::Action::apply(OSG::Node * const 
node=0x04878b00)  Zeile 312 + 0x43 Bytes        C++
        OSGSystemD.dll!OSG::Viewport::render(OSG::RenderActionBase * 
action=0x04873848)  Zeile 367 + 0x18 Bytes      C++
 OSGSystemD.dll!OSG::Window::doRenderAllViewports(OSG::RenderActionBase * 
action=0x04873848)  Zeile 2178 + 0x21 Bytes     C++
        OSGSystemD.dll!OSG::Window::render(OSG::RenderActionBase * 
action=0x04873848)  Zeile 1898 + 0x16 Bytes     C++
        OSGUtilD.dll!OSG::SimpleSceneManager::redraw()  Zeile 883 + 0x27 
Bytes   C++
        DynamicLoad.exe!display()  Zeile 349 + 0x14 Bytes       C++


Thanks
Marc


void rotate(void *args)
{
    // sync this thread to the main thread, i.e. pull in all changes done
    // during scene construction
    syncBarrier->enter(2);
    applicationThread->getChangeList()->applyAndClear();
    syncBarrier->enter(2);

    // clear the local changelist as we only want to sync the
    // real changes we make back.
    OSG::commitChanges();
    animationThread->getChangeList()->clear();

    std::vector<std::string> file_list;
        std::string base_path = "D:\\Marc\\objects\\";
    std::ifstream file;
    file.open((base_path+"files.txt").c_str());
    while (!file.eof())
    {
        std::string line;
        std::getline(file, line);
                if (!line.empty())
                        file_list.push_back(line);
    }
    unsigned int file_index = 0;

        while (true)
        {
                // we won't stop calculating new matrices....
                while(true)
                {
                        if (file_index == file_list.size())
                                break;

                        std::string file_name = file_list[file_index];
                        std::cout << "Loading [" << file_name << "] - (" 
<< file_index << " / " << file_list.size() << ")\n" << std::flush;

                        file_index++;
                        NodeRecPtr new_node = 
SceneFileHandler::the()->read((base_path+file_name).c_str());
                        if (new_node)
                        {
                                scene->addChild(new_node);
                                OSG::commitChanges();
                                do_sync = true;
                                syncBarrier->enter(2);    // barrier (1)
                                syncBarrier->enter(2);    // barrier (2)
                        } 
                }

                while (scene->getNChildren() > 0)
                        scene->subChild((unsigned int)0);

                do_sync = true;
                syncBarrier->enter(2);    // barrier (1)
                syncBarrier->enter(2);    // barrier (2)

                file_index = 0;
        }
}
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to