PDA

View Full Version : crashdetect


FinStar
23/04/2015, 05:44 PM
[OnGameModeExit] Shutting down...
[19:18:22] [debug] Server crashed while executing ScavengeSurvive.amx
[19:18:22] [debug] AMX backtrace:
[19:18:22] [debug] #0 native fread () from samp-server.exe
[19:18:22] [debug] #1 003035b8 in ?? () at C:\Users\Shitcomputer\Desktop\Server\gamemodes\Sca vengeSurvive.pwn:615
[19:18:22] [debug] #2 0000f540 in public ScriptInit_OnGameModeExit () at C:\Users\Shitcomputer\Desktop\Server\pawno\include \YSI\y_hooks/impl.inc:516
[19:18:22] [debug] #3 00007674 in public OnGameModeExit () at C:\Users\Shitcomputer\Desktop\Server\pawno\include \YSI\internal\..\y_scriptinit.inc:269
[19:18:23] [debug] Native backtrace:
[19:18:23] [debug] #0 76eb77a2 in ?? () from C:\Windows\SYSTEM32\ntdll.dll
[19:18:23] [debug] #1 004943b0 in ?? () from samp-server.exe
[19:18:23] [debug] #2 004949e0 in ?? () from samp-server.exe
[19:18:23] [debug] #3 00404f14 in ?? () from samp-server.exe

Konstantinos
23/04/2015, 05:47 PM
http://wiki.sa-mp.com/wiki/Fread

Read the "Warning" box because that's the reason your server crash.

There are also examples below it so you can understand how to prevent it (by checking if the file handle is valid).

PS: It's in the line 615.

FinStar
23/04/2015, 06:44 PM
public OnGameModeExit()
{
print("\n[OnGameModeExit] Shutting down...");

new File:f = fopen("nonexistentfile", io_read), _s[1];
fread(f, _s); // 615 Line
fclose(f);

return 1;
}

Konstantinos
23/04/2015, 06:56 PM
new File:f = fopen("nonexistentfile", io_read), _s[1];
if (f)
{
fread(f, _s); // 615 Line
fclose(f);
}

FinStar
24/04/2015, 12:53 PM
That did not work, the server still restarts

Konstantinos
24/04/2015, 12:56 PM
That did not work, the server still restarts

There is a difference between server crash and server restart. File functions crash the server with invalid handles. If the file was not opened correctly, it'll just not write/read and close the file to prevent it (that's what the code does).

If your server restarting for an unknown reason, the problem is somewhere else.