OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Crash with VBO and shared context


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
jumaroch
Newbie


Joined: 11 Jun 2015
Posts: 9

PostPosted: Tue Jul 25, 2017 1:23 pm    Post subject:
Crash with VBO and shared context
Reply with quote

Hi,

We recently upgraded our application to OSG 3.4.0 and we are now getting a crash when deleting an osg::View instance.

Our application creates an additional view using a shared context with the main view. This view is displayed in a separated Qt dialog.
The crash occurred when this second view is deleted: the destruction of its osg::State deletes the GLExtensions instance associated to the context id.
The current VBOs that were initialized will make the application crash as soon as they are used since their internal GLExtensions instance is dead.

Is it a known limitation of OSG with MDI applications, i.e. one cannot delete a view that shares a context while the main view remains active ?

Would it be possible to add a test that check whether the graphics context is shared in osg::State destructor before deleting the associated GLExtensions instance ?

Cheers,
Romain
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11275

PostPosted: Tue Jul 25, 2017 3:01 pm    Post subject:
Crash with VBO and shared context
Reply with quote

Hi Romain,


I have just done a code review of OSG master and the 3.4 branch and spotted a fix to the osg::State destructor that avoids deleting the GLExtensions object when there still other graphics contexts using it.  I have merged and checked in this osg::State destructor fix into the OpenSceneGraph-3.4 branch.


Could you try out the OpenSceneGraph-3.4 branch or master and let us know if this resolved the bug for you.



Robert.


On 25 July 2017 at 14:23, Romain Roch < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi,

We recently upgraded our application to OSG 3.4.0 and we are now getting a crash when deleting an osg::View instance.

Our application creates an additional view using a shared context with the main view. This view is displayed in a separated Qt dialog.
The crash occurred when this second view is deleted: the destruction of its osg::State deletes the GLExtensions instance associated to the context id.
The current VBOs that were initialized will make the application crash as soon as they are used since their internal GLExtensions instance is dead.

Is it a known limitation of OSG with MDI applications, i.e. one cannot delete a view that shares a context while the main view remains active ?

Would it be possible to add a test that check whether the graphics context is shared in osg::State destructor before deleting the associated GLExtensions instance ?

Cheers,
Romain

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=71313#71313





_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
jumaroch
Newbie


Joined: 11 Jun 2015
Posts: 9

PostPosted: Tue Jul 25, 2017 4:42 pm    Post subject:
Reply with quote

Hi Robert

I did a test with the OpenSceneGraph-3.4 branch and it works like a charm ! Very Happy

Thank you!

Cheers,
Romain
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11275

PostPosted: Tue Jul 25, 2017 7:10 pm    Post subject:
Crash with VBO and shared context
Reply with quote

Good to hear it's now working fine.


On 25 July 2017 at 17:42, Romain Roch < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi Robert

I did a test with the OpenSceneGraph-3.4 branch and it works like a charm ! Very Happy

Thank you!

Cheers,
Romain

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=71316#71316





_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
jumaroch
Newbie


Joined: 11 Jun 2015
Posts: 9

PostPosted: Wed Jul 26, 2017 8:47 am    Post subject:
Reply with quote

Hi Robert,

I've encountered a crash with a different scenario (during view initialization).
The root cause is similar, and by looking at the master, it seems to have been fixed in the same commit (see State::initializeExtensionProcs, a GLExtension instance is systematically created and can replace an existing one). I did the test with this additional fix and it's working.
You probably should merge this part also in the 3.4 branch.

Cheers,
Romain
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11275

PostPosted: Wed Jul 26, 2017 10:17 am    Post subject:
Crash with VBO and shared context
Reply with quote

Hi Romain,

On 26 July 2017 at 09:47, Romain Roch < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
I've encountered a crash with a different scenario (during view initialization).
The root cause is similar, and by looking at the master, it seems to have been fixed in the same commit (see State::initializeExtensionProcs, a GLExtension instance is systematically created and can replace an existing one). I did the test with this additional fix and it's working.
You probably should merge this part also in the 3.4 branch.


I'm not clear which commit you are referring to - there have been lots of commits to State.cpp so a bit tedious to check through.


I've moved the State::initializeExtensionProcs() function in 3.4 to the same position in the State.cpp as the master version to make it easier to see diff's between them, and have changed the State::_glExtensions setting to be consistent with the one in master, hopefully this will be sufficient.


Could you let me know if these two commits to OpenSceneGraph-3.4 work fine?


Robet.


 

------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
jumaroch
Newbie


Joined: 11 Jun 2015
Posts: 9

PostPosted: Wed Jul 26, 2017 10:57 am    Post subject:
Reply with quote

Sorry Robert, I should have been more clear with my explanation...
The fix I was referring is the following:
Code:
_glExtensions = GLExtensions::Get(_contextID, true);

instead of:
Code:
_glExtensions = new GLExtensions(_contextID);
GLExtensions::Set(_contextID, _glExtensions.get());

which can replace and delete an existing instance of GLExtensions.

I looked at your last commit and I only see the function move, but not the modification of the State::_glExtensions initialization.

Cheers,
Romain
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11275

PostPosted: Wed Jul 26, 2017 11:06 am    Post subject:
Crash with VBO and shared context
Reply with quote

On 26 July 2017 at 11:57, Romain Roch < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Sorry Robert, I should have been more clear with my explanation...
The fix I was referring is the following:

Code:
_glExtensions = GLExtensions::Get(_contextID, true);


instead of:

Code:
_glExtensions = new GLExtensions(_contextID);
GLExtensions::Set(_contextID, _glExtensions.get());


which can replace and delete an existing instance of GLExtensions.

I looked at your last commit and I only see the function move, but not the modification of the State::_glExtensions initialization.


Ooops, I missed pushing the second commit, now done Smile


 

------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
jumaroch
Newbie


Joined: 11 Jun 2015
Posts: 9

PostPosted: Wed Jul 26, 2017 11:37 am    Post subject:
Reply with quote

Ok, I tested with your last commit and it works as expected Smile

By the way, do you know if there will be a 3.4.1 hotfix release soon ?

Thank you again,
Romain
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11275

PostPosted: Wed Jul 26, 2017 11:44 am    Post subject:
Crash with VBO and shared context
Reply with quote

On 26 July 2017 at 12:37, Romain Roch < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Ok, I tested with your last commit and it works as expected  Smile

By the way, do you know if there will be a 3.4.1  hotfix release soon ?


I would like to get a 3.4.1 out.  I haven't set a schedule for it, if we can get community testing across the range of platforms done then we could probably do it quite soon. 


Right now is probably not a bad time to push for testing and fixing of the 3.4 branch as I'm around this week and two days of next week and have mostly cleared my desk client work.  I'll do a call for testing.


Robert.

 
 

------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
jumaroch
Newbie


Joined: 11 Jun 2015
Posts: 9

PostPosted: Wed Jul 26, 2017 12:36 pm    Post subject:
Reply with quote

Thanks for your reply.
I will also try to do more tests in our application with the current 3.4 branch.

Romain
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Access to gl context psquare General 2 Fri Nov 10, 2017 1:32 pm View latest post
No new posts Draw thread per opengl context instea... BenM General 6 Thu Nov 09, 2017 2:23 pm View latest post
No new posts osg::Text::setBackdropType crash with... Carlo Lanzotti - DynaD... General 7 Wed Sep 20, 2017 2:40 pm View latest post
No new posts Fix for osg::Program crash Colin McDonald Submission 0 Mon Sep 11, 2017 4:43 pm View latest post
No new posts Reapply GL context arennuit General 2 Wed Aug 23, 2017 8:57 am View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP