Crashdetect log(Only for experienced)
#1

Hi everyone. I have a huge problem which constantly keeps crashing my server. It happened often to me that my server crashes so I set in a crashdetect plugin, and I got this in "server_log.txt":
Код:
[20:52:59] [debug] Server crashed while executing BCRP.amx
[20:52:59] [debug] AMX backtrace:
[20:52:59] [debug] #0 native mysql_function_query () [10008f00] from mysql.dll
[20:52:59] [debug] #1 00033748 in ?? () from BCRP.amx
[20:52:59] [debug] #2 001026e4 in public cmd_makeleader () from BCRP.amx
[20:52:59] [debug] #3 native CallLocalFunction () [00472c00] from samp-server.exe
[20:52:59] [debug] #4 00008ccc in public OnPlayerCommandText () from BCRP.amx
[20:52:59] [debug] System backtrace:
[20:53:00] [debug] #0 7c91a3bc in RtlReAllocateHeap () from C:\WINDOWS\system32\ntdll.dll
[20:53:00] [debug] #1 7c911917 in RtlInitializeCriticalSection () from C:\WINDOWS\system32\ntdll.dll
[20:53:00] [debug] #2 78583db8 in malloc () from C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.4974_x-ww_d889290f\MSVCR90.dll
[20:53:00] [debug] #3 7858375e in malloc_crt () from C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.4974_x-ww_d889290f\MSVCR90.dll
[20:53:00] [debug] #4 7854f6aa in flsbuf () from C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.4974_x-ww_d889290f\MSVCR90.dll
[20:53:00] [debug] #5 7854f427 in flsbuf () from C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.4974_x-ww_d889290f\MSVCR90.dll
[20:53:00] [debug] #6 7854eaee in putc () from C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.4974_x-ww_d889290f\MSVCR90.dll
[20:53:00] [debug] #7 7848c23c in std::basic_filebuf<char,std::char_traits<char> >::basic_filebuf<char,std::char_traits<char> > () from C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.4974_x-ww_d889290f\MSVCP90.dll
[20:53:00] [debug] #8 7848c655 in std::basic_filebuf<char,std::char_traits<char> >::overflow () from C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.4974_x-ww_d889290f\MSVCP90.dll
[20:53:00] [debug] #9 7848c116 in std::basic_streambuf<char,std::char_traits<char> >::xsputn () from C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.4974_x-ww_d889290f\MSVCP90.dll
[20:53:00] [debug] #10 10005ae7 in ?? () from C:\Documents and Settings\Vrabac-PC\Desktop\Balkan Country Mod\plugins\mysql.dll
[20:53:00] [debug] #11 1000724e in ?? () from C:\Documents and Settings\Vrabac-PC\Desktop\Balkan Country Mod\plugins\mysql.dll
[20:53:00] [debug] #12 10008f54 in ?? () from C:\Documents and Settings\Vrabac-PC\Desktop\Balkan Country Mod\plugins\mysql.dll
[20:53:00] [debug] #13 004010b6 in ?? () from C:\Documents and Settings\Vrabac-PC\Desktop\Balkan Country Mod\samp-server.exe
[20:53:00] [debug] #14 010539e2 in AmxCallback () from C:\Documents and Settings\Vrabac-PC\Desktop\Balkan Country Mod\plugins\crashdetect.dll
[20:53:00] [debug] #15 01055e26 in amx_Exec () from C:\Documents and Settings\Vrabac-PC\Desktop\Balkan Country Mod\plugins\crashdetect.dll
[20:53:00] [debug] #16 0104bf3f in crashdetect::DoAmxExec () from C:\Documents and Settings\Vrabac-PC\Desktop\Balkan Country Mod\plugins\crashdetect.dll
[20:53:00] [debug] #17 01053a0e in AmxExec () from C:\Documents and Settings\Vrabac-PC\Desktop\Balkan Country Mod\plugins\crashdetect.dll
[20:53:00] [debug] #18 00472f0e in ?? () from C:\Documents and Settings\Vrabac-PC\Desktop\Balkan Country Mod\samp-server.exe
[20:53:00] [debug] #19 004010b6 in ?? () from C:\Documents and Settings\Vrabac-PC\Desktop\Balkan Country Mod\samp-server.exe
[20:53:00] [debug] #20 010539e2 in AmxCallback () from C:\Documents and Settings\Vrabac-PC\Desktop\Balkan Country Mod\plugins\crashdetect.dll
[20:53:00] [debug] #21 01055e26 in amx_Exec () from C:\Documents and Settings\Vrabac-PC\Desktop\Balkan Country Mod\plugins\crashdetect.dll
[20:53:00] [debug] #22 0104bf3f in crashdetect::DoAmxExec () from C:\Documents and Settings\Vrabac-PC\Desktop\Balkan Country Mod\plugins\crashdetect.dll
[20:53:00] [debug] #23 01053a0e in AmxExec () from C:\Documents and Settings\Vrabac-PC\Desktop\Balkan Country Mod\plugins\crashdetect.dll
[20:53:00] [debug] #24 0046d9d0 in ?? () from C:\Documents and Settings\Vrabac-PC\Desktop\Balkan Country Mod\samp-server.exe

Can anyone possibly help me to locate and solve the problem, I would be very very grateful and "rep ++"
Reply
#2

Not one problem you can say problems!.
Could you show your script errors ??
Reply
#3

Do you use a file with name pawno.cfg into the pawno folder and inside it has "-d3", it'd be better for the lines.
Anyway, it seems you have some serious problems.
1) With MySQL and the threaded querries (mysql_function_query), make sure the threaded on the callbacks are correct.
2)The command "makeleader" is incorrect.
4)Are you using only commands with ZCMD, or with OnPlayerCommandText too?

// --

Can you post the command "makeleader" and we'll see the rest after that.
Reply
#4

Its one problem not many, check whole OnPlayerCommandText () public, somewhere you have made a mistake.
Reply
#5

@[HRD]Mar1 - I have no errors during compiling. The problem occurs directly while the script is running and is not happening that often to be located accurately. Meaning it crashes with one callback, but not always with this callback, but rather only "sometimes", and I can't get to know the reason. I have set in a crashdetect plugin and this is what I got after the crash... Can you make a conclusion based on this?
@Dwane - I combine callback OnPlayerCommandReceived and zcmd comand, so I have strcmp and zcmd command processors.
here is makeleader cmd:
Код:
CMD:makeleader(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= 1337)
	{
	    new id, lvl;
	    if(sscanf(params, "ud", id, lvl)) SendClientMessage(playerid, COLOR_GRAD2, "{FFFFFF}[{CD661D}Balkan Country{FFFFFF}]: /makeleader [ID/Dio imena] [ID Org]");
	    else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, -1, "{FFFFFF}[{FF0000}Balkan Country{FFFFFF}]: {AFAFAF}Igrač nije online!");
		else
	    {
	        new orgid = PlayerInfo[id][pLeader];
	        new pName[24], string[380];
	        GetPlayerName(id, pName, 24);
	        if(lvl == 0)
	        {
	    		if(strcmp(oClan[orgid][0][orgClan], pName, true) == 0)
				{
    				strmid(oClan[orgid][0][orgClan], "Niko", 0, strlen("Niko"), 255);
    				PlayerInfo[id][pLeader] = 0;
    				format(string, sizeof(string), "[{FF0000}Balkan Country{FFFFFF}] {AFAFAF}Admin %s vam je skinuo lidera!", GetPlayerNameEx(playerid));
				    SendClientMessage(id, -1, string);
				    format(string, sizeof(string), "[{FF0000}Balkan Country{FFFFFF}] {AFAFAF}Skinuli ste lidera igraču %s!", GetPlayerNameEx(id));
				    SendClientMessage(playerid, -1, string);
				    PlayerInfo[id][pLeader] = 0;
				    PlayerInfo[id][pRank] = 0;
				    UpdateText(3, orgid);
				    SetPlayerSkin(id, 1);
					PlayerInfo[id][pChar] = 1;
				    SacuvajIgraca(id);
				    SaveOrg(orgid);

				}
				else if(strcmp(oClan[orgid][1][orgClan], pName, true) == 0)
				{
				    strmid(oClan[orgid][1][orgClan], "Niko", 0, strlen("Niko"), 255);
				    PlayerInfo[id][pLeader] = 0;
				    format(string, sizeof(string), "[{FF0000}Balkan Country{FFFFFF}] {AFAFAF}Admin %s vam je skinuo lidera!", GetPlayerNameEx(playerid));
				    SendClientMessage(id, -1, string);
				    format(string, sizeof(string), "[{FF0000}Balkan Country{FFFFFF}] {AFAFAF}Skinuli ste lidera igraču %s!", GetPlayerNameEx(id));
				    SendClientMessage(playerid, -1, string);
				    PlayerInfo[id][pRank] = 0;
				    UpdateText(3, orgid);
				    SetPlayerSkin(id, 1);
					PlayerInfo[id][pChar] = 1;
				    SacuvajIgraca(id);
				    SaveOrg(orgid);
				}
				PlayerInfo[id][pLeader] = 0;
    			PlayerInfo[id][pRank] = 0;
	        }
	        else if(lvl > 0 && lvl < MAX_ORG)
			{
			    if(PlayerInfo[id][pLeader] != 0)
			    {
			        SendClientMessage(playerid,WHITE,"[{FF0000}Balkan Country{FFFFFF}]{AFAFAF} Igrač je već lider, prvo mu skini lidera!");
			        return 1;
			    }
			    if(strcmp(oClan[lvl][0][orgClan], "Niko", true) == 0)
				{
				    SetPlayerSkin(id, OI[lvl][oLiderSkin]);
					PlayerInfo[id][pChar] = OI[lvl][oLiderSkin];
    				strmid(oClan[lvl][0][orgClan], pName, 0, strlen(pName), 255);
    				PlayerInfo[id][pLeader] = lvl;
    				format(string, sizeof(string), "[{FFFF00}Balkan Country{FFFFFF}] {AFAFAF}Admin %s vam je dodjelio lidera %s!", GetPlayerNameEx(playerid), OI[lvl][oIme]);
				    SendClientMessage(id, -1, string);
				    format(string, sizeof(string), "[{FFFF00}Balkan Country{FFFFFF}] {AFAFAF}Dodjelili ste lidera %s igraču %s!", OI[lvl][oIme], GetPlayerNameEx(id));
				    SendClientMessage(playerid, -1, string);
				    PlayerInfo[id][pRank] = 6;
				    UpdateText(3, lvl);
				    SacuvajIgraca(id);
				    SaveOrg(lvl);
				}
				else
				{
				    if(strcmp(oClan[lvl][1][orgClan], "Niko", true) == 0)
				    {
				        SetPlayerSkin(id, OI[lvl][oLiderSkin]);
						PlayerInfo[id][pChar] = OI[lvl][oLiderSkin];
					    strmid(oClan[lvl][1][orgClan], pName, 0, strlen(pName), 255);
					    PlayerInfo[id][pLeader] = lvl;
					    format(string, sizeof(string), "[{FFFF00}Balkan Country{FFFFFF}] {AFAFAF}Admin %s vam je dodjelio lidera %s!", GetPlayerNameEx(playerid), OI[lvl][oIme]);
					    SendClientMessage(id, -1, string);
					    format(string, sizeof(string), "[{FFFF00}Balkan Country{FFFFFF}] {AFAFAF}Dodjelili ste lidera %s igraču %s!",OI[lvl][oIme],  GetPlayerNameEx(id));
				    	SendClientMessage(playerid, -1, string);
				    	PlayerInfo[id][pRank] = 6;
					    UpdateText(3, lvl);
					    SacuvajIgraca(id);
					    SaveOrg(lvl);
					}
					else
					{
					    SendClientMessage(playerid, -1, "{FFFFFF}[{FF0000}Balkan Country{FFFFFF}] {AFAFAF}Mjesto lidera za tu organizaciju je popunjeno!");
					}

				}
			}
			else
			{
			    SendClientMessage(playerid, -1, "{FFFFFF}[{FF0000}Balkan Country{FFFFFF}] {AFAFAF}Pograљan ID organizacije!");
			}
			
	    }
	}
	else
	{
		SendClientMessage(playerid,WHITE,"[{FF0000}Balkan Country{FFFFFF}]{AFAFAF} Admini samo!");
	}
	return 1;
}
It doesn't crash always when I type /makeleader, it sometiems crashes when I type /pay and when "sometime" when dicsonnect from server!

@ikey07 - I will check!
Reply
#6

Quote:
Originally Posted by Marusa
Посмотреть сообщение
I combine callback OnPlayerCommandReceived and zcmd comand, so I have strcmp and zcmd command processors.
What I see is correct, expect some cutom functions that I don't know the code inside, if it's correct.
Since it's happening not only to this, but to others commands too, I'd like to ask you something.
You said, you combine the callback OnPlayerCommandReceived and commands which are ZCMD, where do you have strcmp commands?
And the problem may be on the ZCMD's callbacks.
Can you show us (if it exists) the callback OnPlayerCommandReceived and OnPlayerCommandPerformed.
Reply
#7

Here is code for these function inside ... SacuvajIgraca:
Код:
public SacuvajIgraca(playerid)
{
	if(IsPlayerConnected(playerid))
	{
	    new ti = GetTickCount();
		if(gPlayerLogged[playerid] || gRegaSe[playerid])
		{
		    new string[200], str[1100];
		    new loginname[MAX_PLAYER_NAME];
			GetPlayerName(playerid,loginname,sizeof(loginname));
		    format(string,sizeof(string),"UPDATE `korisnici` SET Level=%d, AdminLevel=%d, ConnectedTime=%d, Registered=%d, Sex=%d, Age=%d, Origin=%d,", PlayerInfo[playerid][pLevel],PlayerInfo[playerid][pAdmin],PlayerInfo[playerid][pConnectTime],PlayerInfo[playerid][pReg],PlayerInfo[playerid][pSpol],PlayerInfo[playerid][pGodine],PlayerInfo[playerid][pDrzava]);
		    strcat(str, string);
		    format(string,sizeof(string),"CK=%d, Muted=%d, Respect=%d, Money=%d, Bank=%d, Crimes=%d, Kills=%d, Deaths=%d, Arrested=%d, WantedDeaths=%d,",PlayerInfo[playerid][pCK], PlayerInfo[playerid][pMuted], PlayerInfo[playerid][pExp], PlayerInfo[playerid][pCash], PlayerInfo[playerid][pAccount], PlayerInfo[playerid][pCrimes], PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths], PlayerInfo[playerid][pArrested], PlayerInfo[playerid][pWantedDeaths]);
		    strcat(str, string);
		    format(string,sizeof(string),"Phonebook=%d, Job=%d, Paycheck=%d, HeadValue=%d, Jailed=%d, JailTime=%d,",PlayerInfo[playerid][pPhoneBook],PlayerInfo[playerid][pJob],PlayerInfo[playerid][pPayCheck],PlayerInfo[playerid][pHeadValue],PlayerInfo[playerid][pJailed],PlayerInfo[playerid][pJailTime]);
		    strcat(str, string);
		    format(string,sizeof(string),"Materials=%d, Drugs=%d, Leader=%d, Member=%d, Rank=%d, PayDay=%d, PayDayHad=%d,",PlayerInfo[playerid][pMats], PlayerInfo[playerid][pDrugs], PlayerInfo[playerid][pLeader], PlayerInfo[playerid][pMember], PlayerInfo[playerid][pRank], PlayerInfo[playerid][pPayDay],PlayerInfo[playerid][pPayDayHad]);
		    strcat(str, string);
		    format(string,sizeof(string),"SexSkill=%d, BoxSkill=%d, LawSkill=%d, MechSkill=%d, LawSkill=%d, CarSkill=%d, NewsSkill=%d, Ban=%d,", PlayerInfo[playerid][pSpolSkill], PlayerInfo[playerid][pBoxSkill], PlayerInfo[playerid][pLawSkill], PlayerInfo[playerid][pMechSkill], PlayerInfo[playerid][pJackSkill], PlayerInfo[playerid][pCarSkill], PlayerInfo[playerid][pNewsSkill], PlayerInfo[playerid][pBan]);
		    strcat(str, string);
		    format(string,sizeof(string),"Interior=%d, PhoneNr=%d, Car=%d, House=%d, Bizz=%d, pHealth=%.1f, Spawn=%d,",PlayerInfo[playerid][pInt], PlayerInfo[playerid][pPnumber], PlayerInfo[playerid][pPcarkey], PlayerInfo[playerid][pPhousekey], PlayerInfo[playerid][pPbiskey], PlayerInfo[playerid][pHealth], PlayerInfo[playerid][pSpawn]);
		    strcat(str, string);
		    format(string,sizeof(string),"Warnings=%d, VirWorld=%d, mRuta=%d, ",PlayerInfo[playerid][pWarns],PlayerInfo[playerid][pVirWorld], PlayerInfo[playerid][pmRuta]);
		    strcat(str, string);
		    format(string,sizeof(string),"Lighter=%d, Cigarettes=%d, GameSupport=%d, PinKod=%d, Kredit=%d, Naocale=%d,",PlayerInfo[playerid][pLighter],PlayerInfo[playerid][pCigarettes],PlayerInfo[playerid][pGameSupport],PlayerInfo[playerid][pPinKod],PlayerInfo[playerid][pKredit],PlayerInfo[playerid][pNaocale]);
		    strcat(str, string);
		    format(string,sizeof(string),"MuteTime=%d, Kapa=%d, Kosa=%d, VIP=%d, BCB=%d, Wark=%d, Ward=%d, Stan=%d,",PlayerInfo[playerid][pMuteTime], PlayerInfo[playerid][pKapa],PlayerInfo[playerid][pKosa], PlayerInfo[playerid][pVIP], PlayerInfo[playerid][pBCB], PlayerInfo[playerid][pWark], PlayerInfo[playerid][pWard], PlayerInfo[playerid][pStan]);
		    strcat(str, string);
		    format(string,sizeof(string),"Letjelica=%d, Plovilo=%d, Motor=%d, Biciklo=%d, Duhan=%d,",PlayerInfo[playerid][pLet], PlayerInfo[playerid][pPlo],PlayerInfo[playerid][pMot], PlayerInfo[playerid][pBic], PlayerInfo[playerid][pDuhan]);
	    	strcat(str, string);
	    	format(string,sizeof(string),"PUgovor=%d, Area=%d, AreaTime=%d, Firma=%d,",PlayerInfo[playerid][pPUgovor],PlayerInfo[playerid][pArea],PlayerInfo[playerid][pAreaTime],PlayerInfo[playerid][pFirma]);
	    	strcat(str, string);
	    	format(string,sizeof(string),"rent=%d, bicrent=%d, motrent=%d, letrent=%d, plorent=%d, mkredit=%d, Radio=%d, Listovi=%d, DSjeme=%d WHERE Nick = '%s'",PlayerInfo[playerid][pRent],PlayerInfo[playerid][pBicRent],PlayerInfo[playerid][pMotRent],PlayerInfo[playerid][pLetRent],PlayerInfo[playerid][pPloRent], PlayerInfo[playerid][pMobKredit], PlayerInfo[playerid][pRadio], PlayerInfo[playerid][pListovi], PlayerInfo[playerid][pDSjeme], loginname);
            strcat(str, string);
			mysql_function_query(1,str, false, "", "");
	    	brojSave[playerid]++;
		 	
		}
		printf("Spremanje %s - %d ms", GetPlayerNameEx(playerid), GetTickCount() - ti);
	}
	return 1;
}
and SaveOrg code:
Код:
stock SaveOrg(idx)
{
    new string[128];
    new ti = GetTickCount();
    for(new i = 0; i < 40; i++)
    {
 		format(string,sizeof(string),"UPDATE `orgclanovi` SET Clan%d='%s' WHERE idorg=%d", i, oClan[idx][i][orgClan] ,idx);
		mysql_function_query(1,string, false, "", "");
	}
	printf("Spremanje orgi %d - %d ms", idx, GetTickCount() - ti);
	return 1;
}
.... OnPlayerCommandReceived is too long because it contains a lot of "strcmp" commands... and without this callback I have 139 zcmd commands...
Maybe the problem is in one of these function SaveOrg or SacuvajIgraca... help!
Reply
#8

Obviously a problem with mysql_function_query, as thats the top of the crash stack.
Dont know the syntax of that, maybe it doesnt allow empty callback function names. If it does, the code you shown is correct, and it might come from another query.
Compile your script in debug mode, then it will show the exact lines of the crash stack.
Reply
#9

Quote:
Originally Posted by Mauzen
Посмотреть сообщение
Compile your script in debug mode, then it will show the exact lines of the crash stack.
How to do that ?

I can't make deliberate crash, It happens spontaneously...
Reply
#10

Dont know how it works with pawno, you can also use the console.
Execute "cmd" to open it, then type "cd <path_to_your_pawno_folder>"
You can easily get that by clicking at the path line of the explorer in that directory, and then copy it.
Now type "pawncc -d2 ../gamemodes/yourGamemode.pwn" It will compile normally and additinally show some memory usage info. You can now use the amx as you like, it is just bigger than a normally compiled one, but will work the same way. Just use it till it crashes again, then you got the full info in the log.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)