Jump to content
The Dark Mod Forums

My mod is crashing badly, any advice?


ced2011

Recommended Posts

Hello guys. First off let me apologize for my post here, as you can tell I'm new to the forums.

If this is not the correct section to post, feel free to move it to where it belongs.

 

I'm the creator of the CED Assets pack for Doom 3, hopefully some of you here may know about it.

 

I'm also currently developing the S.T.A.R. 1088 campaign for Doom 3. But the problem is as follows:

I don't know why the game crashes (it simply becomes not responsive, no warnings or crash messages whatsoever) when I try to load a previously saved game.

It seems to be caused by my mod's dll, since when using stock Doom 3 code, nothing bad happens.

I've added plenty of new features to my mod, and it would be a really painful task having to rewrite all of it.

 

My question is, did someone ever encounter such issue while coding? I really cannot spot where the broken code is, or even what is causing such crashes when trying to load a game.

I can start new levels just fine, and everything else works as intended. It even saves the game perfectly as well.

Any advice? Did any of you go through something similar?

I'm quite desperate at the moment :(

 

Sorry for such post, it doesn't really have to do with TDM but I'm out of ideas as of where to ask for some help.

Any help or pointers are welcome.

 

Thank you guys,

CED2011

 

 

 

-FFYL-

Link to comment
Share on other sites

How about starting doom 3 with log arguments and using command loadgame?

http://wiki.thedarkmod.com/index.php?title=Debugging_TDM_systemerrors

 

Edit

Or record a crashdump and analyse thit by someone:

http://wiki.thedarkmod.com/index.php?title=Save_a_Memory_Dump_for_debugging_Crashes

Edited by freyk

Info: My portfolio and darkmod graphical installer
Amnesty for Bikerdude!

Link to comment
Share on other sites

How about starting doom 3 with log arguments and using command loadgame?

http://wiki.thedarkmod.com/index.php?title=Debugging_TDM_systemerrors

Thanks man, I've tried but nothing appears to be wrong in the dumped files. No warnings that could even hint an error, missing lines or unrecognized code.

Using loadgame actually leads to a crash too.

Thank you for your pointers and believe me I did try, but still no luck

-FFYL-

Link to comment
Share on other sites

Do you know how those dump files can be opened?

I have VC 2010 which opened it by default, however there didn't seem to be any useful information.

Trying to open it with text editors is simply useless.

I'll try and upload a zip with the dump file in it, maybe somebody will go ahead and take a look at it.

Thanks a lot man

-FFYL-

Link to comment
Share on other sites

I would suggest running your mod under debugger in VisualStudio.

You would have to be able to compile it from source code for that.

Then when it hangs use Debug - Pause menu and see the stack trace window for where the execution is.

Link to comment
Share on other sites

Does the following command and arguments give some more info, ced2011?

d3.exe +developer 1 +set logfile 2 +condump mylog1.txt +loadgame mysavedgame.txt +condump mylog2

 

Otherwise try to remember what you are worked on, before these crashes started.

Then fix or redo the changes.

Edited by freyk

Info: My portfolio and darkmod graphical installer
Amnesty for Bikerdude!

Link to comment
Share on other sites

I would suggest running your mod under debugger in VisualStudio.

You would have to be able to compile it from source code for that.

Then when it hangs use Debug - Pause menu and see the stack trace window for where the execution is.

If I didn't do it wrong, apparently it's not showing any errors other than the execution codes and the files that were loaded during the execution. As you can tell all of this is pretty "new" for me since I've only been using visual studio to go straight to the point, adding features. I have to confess I do not know the VS C++ environment very well. If you could be a little bit more precise as of how I could get it to run under the debugger I would pretty much appreciate it!

 

Freyk, I really have no idea when or where the issue started as I've been coding on and off for some time now, but I havent used the save/load system since, well, I'm the dev and didn't really need it. I didn't know I could screw the loadgame function that bad. And no, the condump aren't showing any errors whatsoever, only common idTech 4 behaviour. After the loadgame command is sent to the engine it will then stop all other functions so no console dump files are being generated moments prior or after the crash, since the engine gets into a "freeze everything" state. So no luck with that :(

Edited by ced2011

-FFYL-

Link to comment
Share on other sites

Hello ced2011! I'm a big fan of your mod!! Your level design is just fantastic. I really hope you find the problem, because it would be a tragedy that this was cause for giving up on it.

 

Btw this problem is evidence a online code management system is important, I saw the Blendo Games guy recover from serious engine crash's because he was able to compare new code vs old code easily.

 

Speaking about Blendo Games, perhaps you can contact him and see if he can give you some clue?

 

About your problem, i'm not a c++ coder, so, even tho i would love to, I don't think i can really help you solve this but by your comments, i'm inclining as well for the save system being the culprit, like i said hope you find the cause and sorry for not being any help.

Edited by HMart
  • Like 1
Link to comment
Share on other sites

I think using MSVC debugger is your best bet.

 

There are several cases:

  1. When you load, it stops immediately somewhere and says that error happened.
  2. When you load, nothing happens, but you can pause execution (Debug -> Break All) and it seems to do it.
  3. When you load, MSVC simply hangs and stops responding.

I hope you have one of the first two.

Then find Call Stack (Debug -> Windows -> Call Stack if you don't see it already).

There you would see list of nested functions called currently + you can see the point of execution in the code.

You can probably attach a screenshot of it, if it is hard to comprehend it for you.

 

If you see no functions from Doom3 and your mod there, then it gets harder.

You might want to look at threads (Debug -> Windows -> Threads).

There is a possibility that everything silently hangs with deadlock, although I heavily doubt you could get a deadlock without messing with multithreading yourself.

 

When using MSVC, be sure to build and run Debug configuration: this make everything slow, but increases your chances to see the error early.

 

Use some VCS really! You are going to have a lot of trouble without it.

If you have a single-man project, you might want to use hg/git (hg is much easier to use, but git is much more popular).

I think even creating a local SVN repo is not very hard.

 

Perhaps you have forgotten to save something.

Or you have changed saving without changing loading appropriately or vise versa

Overall, I think you would need a help from coder. Maybe you should prepare for a remote session (TeamViewer).

  • Like 2
Link to comment
Share on other sites

Hello ced2011! I'm a big fan of your mod!! Your level design is just fantastic. I really hope you find the problem, because it would be a tragedy that this was cause for giving up on it.

 

Btw this problem is evidence a online code management system is important, I saw the Blendo Games guy recover from serious engine crash's because he was able to compare new code vs old code easily.

 

Speaking about Blendo Games, perhaps you can contact him and see if he can give you some clue?

 

About your problem, i'm not a c++ coder, so, even tho i would love to, I don't think i can really help you solve this but by your comments, i'm inclining as well for the save system being the culprit, like i said hope you find the cause and sorry for not being any help.

Thanks man, no worries about being helpful or not, it's always nice to see people who likes your work :)

 

@stgatilov

My problem is, I don't know how to use the debugger. I seem to be doing it wrong

For what I've seen you seem to have quite a lot more experience than I do, would building the project under "debug" settings help in any way?

I'm asking this because I get fatal errors everywhere when trying to compile under debug settings. Some projects will build but the .exe and the .dll projects won't, which are the ones that are most important here.

I've tried to debug the current ones under "Debug -> Start debugging" (the ones compiled under "Release" settings), but I get errors like 'STAR1088.exe': Loaded 'H:\Games\STAR1088\base\gamex86.dll', Binary was not built with debug information. and I can understand that since well, it's release settings not debug. But as I mentioned I really don't know how to start debugging and locate the error easily.

I also can't seem to find the menues you mentioned (well, there is a "Debug" dropdown menu actually but I can't seem to find Call stack for example, or Threads). I'm using VC 2010 by the way.

Yes, I know I might sound dumb right now :laugh: , but believe me all I did in VC was to simply write code. I've never got too deep into it either. And all of this seems to be a whole universe ahead of my knowledge. That's why I need your help guys. I'll keep trying though, I won't give up to it.

  • Like 1

-FFYL-

Link to comment
Share on other sites

Hmm ok so the output showed this warning which got me even more confused :(

Where should I look at?

 

First-chance exception at 0x7755b4df in STAR1088.exe: 0xC0000005: Access violation reading location 0x00000000.
Unhandled exception at 0x7755b4df in STAR1088.exe: 0xC0000005: Access violation reading location 0x00000000.

 

Is that it? Is that actually telling me where the error is or it's only a tiny fraction of an entire whole lot of bad code?

 

Edit: I'm getting this when stopping debug mode:

The program '[6104] STAR1088.exe: Native' has exited with code -1073741819 (0xc0000005).

 

I've checked the disassembly but apparently there's no useful information (at least in my eyes) in there

Edited by ced2011
  • Like 1

-FFYL-

Link to comment
Share on other sites

In order to generate debug information for Release build:

1. Right-click on every project -> settings, ensure that Release configuration is selected.

2. Click the C/C++ node. Set Debug Information Format to Program Database (/Zi)

3. Expand Linker and click the General node. Set Enable Incremental Linking to No (/INCREMENTAL:NO).

4. Select the Debugging node. Set Generate Debug Info to Yes (/DEBUG).

Rebuild everything and you should have gemex86.pdb file generated, so you can now debug in the source code.

If you succeed, then "Binary was not built with debug information" message should not be printed for gamex86.dll.

 

However, debugging Debug configuration is MUCH easier, because it is not optimized.

When debugging a release build in MSVC2010, you can only see current call stack and approximate place where error happened.

Perhaps you would be able to see values of some variables, but often devenv simply shows some trash instead of real values.

Release build is not intended to be debugged, so you would have more problems with it.

I suggest trying to fix Debug build, although most likely you need onsite help (it would be much faster that posting on forum).

 

As for the error ("Access violation reading location 0x00000000"), it is not a hard problem :D

This is caused by accessing (dereferencing) a NULL pointer. It leads to immediate crash, so unless you fix it, you cannot even see another issues (if there are any).

This type of error happens often. It is not the dreaded "Heap corruption" problem, don't worry :laugh:

Link to comment
Share on other sites

I saw this today and thought of this thread, in this video bellow you will see how to Debug code in visual studio, is also a nice series of videos to anyone learning coding and is made by a professional coder that worked on the puzzle game "The witness".

 

Link to comment
Share on other sites

OK guys so I managed to get the code "cleaned" by just getting it again to its original state (replacing all of my current c++ files and the header files by the originals) and then simply start re-replacing those again with my own code, file by file...

It all went smoothly and with no errors and almost ALL of my code works perfect, however I left the most complex files for the end, which are the weapon.cpp, player.cpp and playerview.cpp, I don't think I even need to explain what those contain. Here's the thing, MOST of the changes and features I've added are located in those three files, mostly player and playerview since I've changed the way the HUD and some other overlayed materials are rendered. Not to talk about the additions I made in player.cpp

However when the time came to add the playerview file, when loading a game it just randomly crashed! Sometimes it would load my games fine, some others it would just crash as it did before (Only and always when trying to load a previously saved game)

This got me wondering, what could really be happening in the background for it to just be random now??? I know the error or some of the broken code must be in that file, not to mention the player and weapon cpp files have not been added yet, so as of now they're still vanilla Doom 3 ones.

Could this be a memory problem? Or something related to pushing the engine too much? I really, but this time REALLY have no idea what could be happening. I'll keep digging though, however it really got me wondering.

 

Thank you all guys, hopefully we'll solve this, I don't mean to be an annoyance here.

CED2011

-FFYL-

Link to comment
Share on other sites

People in this forum are generaly happy to help out fellow modders looking for help ^_^

I see! :)

 

Thankfully I seem to have fixed the issue. It seemed to occur because I forgot to save private declarations defined in playerview header file. Again, I'm not finished with this file, but it's not crashing anymore since I fixed that, so I'm going to assume there's where the error originated.

Next time I'm in trouble, I now know where to ask for some help ;)

Thank you all!

  • Like 4

-FFYL-

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
×
×
  • Create New...