Newly built plugin crashed on Ogre 1.2.3 with Code::Blocks

xathria

14-11-2006 12:59:56

Dear friends,

I tried to build Plugin_PLSM2 yesterday using CodeBlocks after downloading the cvs version a few days ago (November 12th).

Since I was using [Ogre 1.2.3 with Code::Blocks + MinGW C++ Toolbox], I had to delete :
  1. [$(OGRE_HOME)\stlport\stlport] from [Build Options -> Plugin_PagingLandScapeSceneManager -> Directories -> Compiler][/*:m]
  2. [stlport.5.0] from [Build Options -> Plugin_PagingLandScapeSceneManager -> Release -> Linker][/*:m][/list:u]The compilation works perfectly aside from several warnings about typecasting. There are one warning about redefinition of on filetutils.cpp from the previous one on [MinGW\include\sys\stat.h], however.

    At this point, the Plugin_PagingLandScapeSceneManager2.dll was successfully created, but the post-build copy to [..\..\..\Samples\Common\bin\Release] failed, so I copied it manually to the specified folder.

    Then, I copied the following files to my [$(OGRE_HOME)\bin\release] folder and overwrote any existing files:
    1. Plugin_PagingLandScapeSceneManager2.dll[/*:m]
    2. libnoise.dll[/*:m]
    3. IPLSceneManager.cfg[/*:m]
    4. paginglandscape2.cfg[/*:m]
    5. Plugins.cfg[/*:m]
    6. Plugins_plsm2.cfg[/*:m]
    7. resources.cfg[/*:m]
    8. resources_plsm2.cfg[/*:m][/list:u]According to resources.cfg, I had to put several folders including the one from datasrc.zip to the [$(OGRE_HOME)\media\paginglandscape2] folder, so I did that. I also changed the path so it points to the correct Media folder.

      And then, I created a simple test program [here] to load the scene manager. The test program is just an ordinary SampleApp based on the default OGRE template. I just override the [chooseSceneManager()] method with the one found on PagingLandScape2Application.h, and build them.

      All runs well up to this point. When I run the test program, it crashed and gave the "don't send" message box. When I viewed the error report, it just said that [ModName:plugin_paginglandscapescenemanager2.dll] had caused the crash. No plsm2.log had been created, and the Ogre.log doesn't shows no error at all. The ogre.log could be viewed [here].

      I had been struggling with this problem for the past week and had exhausted every visible (at least for me :p) options. I had explored the Paging Landscape SceneManager category on this forum up to the last year's posts but found no thread that could help me on my problem. I had tried to compile the plugin on OgreSDK 1.2.2 + MinGW w/ stlport + CodeBlocks but found the same error message.

      Oh, and when I tried to read the plugin's metadata, the description and name of the PLSM2 plugin shows up prefectly before the program crashed.

      Are there anybody out there that had successfully built and used the plugin using [Ogre 1.2.3 with Code::Blocks + MinGW C++ Toolbox]? I am only too happy to provide more information about the crash. :D


      Btw, when I tried to build the MapSplitter, the compilation failed on MapEqualizer.cpp line 919:#ifdef _WIN32
      _fpreset(); // Bug in CRandom! Causes messed up floating point operations!
      #endif

      I tried to comment the line and the build&run succeeds. The mapsplitter.log could be found [here].

tuan kuranes

29-11-2006 15:36:00

any way to use some debugger to find where it does segfault ?
Did you try compiling the demo that comes with PLSM2 ?

Princess_Conecloon

08-12-2006 07:17:08

The same thing is happening to me. I compiled PLSM2 the same way as mentioned above as well as the MapSplitter and the Demo. The dll compiled, but failed to copy as well as the MapSplitter. After some work, I got the Demo to run, but is blank since the MapSplitter won't run. Everything goes fine until this line (317, MapUtil.cpp):


try
{
ResourceGroupManager::getSingletonPtr()->addResourceLocation("./2","FileSystem", "PLSM2");
}
catch (Ogre::Exception& e)
{
String error = e.getFullDescription();
//..
}


If I comment that code out, Ogre throws an Unknown exception. If I leave it in, the folder ./2 (which I created in the MapSplitter.exe folder) is added and then the program just ends without error. If I delete the '2' folder, I get an error:


-----------------------------------
Details:
-----------------------------------
Error #: 8
Function: FileSystemArchive::changeDirectory
Description: Cannot open requested directory ./2.
File: ..\src\OgreFileSystem.cpp
Line: 141
Stack unwinding: <<beginning of stack>>


I'm not sure what else to do.

tuan kuranes

09-12-2006 13:01:53

where that code comes from SDK, CVS ?
that should be commented indeed, if not removed.
the error should anyway not be blocking as it's inside an exception.

mapsplitter doesn't split any map ?

Princess_Conecloon

09-12-2006 15:03:53

It's from CVS and when I remove that code, only an unknown error is returned. The MapSplitter does not split any map and crashes just after loading in all the resources. Also, I tried running it through the debugger built into codeblocks, but sonce the program catches the error, no segfault is returned. For a start, I am going to get rid of that piece of code and continue to work from there to see if I can get anything going.

EDIT:
Ok, it seems that the error is caused here:

mOptions->load(String("maptool.cfg"));


Which seems to be a problem in another thread. I took a look at the paginglandscapeoptions load method and can't see what is going wrong.

Princess_Conecloon

10-12-2006 23:26:09

Been working on this all day and finally got an error out of it :)


#0 70DAAFFC ZNKSt8_Rb_treeItSt4pairIKtPSt3mapItPN4Ogre9TechniqueESt4lessItESaIS0_IS1_S5_EEEESt10_Select1stISC_ES7_SaISC_EE4findERS1_() (C:\Ogre\ogrenew\Samples\Common\bin\Release\OgreMain.dll:??)

#1 70B26593 ZN4Ogre20FileStreamDataStream4readEPvj() (C:\Ogre\ogrenew\Samples\Common\bin\Release\OgreMain.dll:??)

#2 70B29BD4 ZN4Ogre10DataStream7getLineEb() (C:\Ogre\ogrenew\Samples\Common\bin\Release\OgreMain.dll:??)

#3 70B2149F ZN4Ogre10ConfigFile4loadERKNS_9SharedPtrINS_10DataStreamEEERKSsb() (C:\Ogre\ogrenew\Samples\Common\bin\Release\OgreMain.dll:??)

#4 004265C6 Ogre::PagingLandScapeOptions::load() (??:??)

#5 004284D4 Ogre::PagingLandScapeOptions::load() (??:??)

#6 0045015F Ogre::MapUtil::Load() (??:??)

#7 004431E1 main() (??:??)


Any ideas??

tuan kuranes

14-12-2006 13:54:48

I find the error in CVS and fixed it. Problem was about using cfg file directly instead of "resource" cfg files. As here, I didn't use that configuration I could'nt reproduce the bug. Test with latest CVS

Princess_Conecloon

14-12-2006 18:08:49

Yeah, that did it! Compiles fine and runs perfectly. Thanks a lot :D