Server Crash
#1

Hello, i have a report system, and i have a cod in my global timer (1000) and when is executed the server crash, i don't know why , its maybe because of Iterator?

This is my code:

Код:
new Iterator:Reports<MAX_REPORTS>;

task servertimer_global[1000]() {
   foreach(new x : Reports) {
		if(Reports[x][vaLide] && (gettime()-Reports[x][Time]) > 499) {
			Reports[x][vaLide] = 0;
			Reports[x][Type] = 0;
                        Reports[x][rFrom] = INVALID_PLAYER_ID;
			Reports[x][rTo] = INVALID_PLAYER_ID;
			format(Reports[x][message], 256, "NULL");
			Iter_Remove(Reports, x);
		}
	}
}
What is the problem?
Reply
#2

bump
Reply
#3

Code looks good. Do you use crashdetect?
No? https://github.com/Zeex/samp-plugin-...es/tag/v4.18.1
If yes, do you compile with -d3 flag?
No? https://github.com/Zeex/samp-plugin-...ith-debug-info
Reply
#4

Quote:
Originally Posted by Misiur
Посмотреть сообщение
Code looks good. Do you use crashdetect?
No? https://github.com/Zeex/samp-plugin-...es/tag/v4.18.1
If yes, do you compile with -d3 flag?
No? https://github.com/Zeex/samp-plugin-...ith-debug-info
Yes i use crashdetect, but in server logs doesn't appear anything.

And about -3d flag, i compile with sublime text 3 I already done this when i use pawn but now in sublime it doesn't show the details like below:
Код:
Header size:           14904 bytes
Code size:           2547064 bytes
Data size:          20795764 bytes
Stack/heap size:       16384 bytes; estimated max. usage: 1234 cells
Total requirements: 23374116 bytes
I don't know why.. if you can give me some advices it will be perfect.

About the problem, i solved, the problem was i can't use Iter_Remove in a loop, you need to use Iter_SafeRemove
Reply
#5

Hm, I don't remember if -d3 made that always visible. I use -v2 as well just to be certain. Are you using custom PAWN.sublime-build? Mine looks like this
Код:
{
	"cmd": ["${project_path:${folder}}\\pawno\\pawncc.exe", "${project_base_name}.pwn", "-;+", "-v2", "-d3", "-\\)+"],
	"working_dir": "${project_path:${folder}}\\gamemodes",
	"file_regex": "^([^\\.]+\\.pwn)\\((\\d+)\\)() : (.*)$",
	"variants": [
		{
			"cmd": ["${project_path:${folder}}\\pawno\\pawncc.exe", "${project_base_name}.pwn", "-;+", "-v2", "-d3", "-\\)+"],
			"working_dir": "${project_path:${folder}}\\filterscripts",
			"name": "Filterscript"
		},
		{
			"cmd": ["${project_path:${folder}}\\pawno\\pawncc.exe", "${file_name}", "-;+", "-v2", "-d3", "-\\)+"],
			"working_dir": "${file_path}",
			"name": "Current file"
		},
		{
			"cmd": ["${project_path:${folder}}\\pawno\\pawncc.exe", "${file_name}", "-l", "-;+", "-v2", "-d3", "-\\)+"],
			"working_dir": "${file_path}",
			"name": "Current file preprocessed"
		},
		{
			"cmd": ["${project_path:${folder}}\\pawno\\pawncc.exe", "${file_name}", "-a", "-;+", "-v2", "-d3", "-\\)+"],
			"working_dir": "${file_path}",
			"name": "Current file pcode"
		}
	]
}
This way I can push ctrl+b in any file and the gamemodes/sublime_project_name.pwn is compiled by default
Reply
#6

Quote:
Originally Posted by Misiur
Посмотреть сообщение
Hm, I don't remember if -d3 made that always visible. I use -v2 as well just to be certain. Are you using custom PAWN.sublime-build? Mine looks like this
Код:
{
	"cmd": ["${project_path:${folder}}\\pawno\\pawncc.exe", "${project_base_name}.pwn", "-;+", "-v2", "-d3", "-\\)+"],
	"working_dir": "${project_path:${folder}}\\gamemodes",
	"file_regex": "^([^\\.]+\\.pwn)\\((\\d+)\\)() : (.*)$",
	"variants": [
		{
			"cmd": ["${project_path:${folder}}\\pawno\\pawncc.exe", "${project_base_name}.pwn", "-;+", "-v2", "-d3", "-\\)+"],
			"working_dir": "${project_path:${folder}}\\filterscripts",
			"name": "Filterscript"
		},
		{
			"cmd": ["${project_path:${folder}}\\pawno\\pawncc.exe", "${file_name}", "-;+", "-v2", "-d3", "-\\)+"],
			"working_dir": "${file_path}",
			"name": "Current file"
		},
		{
			"cmd": ["${project_path:${folder}}\\pawno\\pawncc.exe", "${file_name}", "-l", "-;+", "-v2", "-d3", "-\\)+"],
			"working_dir": "${file_path}",
			"name": "Current file preprocessed"
		},
		{
			"cmd": ["${project_path:${folder}}\\pawno\\pawncc.exe", "${file_name}", "-a", "-;+", "-v2", "-d3", "-\\)+"],
			"working_dir": "${file_path}",
			"name": "Current file pcode"
		}
	]
}
This way I can push ctrl+b in any file and the gamemodes/sublime_project_name.pwn is compiled by default
hmm I have just that:
Код:
{
	"cmd": ["pawncc.exe", "-i includes", "$file", "-;+"],
	"path": "D:/Gamemode/gamemode/pawno"
}
Tutorial source: https://sampforum.blast.hk/showthread.php?tid=626423
Reply
#7

Sure, that's enough too, but I'd recommend always having -d3 flag set (unless you really see some weird stuff in production I guess). If you want the box with stats always showing, just add -v2 flag
Reply
#8

Quote:
Originally Posted by Misiur
Посмотреть сообщение
Sure, that's enough too, but I'd recommend always having -d3 flag set (unless you really see some weird stuff in production I guess). If you want the box with stats always showing, just add -v2 flag
Yeah, thanks , I steal something from your code ) and it works perfectly.

A little question, why i get this message
Код:
estimated max. usage: unknown, due to recursion
How can I fix?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)