[HELP] Mysql server crashes after login. (Linux)
#1

Hello. My server crashes when i login, here is the login code:
Код:
	if(dialogid == 2)
	{
		if(response)
		{
 
			new Nick[MAX_PLAYER_NAME], query[256];
			GetPlayerName(playerid, Nick, MAX_PLAYER_NAME);
 
			if(IsPlayerConnected(playerid))
			{
				MySQLCheck();
				format(query,sizeof(query),"SELECT * FROM `"TABLENAME"` WHERE Nick = '%s' AND Password ='%s' LIMIT 1",Nick,inputtext);
				mysql_query(query);
				mysql_store_result();
 
				if(mysql_num_rows() == 1)
				{
					SetPVarInt(playerid, "Prisijunge", 1);
					Logged[playerid] = true;
					Mysql_Player_Load(playerid);
					StopAudioStreamForPlayer(playerid);
					TextDrawHideForPlayer(playerid, Textdraw0);
					TextDrawHideForPlayer(playerid, Textdraw1);
				}
				else
				{
					new string1[256],pName[MAX_PLAYER_NAME];
					GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
					format(string1, 256, "{FFFFFF}Sveiki atvyke į StuntZone.LT serverį!\n{FFFFFF}Jūsų vartotojo vardą:{B8B8B8} %s{FFFFFF} duomenų bazėje radome\nPraљome įvesti slaptaћodį:",pName);
					ShowPlayerDialog(playerid, 2, DIALOG_STYLE_PASSWORD, "{FFFFFF}Sveikas[{FF0000}-a{FFFFFF}] sugrįћęs[{FF0000}-usi{FFFFFF}]! Prisijunk.", string1, "Tęsti","Iљeiti");
					return SendClientMessage(playerid,SPALVA_RAUDONA,"Įvedėte neteisingą slaptaћodį, bandykite dar kartą.");
				}
				mysql_free_result();
			}
			return 1;
		}
		else if(!response)
		{
			SendClientMessage(playerid, -1, "Pasirinkote mygtuką* {FF0000}Iљeiti{FFFFFF}, norėdami iљjungti ћaidimą*, raљykite {FF0000}/q");
			Kick(playerid);
			return 1;
		}
	}
And here is my server log with crashdetect output:

Код:
[16:46:19] [join] KerVLa has joined the server (0:62.212.200.238)
[16:46:23] [debug] Server crashed while executing FreeRoam.amx
[16:46:23] [debug] AMX backtrace:
[16:46:23] [debug] #0 native mysql_fetch_field_row () [b74467a0] from mysql.so
[16:46:23] [debug] #1 0000e63c in ?? () from FreeRoam.amx
[16:46:23] [debug] #2 0000bdb0 in public OnDialogResponse () from FreeRoam.amx
[16:46:23] [debug] System backtrace:
[16:46:23] [debug] #0 b6915f41 in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[16:46:23] [debug] #1 b690c41f in _ZN11crashdetect20PrintSystemBacktraceEPv () from plugins/crashdetect.so
[16:46:23] [debug] #2 b690a963 in _ZN11crashdetect15SystemExceptionEPv () from plugins/crashdetect.so
[16:46:23] [debug] #3 b69153c1 in ?? () from plugins/crashdetect.so
[16:46:23] [debug] #4 b76f3600 in ?? ()
[16:46:23] [debug] #5 b74c4453 in strlen () from /lib/libc.so.6
[16:46:23] [debug] #6 b76717f0 in _ZNKSs7compareEPKc () from /usr/lib/libstdc++.so.6
[16:46:23] [debug] #7 b7441973 in _ZN13CMySQLHandler10FetchFieldESs () from plugins/mysql.so
[16:46:23] [debug] #8 b7446820 in _ZN7Natives23n_mysql_fetch_field_rowEP6tagAMXPi () from plugins/mysql.so
[16:46:23] [debug] #9 08093d14 in ?? () from ./samp03svr
[16:46:23] [debug] #10 b690b5a2 in _ZN11crashdetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so
[16:46:23] [debug] #11 b691365e in ?? () from plugins/crashdetect.so
[16:46:23] [debug] #12 b691a926 in amx_Exec () from plugins/crashdetect.so
[16:46:23] [debug] #13 b690b622 in _ZN11crashdetect9DoAmxExecEPii () from plugins/crashdetect.so
[16:46:23] [debug] #14 b6913699 in ?? () from plugins/crashdetect.so
[16:46:23] [debug] #15 080ae3bf in ?? () from ./samp03svr
[16:46:23] [debug] #16 080b97e4 in ?? () from ./samp03svr
[16:46:23] [debug] #17 08071b48 in ?? () from ./samp03svr
[16:46:23] [debug] #18 08071c42 in ?? () from ./samp03svr
[16:46:23] [debug] #19 0807ba60 in ?? () from ./samp03svr
[16:46:23] [debug] #20 080b5a2d in ?? () from ./samp03svr
[16:46:23] [debug] #21 080b5bc2 in ?? () from ./samp03svr
[16:46:23] [debug] #22 080b14d3 in ?? () from ./samp03svr
[16:46:23] [debug] #23 b7467c96 in __libc_start_main () from /lib/libc.so.6
[16:46:23] [debug] #24 0804b521 in ?? () from ./samp03svr
Reply
#2

Goto pawno directory and create a file called pawn.cfg. Open the file and write in it:
pawn Код:
-d3
Save it and re-compile FreeRoam.pwn

The next time the server will crash, it will most likely print the line caused the crash.
Reply
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Goto pawno directory and create a file called pawn.cfg. Open the file and write in it:
pawn Код:
-d3
Save it and re-compile FreeRoam.pwn

The next time the server will crash, it will most likely print the line caused the crash.
I do the things that you say in my computer, and after compiling I copied FreeRoam.amx to my VPS root directory and run the server, but when it crashes, in server log nothing changes, the crashdetect send same text
Reply
#4

It doesn't always send the line, but it was a hope!

Anyways, it seems you need to find it yourself. Search for mysql_fetch_field_row in OnDialogResponse, that's the function which caused it. Although, I'm not really sure why it did that - it's the first time I see a crash from that function.
Reply
#5

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
It doesn't always send the line, but it was a hope!

Anyways, it seems you need to find it yourself. Search for mysql_fetch_field_row in OnDialogResponse, that's the function which caused it. Although, I'm not really sure why it did that - it's the first time I see a crash from that function.
I fixed the problem. Problem was - bad mysql plugin, I downloaded new one and it works fine. Thanks for help. [LOCK]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)