Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


I can compile it, but it crashes...
Urkle Offline
FG - Associate

Posts: 1,172
Threads: 31
Joined: Jul 2006
Reputation: 21
#11
RE: I can compile it, but it crashes...

Hmmm. I'll have to look more at is one. Or just add a breakpoint and walk through it to see what is going on..

Developing away on one of
Multiple Macs running 10.6, 10.7, 10.8, and 10.9.
Linux, 8-core AMD, 8GB RAM, Fedora 18, nVidia 450 1GB
05-16-2010, 09:36 PM
Website Find
MulleDK19 Offline
Senior Member

Posts: 545
Threads: 21
Joined: Jun 2009
Reputation: 10
#12
RE: I can compile it, but it crashes...

(05-16-2010, 09:36 PM)Urkle Wrote: Hmmm. I'll have to look more at is one. Or just add a breakpoint and walk through it to see what is going on..

Ya, I tried that... I have no idea what's going on.


Edit: I fixed it by adding a break; when it has removed the body it was looking for. Perhaps the exception is due to the list being changed, while iterating (due to the erase()). At least it works now.

Anyhow, shouldn't there really be a break;? From what I can figure, DestroyBody() removes one body, right? So after finding it, there's no need to iterate the rest?


After getting off the boat and down through the hatch, I get another violation xD

C:\Programmer\Microsoft Visual Studio 9.0\VC\crt\src\dbghook.c:65

Call-stack:
Quote:> msvcr90.dll!_crt_debugger_hook(int _Reserved=5) Line 65 C
msvcr90.dll!_invalid_parameter(const wchar_t * pszExpression=0x00000000, const wchar_t * pszFunction=0x00000000, const wchar_t * pszFile=0x00000000, unsigned int nLine=0, unsigned int pReserved=0) Line 112 + 0x7 bytes C++
msvcr90.dll!_invalid_parameter_noinfo() Line 125 + 0xc bytes C++
Penumbra.exe!hpl::cMeshLoaderCollada::AddSectorChildren(hpl::cColladaNode * apNode=0x095be570, std::basic_string<char,std::char_traits<char>,std::allocator<char> > asSector="ENTRANCE", hpl::cWorld3D * apWorld=0x05b6ed68, std::vector<hpl::cColladaGeometry,std::allocator<hpl::cColladaGeometry> > & avColladaGeometries=[122]({msId="_start_link0Shape1-lib" msName="_start_link0Shape1" mvVertexVec=[24]({pos={...} tex={...} tan={...} ...},{pos={...} tex={...} tan={...} ...},{pos={...} tex={...} tan={...} ...},{pos={...} tex={...} tan={...} ...},{pos={...} tex={...} tan={...} ...},{pos={...} tex={...} tan={...} ...},{pos={...} tex={...} tan={...} ...},{pos={...} tex={...} tan={...} ...},{pos={...} tex={...} tan= .. ,...,...), std::vector<hpl::cColladaLight,std::allocator<hpl::cColladaLight> > & avColladaLights=[3]({msId="pointLightShape3-lib" msName="pointLightShape3" msType="point" ...},{msId="pointLightShape2-lib" msName="pointLightShape2" msType="point" ...},{msId="entrance_spotlight_spShape1-lib" msName="entrance_spotlight_spShape1" msType="spot" ...}), std::vector<hpl::cColladaMaterial,std::allocator<hpl::cColladaMaterial> > & avColladaMaterials=[31]({msId="text_start" msName="text_start" msTexture="#text_start-fx" ...},{msId="lambert2" msName="lambert2" msTexture="#lambert2-fx" ...},{msId="lambert1" msName="lambert1" msTexture="#lambert1-fx" ...},{msId="lambert4" msName="lambert4" msTexture="#lambert4-fx" ...},{msId="portal_text" msName="portal_text" msTexture="#portal_text-fx" ...},{msId="lambert3" msName="lambert3" msTexture="#lambert ,...), std::vector<hpl::cColladaTexture,std::allocator<hpl::cColladaTexture> > & avColladaTextures=[31]({msId="text_start-fx" msName="" msImage="file69-image" },{msId="lambert2-fx" msName="" msImage="file1-image" },{msId="lambert1-fx" msName="" msImage="mine_metaldoor_file1-image" },{msId="lambert4-fx" msName="" msImage="file3-image" },{msId="portal_text-fx" msName="" msImage="file38-image" },{msId="lambert3-fx" msName="" msImage="file2-image" },{msId="camera_text-fx" msName="" msImage="" },...,...), std::vector<hpl::cColladaImage,std::allocator<hpl::cColladaImage> > & avColladaImages=[29]({msId="file69-image" msName="file69" msSource="StartLocator.tga" },{msId="file1-image" msName="file1" msSource="mine_rock.jpg" },{msId="mine_metaldoor_file1-image" msName="mine_metaldoor_file1" msSource="door_metaldoor.jpg" },{msId="file3-image" msName="file3" msSource="mine_ground01.jpg" },{msId="file38-image" msName="file38" msSource="PortalMarker.jpg" },{msId="file2-image" msName="file2" m,...)) Line 2362 + 0xf bytes C++
Penumbra.exe!hpl::cMeshLoaderCollada::LoadWorld(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & asFile="maps/level01_02_mine_entrance.dae", hpl::cScene * apScene=0x0141b6e0, unsigned int aFlags=0) Line 172 + 0x5d bytes C++
Penumbra.exe!hpl::cMeshLoaderHandler::LoadWorld(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & asFile="maps/level01_02_mine_entrance.dae", unsigned int aFlags=0) Line 120 + 0x17 bytes C++
Penumbra.exe!hpl::cScene::LoadWorld3D(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & asFile="level01_02_mine_entrance.dae", bool abLoadScript=true, unsigned int aFlags=0) Line 404 + 0x1b bytes C++
Penumbra.exe!cMapHandler::Load(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & asFile="level01_02_mine_entrance.dae", const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & asStartPos="link01") Line 443 + 0x16 bytes C++
Penumbra.exe!cMapHandler::Update(float afTimeStep=0.016666666) Line 1424 C++
Penumbra.exe!hpl::cUpdater::Update(float afTimeStep=0.016666666) Line 213 + 0x27 bytes C++
Penumbra.exe!hpl::cGame::Run() Line 380 C++

[Image: 16455.png]
05-17-2010, 09:48 AM
Find
Urkle Offline
FG - Associate

Posts: 1,172
Threads: 31
Joined: Jul 2006
Reputation: 21
#13
RE: I can compile it, but it crashes...

actually. what I meant by "break" was a breakpoint for debugging, not a break statement :-D

another option would be to rewrite the function like this..
void iPhysicsWorld::DestroyBody(iPhysicsBody* apBody)
{
    //STLFindAndDelete(mlstBodies, apBody);
    tPhysicsBodyListIt it = mlstBodies.begin();
    for(; it != mlstBodies.end();)
    {
        iPhysicsBody *pBody = *it;
        if(pBody == apBody)
        {
            if(mpWorld3D) mpWorld3D->GetPortalContainer()->RemoveEntity(pBody);
            pBody->Destroy();
            hplDelete(pBody);
            it = mlstBodies.erase(it);
        } else {
            ++it;
        }
    }
}

As for your other crash. Just stick a breakpoint (usually by clicking off on the left margin of the source editor) and run the game from VS, and step through to figure out where the NULL value is coming from.

Developing away on one of
Multiple Macs running 10.6, 10.7, 10.8, and 10.9.
Linux, 8-core AMD, 8GB RAM, Fedora 18, nVidia 450 1GB
05-17-2010, 02:20 PM
Website Find
MulleDK19 Offline
Senior Member

Posts: 545
Threads: 21
Joined: Jun 2009
Reputation: 10
#14
RE: I can compile it, but it crashes...

(05-17-2010, 02:20 PM)Urkle Wrote: actually. what I meant by "break" was a breakpoint for debugging, not a break statement :-D

Ya, I know what you meant xD

That's what I did, but I couldn't figure the problem.

But a break after it removes the body fixed the crash when removing bodies.



Edit: The new crash happens on line 2362 in MeshLoaderCollada:
while(apNode->msName[lStartChar+4+lDigits] != '_' && apNode->msName[7+lDigits] != 0) lDigits++;

[Image: 16455.png]
05-17-2010, 02:30 PM
Find
Urkle Offline
FG - Associate

Posts: 1,172
Threads: 31
Joined: Jul 2006
Reputation: 21
#15
RE: I can compile it, but it crashes...

I would check what apNode is.. make sure it's not NULL. if it is, then trace back to where apNode was created and see why it failed to be created.

Developing away on one of
Multiple Macs running 10.6, 10.7, 10.8, and 10.9.
Linux, 8-core AMD, 8GB RAM, Fedora 18, nVidia 450 1GB
05-17-2010, 02:45 PM
Website Find
MulleDK19 Offline
Senior Member

Posts: 545
Threads: 21
Joined: Jun 2009
Reputation: 10
#16
RE: I can compile it, but it crashes...

(05-17-2010, 02:45 PM)Urkle Wrote: I would check what apNode is.. make sure it's not NULL. if it is, then trace back to where apNode was created and see why it failed to be created.

Seems it's never null...

[Image: 16455.png]
05-17-2010, 03:26 PM
Find
nckomodo Offline
Junior Member

Posts: 18
Threads: 4
Joined: May 2010
Reputation: 0
#17
RE: I can compile it, but it crashes...

(05-17-2010, 02:20 PM)Urkle Wrote: actually. what I meant by "break" was a breakpoint for debugging, not a break statement :-D

another option would be to rewrite the function like this..
void iPhysicsWorld::DestroyBody(iPhysicsBody* apBody)
{
    //STLFindAndDelete(mlstBodies, apBody);
    tPhysicsBodyListIt it = mlstBodies.begin();
    for(; it != mlstBodies.end();)
    {
        iPhysicsBody *pBody = *it;
        if(pBody == apBody)
        {
            if(mpWorld3D) mpWorld3D->GetPortalContainer()->RemoveEntity(pBody);
            pBody->Destroy();
            hplDelete(pBody);
            it = mlstBodies.erase(it);
        } else {
            ++it;
        }
    }
}

As for your other crash. Just stick a breakpoint (usually by clicking off on the left margin of the source editor) and run the game from VS, and step through to figure out where the NULL value is coming from.
Hello, I had this same problem and modified the function as exampled, however I ran into another crash which appears to be caused by trying to delete the same body twice
I'm not entirely sure if the body was in the list twice or if the iteration failed to step to the next item(which would mean the item is still in the list)
(the VS debugger isnt being much help in this regard).
At any rate I stuck a break statement in and it seems to be working fine now, I am however concerned that this could cause a memory leak.
Any suggestions for a more proper fix or is it something I don't need to worry about? (I'm fairly new to C++ but not programming in general, so I'm just hacking away at the code seeing what I can learn)
(quick side note: I made the beef jerky poisoned!)
05-22-2010, 03:26 AM
Find
ricky Offline
Junior Member

Posts: 3
Threads: 1
Joined: May 2010
Reputation: 0
#18
RE: I can compile it, but it crashes...

Hullo,

I have got the damn thing to build and run in debug mode. There were a few instances of using reserve instead of resize when the elements were then going to be edited (instead of .push_back) and there were some other strange issues.

I can't remember how I fixed them, but you can view the changes on my github pages:

http://www.github.com/ricky26/HPL1Engine
http://www.github.com/ricky26/PenumbraOverture
05-23-2010, 01:12 PM
Find
MulleDK19 Offline
Senior Member

Posts: 545
Threads: 21
Joined: Jun 2009
Reputation: 10
#19
RE: I can compile it, but it crashes...

(05-23-2010, 01:12 PM)ricky Wrote: Hullo,

I have got the damn thing to build and run in debug mode. There were a few instances of using reserve instead of resize when the elements were then going to be edited (instead of .push_back) and there were some other strange issues.

I can't remember how I fixed them, but you can view the changes on my github pages:

http://www.github.com/ricky26/HPL1Engine
http://www.github.com/ricky26/PenumbraOverture

I get tons of unresolved externals from your PenumbraOverture source.
Quote:Error 1 error LNK2001: unresolved external symbol "public: void __thiscall hpl::cInput::AddAction(class hpl::iAction *)" (?AddAction@cInput@hpl@@QAEXPAViAction@2@@Z) ButtonHandler.obj Penumbra
Error 2 error LNK2001: unresolved external symbol "public: bool __thiscall hpl::cInput::IsTriggerd(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?IsTriggerd@cInput@hpl@@QAE_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) PlayerState_Misc.obj Penumbra
Lots more, but this forum treats my quote as more than 5 images... eh..?

[Image: 16455.png]
05-25-2010, 08:03 PM
Find
gameengineer Offline
Junior Member

Posts: 3
Threads: 0
Joined: Jun 2010
Reputation: 0
#20
RE: I can compile it, but it crashes...

Anybody get this compiler error?

Quote:fatal error C1007: unrecognized flag '-typedil' in 'p2'

Converted the projects to VS 2005. Had to create a VS project for OALWrapper but it does compile in both debug and release configurations.

HPL and OALWrapper projects finish compiling all sources successfully. The web doesn't have any useful answers yet.


EDIT: Ok I figured it out. This is the problem you have when you have 3 Visual Studio compilers installed side by side. Confused I compiled HPL and Prenumbra using VS 2005 projects but I created the OALWrapper using VS 2008. There was a conflict in cl.exe versions being called. Not a clue how the static library for OAWrapper can dictate which cl.exe gets invoked... I just created a new project in VS2005 for OALWrapper and all is well. Prenumbra did finally compile and link but I haven't run it yet. Doing that now...



Steve
06-09-2010, 09:32 PM
Find




Users browsing this thread: 1 Guest(s)