Jump to content

Home

Some strange crashes


Dom_152

Recommended Posts

OK I've been experiencing some odd crashes lately. The first (If using the Debug DLL. If you use the Final DLL it just crashes) gives two Run Time warnings saying the stack around the variable "text"/"string" is courrupted. Now I looked at the lines it was complaining about and the first is in the G_Printf() function and the other is in G_LogPrintf(). I think it might be the infamous buffer overflow bug because if I increase the text/string buffer to 2000 it works OK. Is there a permananet fix for this? Secondly some of the stranger ones are: If I try and slash at a body on the ground it crashes the server for no reason and if I plant lots of Trip Mines or Det Packs and they explode it crahses the server. I have absolutley NO idea why this is happening. Could anyone enlighten me?

Link to comment
Share on other sites

  • Replies 50
  • Created
  • Last Reply

well for 1 they made the g_printf and logprintf only 1024 for a reason because most strings or even commands for that matter should never exceed 1022 especially ones being sent via trap_SendServerCommand (ie: print, chat, cp, etc the ones handled in cg_servercmds.c)

Link to comment
Share on other sites

Hmm that's odd... This is where it crashes:

 

144beh2.jpg

 

I had a thought... it couldn't be because I am setting too many Cvars to CVAR_SERVERINFO and it can't handle them all in one go could it?

 

And also I keep getting the "Info String length exceeded" even when there's no-one on the server a lot. Is this majorly bad? If so how can it be fixed.

Link to comment
Share on other sites

yes, it might be.

 

like how many cvars are you adding?

 

the reason why the "Info string length exceeded" message is showing up is because this function:

 

Info_SetValueForKey, dont go changing it because it most likely wont help you as its used in the engine also and i think its because how big your serverinfo is.

Link to comment
Share on other sites

that IS the base jka source bewb... but whatever

 

and not really... i use the svn one because thats what i have. or u could use winmerge which lets u compare files. use something to compare the base source you downloaded and compare it with urs.

Link to comment
Share on other sites

That's just it. I don't remember ever changing any code because I didn't need to. I tried changing the GIB_HEALTH as I said above but I changed it back to -40. I'll try and find the Bodt Fade code. Am I right in thinking it would be in the Body Die function?

Link to comment
Share on other sites

Using MSVC++ 2005. I'll try that but I really don't see how it could cause a problem if I changed it back to the original value! I just tried using the debugging stuff with JAMPDed Server but it can't load any PK3 files 'cos it's lookign in the wrong place... hwo can I make it look in the correct place :S

Link to comment
Share on other sites

ok dokie. Under your start up project's (the bolded one in your solution explorer) property, look under Configuration Properties.

 

Set "Command" to your jamp.exe location. Don't use the dedicated exe directly since you can dual use jamp.exe for dedicated or local use with a simple command line arguement. Mine is D:\games\Jedi Knight Academy\GameData\jamp.exe.

 

Your "Command Arguments" needs to include the following (with your folder names replacing mine)...

+set fs_cdpath "d:\games\Jedi Knight Academy\GameData" +set fs_game ojpbasic +set fs_dirbeforepak 1 +set sv_pure 0

 

fs_cdpath tells where your real /base folder is so that it can load the primary game assets.

fs_game tells where your mod assets are and to load the mod. This is simply the name of your mod's folder.

I'm not totally sure about fs_dirbeforepak but I think it makes sure that your debugging assets override things in the .pk3s

sv_pure turns off the requirement that all your assets be inside of pk3s.

 

You can also add whatever command line arguements you need for your debugging. For example, there's my current one for my OJP Basic solution....

+set fs_cdpath "d:\games\Jedi Knight Academy\GameData" +set fs_game ojpbasic +set fs_dirbeforepak 1 +set sv_pure 0 +set r_fullscreen 0 +set viewlog 1 +set g_gametype 5 +map t3_rift

 

I'm currently debugging my CoOp gametype on t3_rift. I always use a windowed game screen (+set r_fullscreen 0) and like to see to game's console during game loading (+set viewlog 1).

 

Set "Working Directory" to whatever your debug folder is. Mine is D:\JKA Editing\codemp\Basic\Debug.

 

Finally, you'll need to set your linker for each project to output to debug/yourmodfoldername rather than simply /debug. Any additional mod assets will need to be in debug/yourmodfoldername to be found by the game.

Link to comment
Share on other sites

Thank you! Oh and By the Way I tried using the OJP text wrap command for my MOTD but it does not work fully. It doesn't seem to recognise \n New Line characters :S I tried altering it slightly but it still didn't work.

Link to comment
Share on other sites

Is your build set to debug?

 

Also, try looking around in your /debug folder, if you have more than one of yourmodfolder's, it means that one of your debug settings isn't correct. Alternatively, you can check to make sure your debugger is working properly by watching the Output window while the game is loading up. If it reports something like the following, you're in business....

'jamp.exe': Loaded 'D:\JKA Editing\codemp\Basic\Debug\ojpbasic\jampgamex86.dll', Symbols loaded.
ICARUS Instance successfully created
'jamp.exe': Loaded 'D:\JKA Editing\codemp\Basic\Debug\ojpbasic\uix86.dll', Symbols loaded.
'jamp.exe': Loaded 'D:\JKA Editing\codemp\Basic\Debug\ojpbasic\cgamex86.dll', Symbols loaded.

 

However, I should note that the debugger isn't the end all of fixes. There are some crashes/bugs that occur inside the game engine itself. Those kind of bugs will give the 'source code cannot be displayed' sort of error even if your debugger is running properly. The only way around those issues is to determine what you did in your code/assets to cause the crash....which can be tough.

Link to comment
Share on other sites

I'm not totally sure about fs_dirbeforepak but I think it makes sure that your debugging assets override things in the .pk3s

 

fs_dirbeforepak was something raven added, it attempts to load folders/directories before it goes looking in pk3s.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...