Jump to content

Home

Some strange crashes


Dom_152

Recommended Posts

'jamp.exe': Loaded 'C:\Games\LucasArts\Star Wars Jedi Knight Jedi Academy\GameData\jamp.exe', Binary was not built with debug information.

'jamp.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', No symbols loaded.

'jamp.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', No symbols loaded.

'jamp.exe': Loaded 'C:\Games\LucasArts\Star Wars Jedi Knight Jedi Academy\GameData\OpenAL32.dll', Binary was not built with debug information.

'jamp.exe': Loaded 'C:\WINDOWS\system32\winmm.dll', No symbols loaded.

'jamp.exe': Loaded 'C:\WINDOWS\system32\user32.dll', No symbols loaded.

'jamp.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll', No symbols loaded.

'jamp.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll', No symbols loaded.

'jamp.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll', No symbols loaded.

'jamp.exe': Loaded 'C:\WINDOWS\system32\ole32.dll', No symbols loaded.

'jamp.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', No symbols loaded.

'jamp.exe': Loaded 'C:\WINDOWS\system32\wsock32.dll', No symbols loaded.

'jamp.exe': Loaded 'C:\WINDOWS\system32\ws2_32.dll', No symbols loaded.

'jamp.exe': Loaded 'C:\WINDOWS\system32\ws2help.dll', No symbols loaded.

'jamp.exe': Loaded 'C:\WINDOWS\system32\secur32.dll', No symbols loaded.

'jamp.exe': Loaded 'C:\WINDOWS\system32\opengl32.dll', No symbols loaded.

'jamp.exe': Loaded 'C:\WINDOWS\system32\glu32.dll', No symbols loaded.

'jamp.exe': Loaded 'C:\WINDOWS\system32\ddraw.dll', No symbols loaded.

'jamp.exe': Loaded 'C:\WINDOWS\system32\dciman32.dll', No symbols loaded.

'jamp.exe': Loaded 'C:\WINDOWS\system32\atioglxx.dll', No symbols loaded.

'jamp.exe': Loaded 'C:\WINDOWS\system32\mcd32.dll', No symbols loaded.

'jamp.exe': Unloaded 'C:\WINDOWS\system32\mcd32.dll'

'jamp.exe': Loaded 'C:\WINDOWS\system32\dsound.dll', No symbols loaded.

'jamp.exe': Loaded 'C:\WINDOWS\system32\version.dll', No symbols loaded.

'jamp.exe': Loaded 'C:\WINDOWS\system32\wdmaud.drv', No symbols loaded.

'jamp.exe': Loaded 'C:\WINDOWS\system32\setupapi.dll', No symbols loaded.

'jamp.exe': Loaded 'C:\WINDOWS\system32\wintrust.dll', No symbols loaded.

'jamp.exe': Loaded 'C:\WINDOWS\system32\crypt32.dll', No symbols loaded.

'jamp.exe': Loaded 'C:\WINDOWS\system32\msasn1.dll', No symbols loaded.

'jamp.exe': Loaded 'C:\WINDOWS\system32\imagehlp.dll', No symbols loaded.

'jamp.exe': Unloaded 'C:\WINDOWS\system32\setupapi.dll'

'jamp.exe': Unloaded 'C:\WINDOWS\system32\wdmaud.drv'

'jamp.exe': Loaded 'C:\WINDOWS\system32\wdmaud.drv', No symbols loaded.

'jamp.exe': Loaded 'C:\WINDOWS\system32\setupapi.dll', No symbols loaded.

'jamp.exe': Unloaded 'C:\WINDOWS\system32\setupapi.dll'

'jamp.exe': Loaded 'C:\WINDOWS\system32\msacm32.drv', No symbols loaded.

'jamp.exe': Loaded 'C:\WINDOWS\system32\msacm32.dll', No symbols loaded.

'jamp.exe': Loaded 'C:\WINDOWS\system32\midimap.dll', No symbols loaded.

'jamp.exe': Loaded 'C:\WINDOWS\system32\setupapi.dll', No symbols loaded.

'jamp.exe': Unloaded 'C:\WINDOWS\system32\setupapi.dll'

'jamp.exe': Loaded 'C:\WINDOWS\system32\setupapi.dll', No symbols loaded.

'jamp.exe': Unloaded 'C:\WINDOWS\system32\setupapi.dll'

'jamp.exe': Loaded 'C:\WINDOWS\system32\setupapi.dll', No symbols loaded.

'jamp.exe': Unloaded 'C:\WINDOWS\system32\setupapi.dll'

'jamp.exe': Loaded 'C:\WINDOWS\system32\setupapi.dll', No symbols loaded.

'jamp.exe': Unloaded 'C:\WINDOWS\system32\setupapi.dll'

'jamp.exe': Loaded 'C:\WINDOWS\system32\ksuser.dll', No symbols loaded.

'jamp.exe': Loaded 'C:\Documents and Settings\-Dom-\Desktop\JKA\MP Xtra Mod\codemp\debug\uix86.dll', Symbols loaded.

Link to comment
Share on other sites

  • Replies 50
  • Created
  • Last Reply

mmm, well, if it's ingame crashes, you should at least have the game and cgame .dlls mentioned in your output log after the uix86.dll is loaded.

 

Run the debugger, load up a map, and then doublecheck. The output should state that both the game and cgame are loaded with symbols.

Link to comment
Share on other sites

AHA! I found the culprit piece of code!

 

It's in g_combat.c just after the check for Godmode:

 

/*MP XTRA MOD*/
//Check for stunnage 
if ((targ->client->sess.state & PLAYER_STUN) > 0)
{
return;
}

 

It basically checks to see if the target player is stunned and if they are don't hurt them. So I wonder what's wrong with this piece of code. I'm going to do another bit of deugging and see if I can find out any more info.

 

Hmm look at this:

 

14kvfj7.jpg

 

For some reason it can't seem to evaluate the state variable. This could be what is causing it to crash. Well now I'm going to look into the Det Pack crash see what's going on there. OK it seems that it is the exact same piece of code that is causing the Det pack crash as well.

 

Hmm I just commented out the above bit of code and it now crashes on this line in w_saber.c:

 

G_Damage( victim, self, self, dmgDir, dmgSpot, totalDmg, dflags, MOD_SABER );

 

I commented out all my code from G_Damage() and it's still crashing...

Nope I lie it does work... so now to slowly uncomment bits out and find the EXACT cause.

Link to comment
Share on other sites

OK I have narrowed it down to these two pieces of code:

 

	
if (targ->client->sess.state & PLAYER_STUN)
{
     return;
}

//Check if chat Protection has been set and if so protect those who are chatting
if(mpx_chatProtection.integer == 1 && targ->client->ps.eFlags & EF_TALK)
{
return;
}

 

Both check flags before doing something... coincidence? Hmmm....

Link to comment
Share on other sites

Well, according to your picture, your client object isn't valid, that's why all the sub-data isn't accessable. What does the actual error message say when your game crashes?

 

Normally what you need to do is check each of the variables on the line that causes the crash. You'll be able to tell which line it is since the debugger will place an arrow next to it. Whatever variable that is showing as 0x00000000 is the problem since that means that it's currently NULL (when it should be pointing to something in memory). From there, you need to work backwards and determine why that variable isn't valid at that point in the code.

Link to comment
Share on other sites

Error Message:

 

Unhandled exception at 0x201c7918 (jampgamex86.dll) in jamp.exe: 0xC0000005: Access violation reading location 0x000007ac.

 

I think it's the Client pointer:

 

14m5dec.jpg

 

But I don't get why 'cos the client pointer is used earlier on in the code :S

Link to comment
Share on other sites

ah hah, i know why this is in G_Damage right?

 

your if statement should be:

 

if ( targ->client && targ->client->sess.state & PLAYER_STUN )

 

the reason is, some entitiy is being damage possibly but its not even a client. this should fix both problems im assuming. ie: dead body, or detpacks.

Link to comment
Share on other sites

I'm back with another crazy problem. All I'm trying to do is Sanitize each players name so I can compare it to my partial name. But when it gets SanitizeString2() it crashes giving me this error:

 

Unhandled exception at 0x201af7c3 (jampgamex86.dll) in jamp.exe: 0xC0000005: Access violation writing location 0xcccccccc.

 

Here is my G_ClientNumberFromPartialName() function:

 

/*
=============================
G_ClientNumberFromPartialName

Gets a client number from only a partial name
=============================
*/
int G_ClientNumberFromPartialName(char *partialname)
{
int clientnumber = 0;
gentity_t *tent;
gentity_t *final;		
char *name = "";
char *tempname;
int i;	
int matches = 0;	
int finalmatch = 0;

//No need here. Just make sure you sanitize the partial string before sending it here
//SanitizeString(partial, partialname);	

//First client pass
for(i = 0; i < MAX_CLIENTS; i++)
{
	tent = &g_entities[i];	

	if(!tent->client)
	{
		continue; //if the client doesn't exist move on to the next one.
	}

	//If we are here the entity is definatly a client so it should be safe to put this here
	tempname = tent->client->pers.netname; 				
	SanitizeString2(tempname, name);

	if(strstr(name, partialname) == NULL)
	{
		//Nope not there move on!
		continue;
	}
	else
	{
		//Partial name found in a full name!
		//Log it!
		matches += 1;
		//Log the Client number that matches... we need it later on
		finalmatch = i;
	}
}	

if(matches > 1) //Too many matches!
{
	return -2;
}
if(matches < 1) //no Matches
{
	return -1;
}

final = &g_entities[finalmatch];	
clientnumber = G_ClientNumberFromStrippedName(final->client->pers.netname);

return clientnumber;
}

 

SanitizeString2() works fine in all the other parts of my code so whats going on? I have run it in debug mode but I can't see anything strange apart from the fact that out[] (In sanitizeString2() is "")

Link to comment
Share on other sites

lol that function is so gross...

 

why did u barrow the G_ClientNumber function... ClientNumbersFromString works perfectly fine...

 

/*
==================
stristr
==================
*/
char *stristr(char *str, char *charset) {
int i;

while(*str) {
	for (i = 0; charset[i] && str[i]; i++) {
		if (toupper(charset[i]) != toupper(str[i])) break;
	}
	if (!charset[i]) return str;
	str++;
}
return NULL;
}

/*
==================
ClientNumbersFromString

Sets plist to an array of integers that represent client numbers that have 
names that are a partial match for s. List is terminated by a -1.

Returns number of matching clientids.
==================
*/
int ClientNumbersFromString( char *s, int *plist) {
gclient_t *p;
int i, found = 0;
char s2[MAX_STRING_CHARS];
char n2[MAX_STRING_CHARS];
char n1[MAX_STRING_CHARS];
char *m;
qboolean is_slot = qtrue;

*plist = -1;

// if a number is provided, it might be a slot # 
for(i=0; i<(int)strlen(s); i++) { 
	if(s[i] < '0' || s[i] > '9') {
		is_slot = qfalse;
		break;
	}
}
if(is_slot) {
	i = atoi(s);
	if(i >= 0 && i < level.maxclients) {
		p = &level.clients[i];
		if(p->pers.connected == CON_CONNECTED ||
			p->pers.connected == CON_CONNECTING) {

			*plist++ = i;
			*plist = -1;
			return 1;
		}
	}
}

// now look for name matches
Q_CleanStr(s);
Q_strncpyz(s2, s, sizeof(s2));
if(strlen(s2) < 1) return 0;
for(i=0; i < level.maxclients; i++) {
	p = &level.clients[i];
	if(p->pers.connected != CON_CONNECTED &&
		p->pers.connected != CON_CONNECTING) {

		continue;
	}
	Q_strncpyz(n1, p->pers.netname, sizeof(n1));
	Q_CleanStr(n1);
	Q_strncpyz(n2, n1, sizeof(n2));
	m = stristr(n2, s2);
	if(m != NULL) {
		*plist++ = i;
		found++;
	}
}
*plist = -1;
return found;
}

 

that is a little different than clientnumberfromstring, this is an array and allows multiple matches.

 

show me the function your trying to make use that and ill fix it to the new one.

 

now, do you want it to only match one person or do you want it to match multiple clients?

 

if ur only wanting one then add this too:

 

qboolean G_MatchOnePlayer(int *plist, char *err, int len) 
{
gclient_t *cl;
int *p;
char line[MAX_NAME_LENGTH+10];

err[0] = '\0';
line[0] = '\0';
if(plist[0] == -1) {
	Q_strcat(err, len, 
		"no connected player by that name or slot #");
	return qfalse;
}
if(plist[1] != -1) {
	Q_strcat(err, len, "more than one player name matches. "
		"be more specific or use the slot #:\n");
	for(p = plist;*p != -1; p++) {
		cl = &level.clients[*p];
		if(cl->pers.connected == CON_CONNECTED) {
			sprintf(line, "%2i - %s^7\n",
				*p,	
				cl->pers.netname);
			if(strlen(err)+strlen(line) > len)
				break;
			Q_strcat(err, len, line);
		}
	}
	return qfalse;
}
return qtrue;
}

 

here is some test command for a single match:

 

void G_test_print(gentity_t *ent) 
{
int pids[MAX_CLIENTS];
char name[MAX_NAME_LENGTH], err[MAX_STRING_CHARS];
gentity_t *vic;

if ( trap_Argc() != 2 )
	trap_SendServerCommand(ent-g_entities, "Usage: testprint [name|slot#]\n");
	return qfalse;
}

trap_Argv( 1, name, sizeof( name ) ); 

if(ClientNumbersFromString(name, pids) != 1) {
	G_MatchOnePlayer(pids, err, sizeof(err));
	trap_SendServerCommand(ent-g_entities, va("testprint: %s\n", err)); // testprint being the cmdname
	return;
}

vic = &g_entities[pids[0]];

trap_SendServerCommand(ent-g_entities, va("print \"Test Message Sent to %s\"", vic->client->pers.netname ));
}

Link to comment
Share on other sites

remember to check each variable when the debugger breaks like that. it sounds like either your tempname isn't valid OR you need to have an actual char array for your name.

 

If SanitizeString2 is copying into name, it's going to be attempting to place actual data in a pointer, which isn't good.

Link to comment
Share on other sites

Yeah I had to tidy up your code (I don't like your coding style) but yeah it works. Thanks! :D I'm just gonna do a few modifications abut that's it. Thanks again.

 

what dont you like about it? that isnt actually how i code officially, i dont use trap_send anymore i have other functions do that for me, etc.

Link to comment
Share on other sites

Is there anyway of making the camera automatically position itself. Because I've been messing around with model scaling and I have to manually re-position the camera. If I can't then I'm gonna have to work out some sort of algorithm that will re-position the camera based on it's scale.

Link to comment
Share on other sites

I mean after a player has used my /scale command to make themsleves bigger or smaller. 'Cos at the moment I'm using trap_Cvar_Set() to set cg_thirdpersonrange and vertoffset and I was wondering is there a way of doing this automatically.

Link to comment
Share on other sites

Archived

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


×
×
  • Create New...