server crash on windows system
#1

server crash, the log says this??
server on my windows machine, whether it is difficult to divert to linux or I have to see the hosting

Код:
[21:34:34] OnDialogResponse 1, 323
[21:34:47] [debug] Server crashed while executing NLRP.amx
[21:34:47] [debug] AMX backtrace:
[21:34:47] [debug] #0 native fwrite () from samp-server.exe
[21:34:47] [debug] #1 00092da8 in ?? (76110148) from NLRP.amx
[21:34:47] [debug] #2 0046ac70 in public OnPlayerCommandPerformed (0, 74111428, 0) from NLRP.amx
[21:34:47] [debug] #3 native CallLocalFunction () from samp-server.exe
[21:34:47] [debug] #4 0000423c in public OnPlayerCommandText (0, 74111376) from NLRP.amx
[21:34:47] [debug] Native backtrace:
[21:34:47] [debug] #0 77080fb2 in ?? () from C:\Windows\SYSTEM32\ntdll.dll
[21:34:47] [debug] #1 00498bb8 in ?? () from samp-server.exe
[21:34:47] [debug] #2 0040531e in ?? () from samp-server.exe
Reply
#2

Invalid file handle crash the server. In other words, you cannot write to a not opened file.

I assume you have some sort of "Log" in OnPlayerCommandPerformed callback, right? To be more precise, a function that is used in OnPlayerCommandPerformed calls fwrite. In order to prevent this, checking if the file handle (what fopen returned) is not 0 call the file functions is a solution.

pawn Код:
// Wrong way:
new File: fhandle = fopen(...);
fwrite(fhandle, ...);
fclose(fhandle);
pawn Код:
// Correct way:
new File: fhandle = fopen(...);
if (fhandle) // file opened
{
    fwrite(fhandle, ...);
    fclose(fhandle);
}
---

Last, compile with -d3 flag to get more detailed output from crashdetect (exact line): https://github.com/Zeex/samp-plugin-...ith-debug-info
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)