Server crashing
#1

Hello, my server crashes when I start it, I'm going to pass the server log, I put the crashdetect and it sends me this:
PD: i renamed samp03svr to misv


----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3.7-R2, ©2005-2015 SA-MP Team

[15:31:57] filterscripts = "" (string)
[15:31:57] password = "" (string)
[21/05/2017 15:31:57]
[21/05/2017 15:31:57] Server Plugins
[21/05/2017 15:31:57] --------------
[21/05/2017 15:31:57] Loading plugin: crashdetect.so
[21/05/2017 15:31:57] CrashDetect v4.12 is OK.
[21/05/2017 15:31:57] Loaded.
[21/05/2017 15:31:57] Loading plugin: streamer.so
[21/05/2017 15:31:57]

*** Streamer Plugin v2.9.1 by Incognito loaded ***

[21/05/2017 15:31:57] Loaded.
[21/05/2017 15:31:57] Loading plugin: mysql_static.so
[21/05/2017 15:31:57] >> plugin.mysql: R39 successfully loaded.
[21/05/2017 15:31:57] Loaded.
[21/05/2017 15:31:57] Loading plugin: sscanf.so
[21/05/2017 15:31:57]

[21/05/2017 15:31:57] ===============================

[21/05/2017 15:31:57] sscanf plugin loaded.

[21/05/2017 15:31:57] Version: 2.8.1

[21/05/2017 15:31:57] © 2012 Alex "******" Cole

[21/05/2017 15:31:57] ===============================

[21/05/2017 15:31:57] Loaded.
[21/05/2017 15:31:57] Loading plugin: Whirlpool.so
[21/05/2017 15:31:57]
[21/05/2017 15:31:57] ==================
[21/05/2017 15:31:57]
[21/05/2017 15:31:57] Whirlpool loaded
[21/05/2017 15:31:57]
[21/05/2017 15:31:57] ==================
[21/05/2017 15:31:57]
[21/05/2017 15:31:57] Loaded.
[21/05/2017 15:31:57] Loaded 5 plugins.

[21/05/2017 15:31:57]
[21/05/2017 15:31:57] Ban list
[21/05/2017 15:31:57] --------
[21/05/2017 15:31:57] Loaded: samp.ban
[21/05/2017 15:31:57]
[21/05/2017 15:31:57]
[21/05/2017 15:31:57] Filterscripts
[21/05/2017 15:31:57] ---------------
[21/05/2017 15:31:57] Loaded 0 filterscripts.

[21/05/2017 15:31:57]
[21/05/2017 15:31:57]
[21/05/2017 15:31:57]
[21/05/2017 15:31:57] =======================================
[21/05/2017 15:31:57] | |
[21/05/2017 15:31:57] | YSI version 3.09.0684 |
[21/05/2017 15:31:57] | By Alex "******" Cole |
[21/05/2017 15:31:57] | |
[21/05/2017 15:31:57] =======================================
[21/05/2017 15:31:57]
[21/05/2017 15:31:57] [debug] Server crashed while executing eastr.amx
[21/05/2017 15:31:57] [debug] AMX backtrace:
[21/05/2017 15:31:57] [debug] #0 native fclose () [0809bd50] from misv
[21/05/2017 15:31:57] [debug] #1 0001c798 in ?? (0x008ef1d from eastr.amx
[21/05/2017 15:31:57] [debug] #2 0001cce8 in ?? () from eastr.amx
[21/05/2017 15:31:57] [debug] #3 000d040c in public OnPlPa_OnGameModeInit () from eastr.amx
[21/05/2017 15:31:57] [debug] #4 native CallLocalFunction () [080dfac0] from misv
[21/05/2017 15:31:57] [debug] #5 00018274 in public zcmd_OnGameModeInit () from eastr.amx
[21/05/2017 15:31:57] [debug] #6 native CallLocalFunction () [080dfac0] from misv
[21/05/2017 15:31:57] [debug] #7 00017998 in public SSCANF_OnGameModeInit () from eastr.amx
[21/05/2017 15:31:57] [debug] #8 00011d00 in public ppb_OnGameModeInit () from eastr.amx
[21/05/2017 15:31:57] [debug] #9 00010fd0 in public Itter_OnGameModeInit () from eastr.amx
[21/05/2017 15:31:57] [debug] #10 native CallLocalFunction () [080dfac0] from misv
[21/05/2017 15:31:57] [debug] #11 00001574 in public ScriptInit_OnGameModeInit () from eastr.amx
[21/05/2017 15:31:57] [debug] #12 0000055c in public OnGameModeInit () from eastr.amx
[21/05/2017 15:31:57] [debug] Native backtrace:
[21/05/2017 15:31:57] [debug] #0 f73bba5b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[21/05/2017 15:31:57] [debug] #1 f73b4852 in _ZN11CrashDetect20PrintNativeBacktraceERSoPv () from plugins/crashdetect.so
[21/05/2017 15:31:57] [debug] #2 f73b535c in _ZN11CrashDetect20PrintNativeBacktraceEPv () from plugins/crashdetect.so
[21/05/2017 15:31:57] [debug] #3 f73b586e in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so
[21/05/2017 15:31:57] [debug] #4 f73bb76d in ?? () from plugins/crashdetect.so
[21/05/2017 15:31:57] [debug] #5 f76ef420 in ?? ()
[21/05/2017 15:31:57] [debug] #6 f742cb36 in fclose () from /lib32/libc.so.6
[21/05/2017 15:31:57] [debug] #7 0809bd64 in ?? () from ./misv
[21/05/2017 15:31:57] [debug] #8 080950e4 in ?? () from ./misv
[21/05/2017 15:31:57] [debug] #9 f73b210c in _ZN11CrashDetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so
[21/05/2017 15:31:57] [debug] #10 f73b7348 in ?? () from plugins/crashdetect.so
[21/05/2017 15:31:57] [debug] #11 f73bddb5 in amx_Exec () from plugins/crashdetect.so
[21/05/2017 15:31:57] [debug] #12 f73b46ab in _ZN11CrashDetect9DoAmxExecEPii () from plugins/crashdetect.so
[21/05/2017 15:31:57] [debug] #13 f73b7149 in ?? () from plugins/crashdetect.so
[21/05/2017 15:31:57] [debug] #14 f6975826 in ?? () from plugins/streamer.so
[21/05/2017 15:31:57] [debug] #15 080dfd62 in ?? () from ./misv
[21/05/2017 15:31:57] [debug] #16 080950e4 in ?? () from ./misv
[21/05/2017 15:31:57] [debug] #17 f73b210c in _ZN11CrashDetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so
[21/05/2017 15:31:57] [debug] #18 f73b7348 in ?? () from plugins/crashdetect.so
[21/05/2017 15:31:57] [debug] #19 f73bddb5 in amx_Exec () from plugins/crashdetect.so
[21/05/2017 15:31:57] [debug] #20 f73b46ab in _ZN11CrashDetect9DoAmxExecEPii () from plugins/crashdetect.so
[21/05/2017 15:31:57] [debug] #21 f73b7149 in ?? () from plugins/crashdetect.so
[21/05/2017 15:31:57] [debug] #22 f6975826 in ?? () from plugins/streamer.so
[21/05/2017 15:31:57] [debug] #23 080dfd62 in ?? () from ./misv
[21/05/2017 15:31:57] [debug] #24 080950e4 in ?? () from ./misv
[21/05/2017 15:31:57] [debug] #25 f73b210c in _ZN11CrashDetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so
[21/05/2017 15:31:57] [debug] #26 f73b7348 in ?? () from plugins/crashdetect.so
[21/05/2017 15:31:57] [debug] #27 f73bddb5 in amx_Exec () from plugins/crashdetect.so
[21/05/2017 15:31:57] [debug] #28 f73b46ab in _ZN11CrashDetect9DoAmxExecEPii () from plugins/crashdetect.so
[21/05/2017 15:31:57] [debug] #29 f73b7149 in ?? () from plugins/crashdetect.so
[21/05/2017 15:31:57] [debug] #30 f6975826 in ?? () from plugins/streamer.so
[21/05/2017 15:31:57] [debug] #31 080dfd62 in ?? () from ./misv
[21/05/2017 15:31:57] [debug] #32 080950e4 in ?? () from ./misv
[21/05/2017 15:31:57] [debug] #33 f73b210c in _ZN11CrashDetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so
[21/05/2017 15:31:57] [debug] #34 f73b7348 in ?? () from plugins/crashdetect.so
[21/05/2017 15:31:57] [debug] #35 f73bddb5 in amx_Exec () from plugins/crashdetect.so
[21/05/2017 15:31:57] [debug] #36 f73b46ab in _ZN11CrashDetect9DoAmxExecEPii () from plugins/crashdetect.so
[21/05/2017 15:31:57] [debug] #37 f73b7149 in ?? () from plugins/crashdetect.so
[21/05/2017 15:31:57] [debug] #38 f6975826 in ?? () from plugins/streamer.so
[21/05/2017 15:31:57] [debug] #39 080a503b in ?? () from ./misv
[21/05/2017 15:31:57] [debug] #40 080ab922 in ?? () from ./misv
[21/05/2017 15:31:57] [debug] #41 080aa0fd in ?? () from ./misv
[21/05/2017 15:31:57] [debug] #42 f73e3ad3 in __libc_start_main () from /lib32/libc.so.6
Reply
#2

Quote:
Код:
[21/05/2017 15:31:57] [debug] #0 native fclose () [0809bd50] from misv
ALWAYS check for a valid file handle before using any of the file functions, else your server will crash if the file cannot be accessed. There are big red warnings boxes on all of those wiki pages that state this.
Reply
#3

Can you tell me how to fix that?
Reply
#4

  1. Here's what Vince means :
  2. To fix it, use an "if" statement to check if handle's valid, if you don't know how to... show the code where you try to close a file using fclose.
Reply
#5

Код:
stock fcreate(filename[])
{
	if(fexist(filename)) return false;
	new File:file = fopen(filename, io_write);
	return fclose(file);
}
Код:
stock SaveActors()
{
	new string[512], File: file;
	if(!fexist("ActorStudio.ini")) fcreate("ActorStudio.ini");

	if(fexist("ActorStudio.ini"))
	{
	    file = fopen("ActorStudio.ini", io_write);
	    for(new a; a < MAX_ACTORS; a++)
	    {
	        format(string, sizeof(string), "%d|%.02f|%.02f|%.02f|%.02f|%d|%s|%.02f|%s|%d|%d|%d|%d|%d|%.02f\r\n",
	        AI[a][aModel],
	        AI[a][aX],
	        AI[a][aY],
	        AI[a][aZ],
	        AI[a][aR],
	        AI[a][aVW],
	        AI[a][aAnimLib],
	        AI[a][aAnimDelta],
	        AI[a][aAnimName],
	        AI[a][aAnimLoop],
	        AI[a][aAnimLockX],
	        AI[a][aAnimLockY],
	        AI[a][aAnimFreeze],
	        AI[a][aAnimTime],
			AI[a][aDynamicAreaRadius]);
	        fwrite(file, string);
	    }
	}
	return fclose(file);
}
Код:
fwrite(file, string);
		fwrite(file, "\r\n");
		fclose(file);
Код:
fwrite(file, str);
	fwrite(file, "\r\n");
	fclose(file);
Код:
Server_Save()
{
	new
	    File:file = fopen("server.ini", io_write),
	    str[128];

	format(str, sizeof(str), "TaxMoney = %d\n", g_TaxVault);
	return (fwrite(file, str), fclose(file));
}
Код:
Server_Load()
{
	new File:file = fopen("server.ini", io_read);

	if (file) {
		g_TaxVault = file_parse_int(file, "TaxMoney");

		fclose(file);
	}
	return 1;
}
Reply
#6

change the fcreate stock to this:
PHP код:
stock fcreate(filename[])
{
    if(
fexist(filename)) return false;
    new 
File:file fopen(filenameio_write);
    new 
File:handle fopen(filenameio_append);
    if(!
handle) return false;
    return 
fclose(file);

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)