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 

OpenThreads Mutex::lock() crash


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


Joined: 13 Feb 2009
Posts: 102

PostPosted: Thu Jul 12, 2018 6:50 pm    Post subject:
OpenThreads Mutex::lock() crash
Reply with quote

Hi,

Has anyone experienced issues with OpenThreads Mutext::lock()? Occasionally a crash occurs when starting my application but only if the threading model is not SingleThreaded. The crash occurs in the following functions of OpenThreads:

Code:

int Mutex::lock() {
    Win32MutexPrivateData *pd =
        static_cast<Win32MutexPrivateData*>(_prvData);

#ifdef USE_CRITICAL_SECTION

    // Block until we can take this lock.
    EnterCriticalSection( &(pd->_cs) );

    return 0;

#else
[...]
#endif
}


What I noticed is that sometimes "pd" is 0 eventhough "_prvData" is not 0!! I can't understand how that can occur unless there's a concurency issue. As a test, I added a sanity check after initializing the "pb" local variable, as follows:

Code:

    while( pd == 0 )
    {
        Sleep( 10 ); // sleep for 10ms and try again...
        pd = static_cast<Win32MutexPrivateData*>(_prvData);
    }


I know it's dumb... but it works. I've been chasing this problem for a long time now and I haven't found a solution yet (except my dumb one).

This issue occurs with v3.4.0 and v3.6.2. The crash occurs on Win7 and Win10 when build with VS2013.

Any help on this topic would be much appreciated.


Thank you!

Cheers,
Guy
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 Memory not being released, causing crash Juanelm General 1 Thu May 16, 2019 10:15 pm View latest post
No new posts Rendering stats crash on FreeBSD with... Michael Danilov General 0 Sat Dec 22, 2018 2:15 am View latest post
No new posts osgText crash with multiple Viewers ravidavi General 3 Tue Dec 18, 2018 8:50 am View latest post
No new posts osgText 3.6.3 crash Trajce Nikolov NICK General 2 Wed Sep 12, 2018 12:25 pm View latest post
No new posts Crash when using LineSegmentIntersector sbrkopac General 5 Thu Aug 02, 2018 10:03 pm 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