Weird Crash Log
#1

Code:
[00:31:46] [debug] Server crashed while executing LS-CNR.amx
[00:31:46] [debug] AMX backtrace:
[00:31:46] [debug] #0 native fclose () from samp03svr
[00:31:46] [debug] #1 000ff46c in public WriteInLog (3057432, 20796012) from LS-CNR.amx
[00:31:46] [debug] #2 000ff250 in public UpdateAdminLog (20796012) from LS-CNR.amx
[00:31:46] [debug] #3 001707b0 in ?? (0, 20535532, 0) from LS-CNR.amx
[00:31:46] [debug] #4 0004d4f8 in ?? (0, 20535508, 0) from LS-CNR.amx
[00:31:46] [debug] #5 0004fe54 in ?? (0, 20535508, 0, 0, 0, 8, 0, 20535508, 0, 0, ... <1073741813 arguments>) from LS-CNR.amx
[00:31:46] [debug] #6 000230f4 in public OnPlayerCommandText (0, 20535508) from LS-CNR.amx
[00:31:46] [debug] Native backtrace:
[00:31:46] [debug] #0 f666de8b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[00:31:46] [debug] #1 f6666bcf in _ZN11CrashDetect20PrintNativeBacktraceERSoPv () from plugins/crashdetect.so
[00:31:46] [debug] #2 f6667dbc in _ZN11CrashDetect20PrintNativeBacktraceEPv () from plugins/crashdetect.so
[00:31:46] [debug] #3 f6668226 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so
[00:31:46] [debug] #4 f666dadc in ?? () from plugins/crashdetect.so
[00:31:46] [debug] #5 f77a2420 in ?? ()
[00:31:46] [debug] #6 f74af506 in fclose () from /lib/i386-linux-gnu/libc.so.6
[00:31:46] [debug] #7 0809bd64 in ?? () from ./samp03svr
[00:31:46] [debug] #8 080950e4 in ?? () from ./samp03svr
[00:31:46] [debug] #9 f666994b in _ZN11CrashDetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so
[00:31:46] [debug] #10 f666c8f8 in ?? () from plugins/crashdetect.so
[00:31:46] [debug] #11 f6670916 in amx_Exec () from plugins/crashdetect.so
[00:31:46] [debug] #12 f6668be6 in _ZN11CrashDetect9DoAmxExecEPii () from plugins/crashdetect.so
[00:31:46] [debug] #13 f666c659 in ?? () from plugins/crashdetect.so
[00:31:46] [debug] #14 f62744f6 in ?? () from plugins/streamer.so
[00:31:46] [debug] #15 080a5632 in ?? () from ./samp03svr
[00:31:46] [debug] #16 080b1751 in ?? () from ./samp03svr
[00:31:46] [debug] #17 08071d38 in ?? () from ./samp03svr
[00:31:46] [debug] #18 08071e32 in ?? () from ./samp03svr
[00:31:46] [debug] #19 0807bc50 in ?? () from ./samp03svr
[00:31:46] [debug] #20 080aed3d in ?? () from ./samp03svr
[00:31:46] [debug] #21 080aef02 in ?? () from ./samp03svr
[00:31:46] [debug] #22 080aa13a in ?? () from ./samp03svr
[00:31:46] [debug] #23 f7465af3 in __libc_start_main () from /lib/i386-linux-gnu/libc.so.6
The server works fine until i use a command. I found this in logs when i included crashdetect in plugins.. Can anyone help me?
Reply
#2

Your file write or close has an issue, check the file that the function that's erroring writes to, it may be absent, or it could be incorrect permissions on the file.

WriteInLog
UpdateAdminLog

These 2 functions are where that file should be written to, and that file is likely to be the one having issues.
Reply
#3

Code:
FUNCTION:WriteInLog(destinationFile[], stringToWrite[])
{
	new
		logFile[32] = "Logs/", date, month, year, hour, minute;
	getdate(date, month, year);
	gettime(hour, minute);
	strcat(logFile, destinationFile);
    if(!fexist(logFile))
    {
        new
			File:fileToCreate = fopen(logFile, io_write);

        fclose(fileToCreate);
    }
    new
		stringForLogging[512];
	format(stringForLogging, 512, "<font color='red'>%d/%d/%d (%d:%d) </font>%s<br/>", date, month, year, hour, minute, stringToWrite);
    new
		File:fileToAppend = fopen(logFile, io_append);
    fwrite(fileToAppend, stringForLogging);
    fclose(fileToAppend);
    return 1;
}
Code:
FUNCTION:UpdateAdminLog(text[])
{
	for(new i = 4; i > 0; i--)
		format(AdminLog[i], 256, "%s", AdminLog[i - 1]);
	format(AdminLog[0], 256, "%s", text);
	for(new i = 0; i < 5; i++)
		TextDrawSetString(GM[AdminLogTD][i], AdminLog[i]);
	WriteInLog("AdminLog.html", text);
	return 1;
}
I've double checked. The files are present to which the function is writing. I'm not sure how i can manage permissions through FTP.
Reply
#4

Alright, saw some tutorials on how to edit the permissions and Kaboom. It's working now. All thanks to you.
Reply
#5

That's the good stuff right there...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)