Server Crash - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Server Crash (
/showthread.php?tid=422117)
Server Crash -
DarkB0y - 12.03.2013
My server run for short time than it crash idk why but i have put crashdetect plugin and i found this
Код:
[16:17:18] [debug] Server crashed while executing LuxAdmin.amx
[16:17:18] [debug] AMX backtrace:
[16:17:18] [debug] #0 native fclose () [0809a900] from samp03svr-port_7070
[16:17:18] [debug] #1 0007b3a4 in public SaveTeleport () from LuxAdmin.amx
[16:17:18] [debug] System backtrace:
[16:17:18] [debug] #0 00363ecb in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[16:17:18] [debug] #1 0035bc69 in _ZN11CrashDetect20PrintSystemBacktraceEPv () from plugins/crashdetect.so
[16:17:18] [debug] #2 0035dc99 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so
[16:17:18] [debug] #3 003639d8 in ?? () from plugins/crashdetect.so
[16:17:18] [debug] #4 00d82600 in ?? ()
[16:17:18] [debug] #5 00260127 in fclose () from /lib/libc.so.6
[16:17:18] [debug] #6 0809a914 in ?? () from ./samp03svr-port_7070
[16:17:18] [debug] #7 08093c94 in ?? () from ./samp03svr-port_7070
[16:17:18] [debug] #8 0035df37 in _ZN11CrashDetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so
[16:17:18] [debug] #9 00360268 in ?? () from plugins/crashdetect.so
[16:17:18] [debug] #10 003662c2 in amx_Exec () from plugins/crashdetect.so
[16:17:18] [debug] #11 0035de1e in _ZN11CrashDetect9DoAmxExecEPii () from plugins/crashdetect.so
[16:17:18] [debug] #12 003602de in ?? () from plugins/crashdetect.so
[16:17:18] [debug] #13 080dc025 in ?? () from ./samp03svr-port_7070
[16:17:18] [debug] #14 080b5c7b in ?? () from ./samp03svr-port_7070
[16:17:18] [debug] #15 080b1453 in ?? () from ./samp03svr-port_7070
[16:17:18] [debug] #16 0021bc96 in __libc_start_main () from /lib/libc.so.6
[16:17:18] [debug] #17 0804b521 in ?? () from ./samp03svr-port_7070
Re: Server Crash -
Misiur - 12.03.2013
fclose might crash server when the file handle is invalid. Without code this is as much I can tell (I don't know anything about luxadmin)
Re: Server Crash -
DarkB0y - 12.03.2013
all the codes are fine no errors/warrnings and all files are exist in the host
Re: Server Crash -
DarkB0y - 13.03.2013
can any one help ?
Re: Server Crash -
Threshold - 13.03.2013
Show us each function ABOVE, BELOW and INCLUDING the SaveTeleport function.
Код:
[16:17:18] [debug] #1 0007b3a4 in public SaveTeleport () from LuxAdmin.amx
Re: Server Crash -
DarkB0y - 13.03.2013
pawn Код:
public SaveTeleport()
{
new File:TPFile = fopen("LuxAdmin/Config/CreatedTeles.cfg", io_write);
new tpstring[256];
for(new t=0;t<MAX_CTELES;t++)
{
if(CTeleInfo[t][TValid] == 1)
{
format(tpstring, sizeof(tpstring), "%s,%f,%f,%f,%f,%d\r\n",CTeleInfo[t][TName],CTeleInfo[t][PosX],CTeleInfo[t][PosY],CTeleInfo[t][PosZ],CTeleInfo[t][PosA],CTeleInfo[t][PosInt]);
fwrite(TPFile, tpstring);
}
}
fclose(TPFile);
}
Re: Server Crash -
Threshold - 13.03.2013
First of all, change
io_write to
io_append. At least this way, if a file is missing, it will create it for you.
Add this line to the TOP of the SaveTeleport function:
pawn Код:
if(!fexist("LuxAdmin/Config/CreatedTeles.cfg")) return 0;
The server may be crashing due to you opening a file that doesn't exist. Either do the following that I have listed above (io_append is definitely recommended however), otherwise make sure that the file in your script files directory exists. File path: "scriptfiles/LuxAdmin/Config/CreatedTeles.cfg"
If nine of those folders, directories or files exist, I would recommend that you create them...