Re: [osg-users] CompositeViewer::removeView crashes

2009-12-24 Thread Robert Osfield
Hi Nick,

Would it be possible to modify one of the existing OSG examples to add
a unit test for this problem.  Switching on a problem subgraph via an
command line option would be perfect.  Once others can recreate the
issue we'll be able to dig into why it's happening.

Cheers,
Robert.

On Thu, Dec 24, 2009 at 6:45 AM, Trajce Nikolov
 wrote:
> I had to setSceneData(0) before removing the view to make it work,. If you
> areintersted I can put a sample test case reproducing the problem
> Nick
>
> http://www.linkedin.com/in/tnick
>
>
> On Wed, Dec 23, 2009 at 8:47 PM, Trajce Nikolov 
> wrote:
>>
>> I figured out the conditions.
>> In the scene, I have a model that has cameras (pre-render) attached to
>> some portion of the models via textures. When I load that model, then it
>> hangs. Without this model, everything looks just fine
>> Nick
>>
>> http://www.linkedin.com/in/tnick
>>
>>
>> On Wed, Dec 23, 2009 at 7:23 PM, Trajce Nikolov 
>> wrote:
>>>
>>> here is the code snippet
>>> mLib->getViewer()->stopThreading();
>>> mLib->getViewer()->removeView(view);
>>> mLib->getViewer()->startThreading();
>>> it is called before viewer->frame()
>>> let me investigate this a bit more. I tried to reproduce the problem with
>>> osgcompositeviewer example, but there is works
>>>
>>> Nick
>>>
>>> http://www.linkedin.com/in/tnick
>>> Sent from Istanbul, 34, Turkey
>>>
>>> On Wed, Dec 23, 2009 at 6:47 PM, Robert Osfield
>>>  wrote:

 HI Nick,

 On Wed, Dec 23, 2009 at 4:27 PM, Trajce Nikolov
  wrote:
 > Hi Robert,
 > now it hangs at
 > // dispatch the rendering threads
 >     if (_startRenderingBarrier.valid())
 > _startRenderingBarrier->block();
 > the same method

 Is this during the the stopThreading() call?  After?  Have a look at
 what other threads are running to see where they have stopped.

 Robert.
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org

 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>>
>>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] CompositeViewer::removeView crashes

2009-12-23 Thread Trajce Nikolov
I had to setSceneData(0) before removing the view to make it work,. If you
areintersted I can put a sample test case reproducing the problem

Nick

http://www.linkedin.com/in/tnick


On Wed, Dec 23, 2009 at 8:47 PM, Trajce Nikolov wrote:

> I figured out the conditions.
>
> In the scene, I have a model that has cameras (pre-render) attached to some
> portion of the models via textures. When I load that model, then it hangs.
> Without this model, everything looks just fine
>
> Nick
>
> http://www.linkedin.com/in/tnick
>
>
> On Wed, Dec 23, 2009 at 7:23 PM, Trajce Nikolov 
> wrote:
>
>> here is the code snippet
>>
>> mLib->getViewer()->stopThreading();
>> mLib->getViewer()->removeView(view);
>> mLib->getViewer()->startThreading();
>>
>> it is called before viewer->frame()
>>
>> let me investigate this a bit more. I tried to reproduce the problem with
>> osgcompositeviewer example, but there is works
>>
>>
>> Nick
>>
>> http://www.linkedin.com/in/tnick
>> Sent from Istanbul, 34, Turkey
>>
>> On Wed, Dec 23, 2009 at 6:47 PM, Robert Osfield > > wrote:
>>
>>> HI Nick,
>>>
>>> On Wed, Dec 23, 2009 at 4:27 PM, Trajce Nikolov
>>>  wrote:
>>> > Hi Robert,
>>> > now it hangs at
>>> > // dispatch the rendering threads
>>> > if (_startRenderingBarrier.valid())
>>> _startRenderingBarrier->block();
>>> > the same method
>>>
>>> Is this during the the stopThreading() call?  After?  Have a look at
>>> what other threads are running to see where they have stopped.
>>>
>>> Robert.
>>> ___
>>> osg-users mailing list
>>> osg-users@lists.openscenegraph.org
>>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>>
>>
>>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] CompositeViewer::removeView crashes

2009-12-23 Thread Trajce Nikolov
I figured out the conditions.

In the scene, I have a model that has cameras (pre-render) attached to some
portion of the models via textures. When I load that model, then it hangs.
Without this model, everything looks just fine

Nick

http://www.linkedin.com/in/tnick


On Wed, Dec 23, 2009 at 7:23 PM, Trajce Nikolov wrote:

> here is the code snippet
>
> mLib->getViewer()->stopThreading();
> mLib->getViewer()->removeView(view);
> mLib->getViewer()->startThreading();
>
> it is called before viewer->frame()
>
> let me investigate this a bit more. I tried to reproduce the problem with
> osgcompositeviewer example, but there is works
>
>
> Nick
>
> http://www.linkedin.com/in/tnick
> Sent from Istanbul, 34, Turkey
>
> On Wed, Dec 23, 2009 at 6:47 PM, Robert Osfield 
> wrote:
>
>> HI Nick,
>>
>> On Wed, Dec 23, 2009 at 4:27 PM, Trajce Nikolov
>>  wrote:
>> > Hi Robert,
>> > now it hangs at
>> > // dispatch the rendering threads
>> > if (_startRenderingBarrier.valid()) _startRenderingBarrier->block();
>> > the same method
>>
>> Is this during the the stopThreading() call?  After?  Have a look at
>> what other threads are running to see where they have stopped.
>>
>> Robert.
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] CompositeViewer::removeView crashes

2009-12-23 Thread Trajce Nikolov
here is the code snippet

mLib->getViewer()->stopThreading();
mLib->getViewer()->removeView(view);
mLib->getViewer()->startThreading();

it is called before viewer->frame()

let me investigate this a bit more. I tried to reproduce the problem with
osgcompositeviewer example, but there is works


Nick

http://www.linkedin.com/in/tnick
Sent from Istanbul, 34, Turkey

On Wed, Dec 23, 2009 at 6:47 PM, Robert Osfield wrote:

> HI Nick,
>
> On Wed, Dec 23, 2009 at 4:27 PM, Trajce Nikolov
>  wrote:
> > Hi Robert,
> > now it hangs at
> > // dispatch the rendering threads
> > if (_startRenderingBarrier.valid()) _startRenderingBarrier->block();
> > the same method
>
> Is this during the the stopThreading() call?  After?  Have a look at
> what other threads are running to see where they have stopped.
>
> Robert.
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] CompositeViewer::removeView crashes

2009-12-23 Thread Robert Osfield
HI Nick,

On Wed, Dec 23, 2009 at 4:27 PM, Trajce Nikolov
 wrote:
> Hi Robert,
> now it hangs at
> // dispatch the rendering threads
>     if (_startRenderingBarrier.valid()) _startRenderingBarrier->block();
> the same method

Is this during the the stopThreading() call?  After?  Have a look at
what other threads are running to see where they have stopped.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] CompositeViewer::removeView crashes

2009-12-23 Thread Trajce Nikolov
Hi Robert,

now it hangs at
// dispatch the rendering threads
if (_startRenderingBarrier.valid()) _startRenderingBarrier->block();

the same method

Nick

http://www.linkedin.com/in/tnick
Sent from Istanbul, 34, Turkey

On Wed, Dec 23, 2009 at 6:04 PM, Robert Osfield wrote:

> Hi Nick,
>
> Try calling stopThreading() before you remove the view, and
> startThreading() after you've done it.
>
> Robert.
>
> On Wed, Dec 23, 2009 at 3:46 PM, Trajce Nikolov
>  wrote:
> > Hi Robert,
> > now I did it outside frame. Id doesnt crash anymore ... but, it hangs at
> > _endDynamicDrawBlock->block();
> > void ViewerBase::renderingTraversals()
> > after view removal
> > I have composite viewer
> >
> with 
> setThreadingModel(osgViewer::CompositeViewer::CullThreadPerCameraDrawThreadPerContext);
> > any ideas ?
> > Nick
> >
> > http://www.linkedin.com/in/tnick
> > Sent from Istanbul, 34, Turkey
> >
> > On Wed, Dec 23, 2009 at 3:14 PM, Robert Osfield <
> robert.osfi...@gmail.com>
> > wrote:
> >>
> >> Hi Nick,
> >>
> >> How are you removing the view?  From an event handler from within the
> >> view?  If so then this will crash as you'll be deleting the object you
> >> are doing the work from.
> >>
> >> The right way remove a view is outside of frame().
> >>
> >> Robert.
> >>
> >> On Wed, Dec 23, 2009 at 12:56 PM, Trajce Nikolov
> >>  wrote:
> >> > here is the call stack
> >> >
> >> >
> >> >
> osg62-osgViewerd.dll!std::list,std::allocator
> >> >> >::begin()  Line 528 + 0x13 bytes C++
> >> >> osg62-osgViewerd.dll!osgViewer::CompositeViewer::eventTraversal()
>  Line
> >> >> 990 + 0x19 bytes C++
> >> >   osg62-osgViewerd.dll!osgViewer::ViewerBase::frame(double
> >> > simulationTime=1.7976931348623157e+308)  Line 637 + 0xf bytes C++
> >> >   KtIGLibOSGD.dll!RunThread::run()  Line 11 C++
> >> >
> >> > for(ViewEventsMap::iterator veitr = viewEventsMap.begin();
> >> > veitr != viewEventsMap.end();
> >> > ++veitr)
> >> > {
> >> > View* view = veitr->first;
> >> > for(osgGA::EventQueue::Events::iterator itr =
> >> > veitr->second.begin();
> >> > itr != veitr->second.end();
> >> > ++itr)
> >> > {
> >> > osgGA::GUIEventAdapter* event = itr->get();
> >> > for(View::EventHandlers::iterator hitr =
> >> > view->getEventHandlers().begin();
> >> > hitr != view->getEventHandlers().end();
> >> > ++hitr)
> >> > {
> >> >
>  (*hitr)->handleWithCheckAgainstIgnoreHandledEventsMask(
> >> > *event, *view, 0, 0);
> >> > }
> >> > }
> >> > }
> >> > crashes on line 997
> >> > Nick
> >> >
> >> > http://www.linkedin.com/in/tnick
> >> >
> >> > ___
> >> > osg-users mailing list
> >> > osg-users@lists.openscenegraph.org
> >> >
> >> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >> >
> >> >
> >> ___
> >> osg-users mailing list
> >> osg-users@lists.openscenegraph.org
> >>
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> >
> > ___
> > osg-users mailing list
> > osg-users@lists.openscenegraph.org
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> >
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] CompositeViewer::removeView crashes

2009-12-23 Thread Robert Osfield
Hi Nick,

Try calling stopThreading() before you remove the view, and
startThreading() after you've done it.

Robert.

On Wed, Dec 23, 2009 at 3:46 PM, Trajce Nikolov
 wrote:
> Hi Robert,
> now I did it outside frame. Id doesnt crash anymore ... but, it hangs at
> _endDynamicDrawBlock->block();
> void ViewerBase::renderingTraversals()
> after view removal
> I have composite viewer
> with setThreadingModel(osgViewer::CompositeViewer::CullThreadPerCameraDrawThreadPerContext);
> any ideas ?
> Nick
>
> http://www.linkedin.com/in/tnick
> Sent from Istanbul, 34, Turkey
>
> On Wed, Dec 23, 2009 at 3:14 PM, Robert Osfield 
> wrote:
>>
>> Hi Nick,
>>
>> How are you removing the view?  From an event handler from within the
>> view?  If so then this will crash as you'll be deleting the object you
>> are doing the work from.
>>
>> The right way remove a view is outside of frame().
>>
>> Robert.
>>
>> On Wed, Dec 23, 2009 at 12:56 PM, Trajce Nikolov
>>  wrote:
>> > here is the call stack
>> >
>> >
>> > osg62-osgViewerd.dll!std::list,std::allocator
>> >> >::begin()  Line 528 + 0x13 bytes C++
>> >> osg62-osgViewerd.dll!osgViewer::CompositeViewer::eventTraversal()  Line
>> >> 990 + 0x19 bytes C++
>> >   osg62-osgViewerd.dll!osgViewer::ViewerBase::frame(double
>> > simulationTime=1.7976931348623157e+308)  Line 637 + 0xf bytes C++
>> >   KtIGLibOSGD.dll!RunThread::run()  Line 11 C++
>> >
>> > for(ViewEventsMap::iterator veitr = viewEventsMap.begin();
>> >         veitr != viewEventsMap.end();
>> >         ++veitr)
>> >     {
>> >         View* view = veitr->first;
>> >         for(osgGA::EventQueue::Events::iterator itr =
>> > veitr->second.begin();
>> >             itr != veitr->second.end();
>> >             ++itr)
>> >         {
>> >             osgGA::GUIEventAdapter* event = itr->get();
>> >             for(View::EventHandlers::iterator hitr =
>> > view->getEventHandlers().begin();
>> >                 hitr != view->getEventHandlers().end();
>> >                 ++hitr)
>> >             {
>> >                 (*hitr)->handleWithCheckAgainstIgnoreHandledEventsMask(
>> > *event, *view, 0, 0);
>> >             }
>> >         }
>> >     }
>> > crashes on line 997
>> > Nick
>> >
>> > http://www.linkedin.com/in/tnick
>> >
>> > ___
>> > osg-users mailing list
>> > osg-users@lists.openscenegraph.org
>> >
>> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>> >
>> >
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] CompositeViewer::removeView crashes

2009-12-23 Thread Trajce Nikolov
Hi Robert,

now I did it outside frame. Id doesnt crash anymore ... but, it hangs at

_endDynamicDrawBlock->block();
void ViewerBase::renderingTraversals()

after view removal

I have composite viewer
with 
setThreadingModel(osgViewer::CompositeViewer::CullThreadPerCameraDrawThreadPerContext);

any ideas ?

Nick

http://www.linkedin.com/in/tnick
Sent from Istanbul, 34, Turkey

On Wed, Dec 23, 2009 at 3:14 PM, Robert Osfield wrote:

> Hi Nick,
>
> How are you removing the view?  From an event handler from within the
> view?  If so then this will crash as you'll be deleting the object you
> are doing the work from.
>
> The right way remove a view is outside of frame().
>
> Robert.
>
> On Wed, Dec 23, 2009 at 12:56 PM, Trajce Nikolov
>  wrote:
> > here is the call stack
> >
> >
> osg62-osgViewerd.dll!std::list,std::allocator
> >> >::begin()  Line 528 + 0x13 bytes C++
> >> osg62-osgViewerd.dll!osgViewer::CompositeViewer::eventTraversal()  Line
> >> 990 + 0x19 bytes C++
> >   osg62-osgViewerd.dll!osgViewer::ViewerBase::frame(double
> > simulationTime=1.7976931348623157e+308)  Line 637 + 0xf bytes C++
> >   KtIGLibOSGD.dll!RunThread::run()  Line 11 C++
> >
> > for(ViewEventsMap::iterator veitr = viewEventsMap.begin();
> > veitr != viewEventsMap.end();
> > ++veitr)
> > {
> > View* view = veitr->first;
> > for(osgGA::EventQueue::Events::iterator itr =
> veitr->second.begin();
> > itr != veitr->second.end();
> > ++itr)
> > {
> > osgGA::GUIEventAdapter* event = itr->get();
> > for(View::EventHandlers::iterator hitr =
> > view->getEventHandlers().begin();
> > hitr != view->getEventHandlers().end();
> > ++hitr)
> > {
> > (*hitr)->handleWithCheckAgainstIgnoreHandledEventsMask(
> > *event, *view, 0, 0);
> > }
> > }
> > }
> > crashes on line 997
> > Nick
> >
> > http://www.linkedin.com/in/tnick
> >
> > ___
> > osg-users mailing list
> > osg-users@lists.openscenegraph.org
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> >
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] CompositeViewer::removeView crashes

2009-12-23 Thread Robert Osfield
Hi Nick,

How are you removing the view?  From an event handler from within the
view?  If so then this will crash as you'll be deleting the object you
are doing the work from.

The right way remove a view is outside of frame().

Robert.

On Wed, Dec 23, 2009 at 12:56 PM, Trajce Nikolov
 wrote:
> here is the call stack
>
> osg62-osgViewerd.dll!std::list,std::allocator
>> >::begin()  Line 528 + 0x13 bytes C++
>> osg62-osgViewerd.dll!osgViewer::CompositeViewer::eventTraversal()  Line
>> 990 + 0x19 bytes C++
>   osg62-osgViewerd.dll!osgViewer::ViewerBase::frame(double
> simulationTime=1.7976931348623157e+308)  Line 637 + 0xf bytes C++
>   KtIGLibOSGD.dll!RunThread::run()  Line 11 C++
>
> for(ViewEventsMap::iterator veitr = viewEventsMap.begin();
>         veitr != viewEventsMap.end();
>         ++veitr)
>     {
>         View* view = veitr->first;
>         for(osgGA::EventQueue::Events::iterator itr = veitr->second.begin();
>             itr != veitr->second.end();
>             ++itr)
>         {
>             osgGA::GUIEventAdapter* event = itr->get();
>             for(View::EventHandlers::iterator hitr =
> view->getEventHandlers().begin();
>                 hitr != view->getEventHandlers().end();
>                 ++hitr)
>             {
>                 (*hitr)->handleWithCheckAgainstIgnoreHandledEventsMask(
> *event, *view, 0, 0);
>             }
>         }
>     }
> crashes on line 997
> Nick
>
> http://www.linkedin.com/in/tnick
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org