Wrecked Games
September 05, 2010, 03:47:33 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: We're just that awesome.
 
   Home   Help Search Members Login Register  
Pages: [1]
  Print  
Author Topic: [Solved] segfault on unloadPlugins  (Read 2177 times)
Ice
Regular
*
Posts: 21


View Profile
« on: January 03, 2008, 05:23:33 AM »

I'm using Ogre 1.4.3 and Plugin_TheoraVideoSystem (WindowsXP, mingw). Videoplugin works great,but my application crashes with segfault on exit. There is gdb report:
Code:
#0 00000000 ??() (??:??)

#1 65389F19 Ogre::Root::unloadPlugins(this=0x374bc80) (E:/OgreCVS/ogrenew/OgreMain/src/OgreRoot.cpp:835)

#2 65386F93 Ogre::Root::~Root(this=0x374bc80) (E:/OgreCVS/ogrenew/OgreMain/src/OgreRoot.cpp:276)

#3 00401D7C GameManager::~GameManager(this=0x3747e60) (D:/MyApp/src/GameManager.cpp:56)

#4 0040F4E0 WinMain(hInst=0x400000, strCmdLine=0x241efc "") (D:/MyApp/src/main.cpp:28)

#5 0042041A main() (C:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/iostream:77)

and part of Ogre.log:

Code:
...
17:12:51: Parsing script Shadows.overlay
17:12:51: Finished parsing scripts for resource group General
17:12:51: Parsing scripts for resource group Internal
17:12:51: Finished parsing scripts for resource group Internal
17:12:51: Creating viewport on target 'Test', rendering from camera 'IntroCamera', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
17:12:51: Viewport for camera 'IntroCamera', actual dimensions L: 0 T: 0 W: 1024 H: 768
17:12:51: Loading library FMOD_MOD
17:12:52: Vorbis Headers: 3 Theora Headers : 3
17:12:52: Texture: Europe.ogg: Loading 1 faces(PF_B8G8R8,352x240x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,352x240x1.
17:12:58: Unloading library FMOD_MOD
17:12:58: Unregistering ResourceManager for type BspLevel
17:12:58: *-*-* OGRE Shutdown
17:12:58: Unregistering ResourceManager for type Compositor
17:12:58: Unregistering ResourceManager for type Font
17:12:58: Unregistering ResourceManager for type Skeleton
17:12:58: Unregistering ResourceManager for type Mesh
17:12:58: Unregistering ResourceManager for type HighLevelGpuProgram

It seems that there is something wrong with my Plugin_TheoraVideoSystem.dll. What can cause this segfault? Could anyone upload debug and release version of this dll ?
« Last Edit: January 27, 2008, 10:48:52 AM by Ice » Logged
pjcast
Administrator
Veteran
*****
Posts: 2544



View Profile WWW
« Reply #1 on: January 03, 2008, 06:04:04 AM »

I couldn't say why it is segfaulting, likely you are still holding on to a movie reference. Are you using gdb on windows or linux? If on windows, I would suggest using VC8 Express, since it is easier to debug with that on windows.
Logged
Ice
Regular
*
Posts: 21


View Profile
« Reply #2 on: January 04, 2008, 03:04:51 AM »

Thx for fast reply  Smiley
Yes, I'm using gdb on windows (codeblocks + mingw + gdb).
I verified your suggestion by closing application right after initialisation (i.e. without using videoplugin)
Code:
void GameManager::startGame( GameState *gameState ) {
    mRoot = new Root();

    mIntroState = IntroState::getSingletonPtr();
    mMainMenuState  = MainMenuState::getSingletonPtr();
    mPlayState = PlayState::getSingletonPtr();

    mSoundManagerEx = new SoundManagerEx();
    mSoundManagerEx->Initialize();

    // Setup input
    mInputMgr = InputManager::getSingletonPtr();
    mInputMgr->initialise( mRenderWindow );
    mInputMgr->addKeyListener( this, "GameManager" );
    mInputMgr->addMouseListener( this, "GameManager" );

    // SHUTDOWN
bShutdown = true;

    // Main while-loop
    while( !bShutdown ) {
...
}
}

GameManager::~GameManager( void ) {
    // Clean up all the states
    while( !mStates.empty() ) {
        mStates.back()->exit();
        mStates.pop_back();
    }

    if( mInputMgr ) {
        delete mInputMgr;
        mInputMgr = 0;
    }

    if( mIntroState ) {
        delete mIntroState;
        mIntroState = 0;
    }

    if( mMainMenuState ) {
        delete mMainMenuState;
        mMainMenuState  = 0;
    }

    if( mPlayState ) {
        delete mPlayState;
        mPlayState = 0;
    }

    if( mRoot ) {
        delete mRoot;
        mRoot = 0;
    }
}
It makes no difference, still segfaulting.

I also noticed that this occurs only with specific Plugin_TheoraVideoSystem.dll. I have old "release" dll, it works ok - no segfaulting. But the problem is that I need "debug" dll  Smiley
« Last Edit: January 04, 2008, 03:36:51 AM by Ice » Logged
pjcast
Administrator
Veteran
*****
Posts: 2544



View Profile WWW
« Reply #3 on: January 04, 2008, 06:33:12 AM »

It is probably related to STL usage in debug mode. I've only seen troubles when using multiple libs under MinGW + Windows that make use of STL. Though, the callstack you posted seems incomplete in that it doesn't list any methods inside the plugin. I would guess that maybe you are mixing debug/release libs/dlss possibly?
Logged
Ice
Regular
*
Posts: 21


View Profile
« Reply #4 on: January 05, 2008, 02:18:57 AM »

First I tried to compile all stuff (ogg, vorbis, old theora, videoplugin) using MSVS scripts with CodeBlocks. So I compiled all this libraries in 2 versions - debug and release. Then I tried to compile it under msys using  ./configure+make+make install (the only way to compile libtheora-1.0beta2 with mingw). I suppose that in second case only release version of libs is compiled. But it doesn't matter because my app crashes even in release mode  Smiley
« Last Edit: January 05, 2008, 07:48:02 AM by Ice » Logged
Ice
Regular
*
Posts: 21


View Profile
« Reply #5 on: January 17, 2008, 01:18:52 AM »

I just wonder if anyone can send me "release" and "debug" dlls compiled with mingw + Ogre 1.4.5  Roll Eyes
Logged
Ice
Regular
*
Posts: 21


View Profile
« Reply #6 on: January 27, 2008, 10:48:19 AM »

Ok, the problem is solved now Grin
I just updated Ogre (to 1.4.6), ptypes (to 2.1.1), ogg (to 1.1.3), vorbis (to 1.2.0) and theora (to 1.0beta2). And then recompiled TheoraVideo from CVS. It works now.
Thx for help  Smiley
Logged
czaoth
Newbie
*
Posts: 2


View Profile
« Reply #7 on: February 27, 2008, 01:12:48 AM »

cegui o.5 can supported?
I compiled error.
CEGUIStaticImage.h not found.
Logged
Ice
Regular
*
Posts: 21


View Profile
« Reply #8 on: March 15, 2008, 02:02:28 AM »

yes, it is supported. but CVS should be updated with patch, which i sent to pjcast
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!