Server Crash
#1

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
Reply
#2

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)
Reply
#3

all the codes are fine no errors/warrnings and all files are exist in the host
Reply
#4

can any one help ?
Reply
#5

Show us each function ABOVE, BELOW and INCLUDING the SaveTeleport function.
Код:
[16:17:18] [debug] #1 0007b3a4 in public SaveTeleport () from LuxAdmin.amx
Reply
#6

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);
}
Reply
#7

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...
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)