Frictional Games Forum (read-only)
I can compile it, but it crashes... - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Open Source Collaboration (https://www.frictionalgames.com/forum/forum-27.html)
+--- Forum: HPL1 Engine (https://www.frictionalgames.com/forum/forum-28.html)
+--- Thread: I can compile it, but it crashes... (/thread-3362.html)

Pages: 1 2


I can compile it, but it crashes... - MulleDK19 - 05-14-2010

So I got it all compiled, and got a Penumbra.exe, but it just crashes.

I copied it to my Penumbra: Overture game folder.




I don't really know what's wrong, or how I could possibly find out.



I had to ignore TaskKeyHook.lib though. Perhaps that's the problem? I have no idea what it is, or where to get it? It's not included in the source. Another deprecated Windows SDK library perhaps?

Edit: Oh... It's part of the HPL1Engine... TaskKeyHook.h


RE: I can compile it, but it crashes... - Urkle - 05-14-2010

game folder? or the redist folder? It needs to be in the same folder where the resources.cfg file is.

Also look at the hpl.log that is generated in the Game folder in your "Documents And Settings" folder.

All errors are only logged to the hpl.log :-D


RE: I can compile it, but it crashes... - MulleDK19 - 05-14-2010

(05-14-2010, 07:50 PM)Urkle Wrote: game folder? or the redist folder? It needs to be in the same folder where the resources.cfg file is.

Also look at the hpl.log that is generated in the Game folder in your "Documents And Settings" folder.

All errors are only logged to the hpl.log :-D

I'm placing it where the original Penumbra.exe is.

There's no log created...

I just launch the executable, and "Penumbra.exe has stopped working" pops up.

That's it.


Here's my executable: http://www.treesoft.dk/penumbra/Penumbra.zip


RE: I can compile it, but it crashes... - Urkle - 05-14-2010

I've removed the TaskKeyHook stuff as it wasn't even being used anymore.

Try building a debug build for windows and configuring Visual Studio to install and debug the binary to see where it crashes.


RE: I can compile it, but it crashes... - MulleDK19 - 05-14-2010

(05-14-2010, 08:21 PM)Urkle Wrote: I've removed the TaskKeyHook stuff as it wasn't even being used anymore.

Try building a debug build for windows and configuring Visual Studio to install and debug the binary to see where it crashes.

It crashes before it reaches
int hplMain(const tString& asCommandLine)

I placed a Sleep(10000); and it still crashes instantly.


Edit: I just compiled a debugging executable. It's failing in OAL_LoggerObject.cpp

In function
Code:
wstring BuildLogFilename ( const string& asFilename )
When it's returning... Access violation...


RE: I can compile it, but it crashes... - Urkle - 05-14-2010

OK.. That's odd.. Step through that function and see what is returning bad data. I've personally only tested the non-windows branch of that function..


RE: I can compile it, but it crashes... - Thomas - 05-14-2010

Might also be that the OALWrapper is not compiled correctly or something like that and that the function it tries to access does not exist.

Add all OALWrapper cpp files to the HPL1 project and build it that way (in case you are not already doing so).

Otherwise just do what Urkle said and try and nail it down. Might also wanna just do a sepperate project where u only try and run the OALWrapper.


RE: I can compile it, but it crashes... - MulleDK19 - 05-15-2010

(05-14-2010, 09:13 PM)Thomas Wrote: Add all OALWrapper cpp files to the HPL1 project and build it that way (in case you are not already doing so).

Still the same. hmm... I'll make a small video.

Edit: Nevermind... I included it in a copy project I then deleted... lol... It seems to work now... at least it executes code it didn't before.


Well, at least it launched... I got a black screen... Then a mouse, then a "LOADING" text, and then a crash.


Here's the log:
Quote:-------- THE HPL ENGINE LOG ------------

Creating Engine Modules
--------------------------------------------------------
Creating graphics module
Creating system module
Creating resource module
Creating input module
Creating sound module
Creating physics module
Creating ai module
Creating gui module
Creating haptic module
Creating scene module
--------------------------------------------------------

Initializing Resources Module
--------------------------------------------------------
Creating resource managers
Misc Creation
--------------------------------------------------------

Initializing Graphics Module
--------------------------------------------------------
Init low level graphics
Setting video mode: 800 x 600 - 32 bpp
Init Glee...OK
Setting up OpenGL
Max texture image units: 32
Max texture coord units: 8
Two sided stencil: 1
Vertex Buffer Object: 1
Anisotropic filtering: 1
Max Anisotropic degree: 16
Multisampling: 1
Vertex Program: 1
Fragment Program: 1
NV Register Combiners: 1
NV Register Combiners Stages: 8
ATI Fragment Shader: 0
Creating graphic systems
Creating Renderer2D
Renderer2D created
Creating Renderer3D
Load Renderer3D gpu programs:
Extrude
CG: 'ShadowExtrude_vp.cg' using profile: 'vp40'
CG: 'ShadowExtrude_fp.cg' using profile: 'fp40'
Diffuse Vertex
CG: 'Diffuse_Color_vp.cg' using profile: 'vp40'
Diffuse Fragment
CG: 'Diffuse_Color_fp.cg' using profile: 'fp40'
Fog
CG: 'Fog_Solid_vp.cg' using profile: 'vp40'
CG: 'Fog_Solid_fp.cg' using profile: 'fp40'
Creating fog textures: Solid Additive Alpha
CG: 'refract_vp.cg' using profile: 'vp40'
CG: 'refract_fp.cg' using profile: 'fp40'
CG: 'refract_special_fp.cg' using profile: 'fp40'
init sky box
Renderer3D created
Creating screen buffers size 800.000000 : 600.000000
Creating programs
CG: 'PostEffect_Blur_vp.cg' using profile: 'vp40'
CG: 'PostEffect_Blur_Rect_fp.cg' using profile: 'fp40'
CG: 'PostEffect_Blur_2D_fp.cg' using profile: 'fp40'
CG: 'PostEffect_Bloom_vp.cg' using profile: 'vp40'
CG: 'PostEffect_Bloom_fp.cg' using profile: 'fp40'
CG: 'PostEffect_Motion_vp.cg' using profile: 'vp40'
CG: 'PostEffect_Motion_fp.cg' using profile: 'fp40'
CG: 'PostEffect_DoF_vp.cg' using profile: 'vp40'
CG: 'PostEffect_DoF_fp.cg' using profile: 'fp40'
RendererPostEffects created
Adding engine materials
--------------------------------------------------------

Initializing Sound Module
--------------------------------------------------------
Initializing OpenAL.
Trying to open software device... Success!
Device name: Generic Software
Number of mono sources: 32
Vendor name: Creative Labs Inc.
Renderer: Software
OpenAL Version Supported: 1.1
EFX: 0
Output Devices:
Generic Hardware
Generic Software
--------------------------------------------------------

Initializing Game Module
--------------------------------------------------------
Adding engine updates
Initializing script functions
--------------------------------------------------------

User Initialization
--------------------------------------------------------
WARNING: Language entry 'EventKeyInNoPower' in category '01_10_small_shaft' already exists!
Initializing Penumbra: Overture
Version $Rev: 3013 $
Date $Date: 2010-02-06 22:45:08 +0000 $
Checking Supported Profiles
Profile CG_PROFILE_VP20 is supported
Profile CG_PROFILE_FP20 is supported
Profile CG_PROFILE_VP30 is supported
Profile CG_PROFILE_FP30 is supported
Profile CG_PROFILE_VP40 is supported
Profile CG_PROFILE_FP40 is supported
Profile CG_PROFILE_ARBVP1 is supported
Profile CG_PROFILE_ARBFP1 is supported
Profile CG_PROFILE_GLSLV is supported
Profile CG_PROFILE_GLSLF is supported
Profile CG_PROFILE_GLSLC is supported
Trying to load vertex program!
CG: 'Test' using profile: 'vp40'
Success!

Window's crash report:
Quote:Problem signature:
Problem Event Name: BEX
Application Name: Penumbra.exe
Application Version: 0.0.0.0
Application Timestamp: 4bee6e2d
Fault Module Name: MSVCR90.dll
Fault Module Version: 9.0.30729.4926
Fault Module Timestamp: 4a1743c1
Exception Offset: 0006c955
Exception Code: c0000417
Exception Data: 00000000
OS Version: 6.1.7600.2.0.0.256.4
Locale ID: 1030
Additional Information 1: b164
Additional Information 2: b16455ab78c8940c1f0d85ec24e984a8
Additional Information 3: 5dee
Additional Information 4: 5deea4f024be0715fdaf1965c5b7387a

Read our privacy statement online:
http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409

If the online privacy statement is not available, please read our privacy statement offline:
C:\Windows\system32\en-US\erofflps.txt



Edit: I've been trying to nail it down. It's apparently somewhere in
Code:
bool cInit::Init(tString asCommandLine)
In here
Code:
mpPlayer = hplNew( cPlayer,(this) );
When reaching line 1256 in MeshLoaderColladaLoader.cpp
Code:
cString::FloatStringToArray(&vRawData[0],pVecText->Value(),lSize * 3);

When I try to step over that line, I get this:
Quote:Microsoft Visual Studio C Runtime Library has detected a fatal error in Penumbra.exe.

Press Break to debug the program or Continue to terminate the program.

After some testing... It seems any reference to vRawData is causing the error. hmm...


Hmm... I fixed it by uncommenting the code just above instead... I guess that was the original code, which was then swapped with a more optimal solution?

Yup... At least I got to the main menu... I'm gonna do some testings...

Anyone got a way to fix it, so I don't have to use unoptimized code?


Edit: And crashes while loading a level Tongue

Edit: All fixed now Smile


Edit: Now it crashed... Mid-game Tongue

Hmm... My build is pretty unstable, lol.



I better find a way to fix the FloatStringToArray(); 'cause the lighting in my build is very poor, and it crashes randomly.


My compilations must be really bad... The random crashes I get is from
Code:
void iPhysicsWorld::DestroyBody(iPhysicsBody* apBody)
in PhysicsWorld.cpp

On this line (159):
Code:
for(; it != mlstBodies.end(); ++it)



RE: I can compile it, but it crashes... - Urkle - 05-16-2010

ahh yes.. the iterators.... Those have been a royal pain in the posterior. The issue is MS does their "own" implementation of them that doesn't follow the standard that everyone else follows when it comes to how erase() works.

However, for this specific issue that's not the problem.. It just seems the iteration is done incorrectly. as it = mlstBodies.erase(it); increments it so it is being double incremented (and can skip entries).. this is a bug.. I'll make a fix and push it up. And it looks like the only place that has that issue.. Good Smile

http://github.com/FrictionalGames/HPL1Engine/commit/d64c516dbed39f006042b20509d01e3470adfaee


RE: I can compile it, but it crashes... - MulleDK19 - 05-16-2010

(05-16-2010, 04:34 PM)Urkle Wrote: ahh yes.. the iterators.... Those have been a royal pain in the posterior. The issue is MS does their "own" implementation of them that doesn't follow the standard that everyone else follows when it comes to how erase() works.

However, for this specific issue that's not the problem.. It just seems the iteration is done incorrectly. as it = mlstBodies.erase(it); increments it so it is being double incremented (and can skip entries).. this is a bug.. I'll make a fix and push it up. And it looks like the only place that has that issue.. Good Smile

http://github.com/FrictionalGames/HPL1Engine/commit/d64c516dbed39f006042b20509d01e3470adfaee

Now I get a read access violation on line 161:
Code:
void iPhysicsWorld::DestroyBody(iPhysicsBody* apBody)
{
    //STLFindAndDelete(mlstBodies, apBody);
    tPhysicsBodyListIt it = mlstBodies.begin();
    for(; it != mlstBodies.end(); ++it)
    {
161:        iPhysicsBody *pBody = *it;
        if(pBody == apBody)
        {
            if(mpWorld3D) mpWorld3D->GetPortalContainer()->RemoveEntity(pBody);
            pBody->Destroy();
            hplDelete(pBody);
            mlstBodies.erase(it);
        }
    }
}