Run time error 3 stack heap collision insufficient stack size

Hello there crashdetect plugin print this code into server_log, Code: Run time error 3: "Stack/heap collision (insufficient stack size)" Stack pointer (STK) is 0x434C28, heap pointer (HEA) is 0x434DB4

Posts: 867
Threads: 104
Joined: Jul 2010

Reputation:

0

Hello there crashdetect plugin print this code into server_log,

Code:

[18:54:31] [debug] Run time error 3: "Stack/heap collision (insufficient stack size)"
[18:54:31] [debug]  Stack pointer (STK) is 0x434C28, heap pointer (HEA) is 0x434DB4

I was just wondering will this in example reduce stack size

This:

pawn Code:

stock funtion1(playerid){
    new mystr[64];
    format(mystr, sizeof(mystr), "Example %d", 1);
}

stock funtion2(playerid){
    new mystr[64];
    format(mystr, sizeof(mystr), "Example %d", 2);
}

stock funtion3(playerid){
    new mystr[64];
    format(mystr, sizeof(mystr), "Example %d", 3);
}

change to this:

pawn Code:

new mystr[MAX_PLAYERS][128];

stock funtion1(playerid){
    format(mystr[playerid], 64, "Example %d", 1);
}

stock funtion2(playerid){
    format(mystr[playerid], 64, "Example %d", 2);
}

stock funtion3(playerid){
    format(mystr[playerid], 64, "Example %d", 3);
}

I guess you all understand what I what to say… Is this good way to start optimizing script?

Posts: 867
Threads: 104
Joined: Jul 2010

Reputation:

0

but there was no problem before I added pArray[30][30][MAX_PLAYER_NAME]; and some other vars like Query in almost every command that uses database.

Here is my compile message:

Code:

Header size:          12440 bytes
Code size:           555908 bytes
Data size:          4338708 bytes
Stack/heap size:      16384 bytes; estimated max. usage=4653 cells (18612 bytes)
Total requirements: 4923440 bytes

I removed pArray[30][30][MAX_PLAYER_NAME]. But message is still there..

Here is part of code that causes that also started showing that message:

pawn Code:

stock SendTranslate(playerid, color, message[]){
    SendClientMessage(playerid, color, Translate(playerid, message));
    return true;
}

stock Translate(playerid, const message[]){
    new tmpstr[255], tmpmsg[255];
    format(tmpmsg, sizeof(tmpmsg), "%s", message);
    if(!IsPlayerConnected(playerid)) return tmpstr;
    if(!PlayerInfos[playerid][pLanguage]) return tmpmsg;
    else {
        format(tmpstr, sizeof(tmpstr), "%s", dini_Get("Croatian.lng", tmpmsg));
        if(strlen(tmpstr)) return tmpstr;
        else return tmpmsg;
    }
}

Now I think it is this Translate function that causes stack collision

Posts: 867
Threads: 104
Joined: Jul 2010

Reputation:

0

So, what do you suggest me to do

Posts: 1,781
Threads: 13
Joined: Sep 2009

Reputation:

0

increase the stack size. in the compiler run options string, add a «-S8192»

Posts: 867
Threads: 104
Joined: Jul 2010

Reputation:

0

21.01.2013, 07:21

(

Last edited by CoaPsyFactor; 21/01/2013 at 07:27 AM.

Reason: Ok

)

I go to Build->Run Options->With these parameters-> -S8192? I added that but still having that message.

Ok I changed stack size with #pragma dynamic 8192 but would this stop those CrashDetect plugin messages?

Posts: 1,781
Threads: 13
Joined: Sep 2009

Reputation:

0

thats odd. eversince i put -S65536 there are no problems at all, with no script.
oh, dont delete your old run options, they can add up to a long string. i asked you to ADD -S8192, thats 8192*4 = 32768 bytes, thats enough in your case.

Posts: 867
Threads: 104
Joined: Jul 2010

Reputation:

0

i added but still nothing, then I added #pragma and fixed everything -r -w 203 this is how my old run looks like

                case 2: {
                    /* Удалить текущий предмет */

                    // Удаляем прикрепленный объект
                    new AttachmentIndexSel = GetPVarInt(playerid, "AttachmentIndexSel");
                    RemovePlayerAttachedObject(playerid, AttachmentIndexSel);

                    // очищаем информацию о аксессуаре
                    acs_items_on_user[playerid][AttachmentIndexSel][inventory_item] = 0;
                    acs_items_on_user[playerid][AttachmentIndexSel][object_id] = 0;
                    acs_items_on_user[playerid][AttachmentIndexSel][bone_id] = 0;
                    acs_items_on_user[playerid][AttachmentIndexSel][cord_x] = 0;
                    acs_items_on_user[playerid][AttachmentIndexSel][cord_y] = 0;
                    acs_items_on_user[playerid][AttachmentIndexSel][cord_z] = 0;
                    acs_items_on_user[playerid][AttachmentIndexSel][rotation_x] = 0;
                    acs_items_on_user[playerid][AttachmentIndexSel][rotation_y] = 0;
                    acs_items_on_user[playerid][AttachmentIndexSel][rotation_z] = 0;
                    acs_items_on_user[playerid][AttachmentIndexSel][size_x] = 0;
                    acs_items_on_user[playerid][AttachmentIndexSel][size_y] = 0;
                    acs_items_on_user[playerid][AttachmentIndexSel][size_z] = 0;

                    /* Удаление информации о предмете из базы */
                    new query[1000];
                    format(query,sizeof(query),
                      "UPDATE `"T_USER_ACSESSORY_DRESSED"` SET 
                      `inventory_item`=0,
                      `object_id`=0,
                      `bone_id`=0,
                      `cord_x`=0,
                      `cord_y`=0,
                      `cord_z`=0,
                      `rotation_x`=0,
                      `rotation_y`=0,
                      `rotation_z`=0,
                      `size_x`=0,
                      `size_y`=0,
                      `size_z`=0 
                    WHERE `owner_id`=%i AND `slot_id`=%i",
                    PI[playerid][pID], AttachmentIndexSel);
                    mysql_tquery(connects, query, "", "");


                    // Удаляем пвары
                    DeletePVar(playerid, "AttachmentIndexSel");
                    DeletePVar(playerid, "AttachmentModelSel");


                    return pc_cmd_inventory(playerid);
                }


#1

Пользователь офлайн
 

Отправлено 12 марта 2018 — 16:56

  • Прохожий

SA-MP мод, запускаю, выходит в логах ошибка Run Rime Error 3. И такие текста:

[17:44:47] [join] Nick_Name has joined the server (Тут IP)
[17:45:27] [debug] Run time error 3: "Stack/heap collision (insufficient stack size)"
[17:45:27] [debug]  Stack pointer (STK) is 0x9D89F4, heap pointer (HEA) is 0x9D9160
[17:45:27] [debug] AMX backtrace:
[17:45:27] [debug] #0 004b97b4 in public OnPlayerRegister (0) from pwn.amx
[17:45:27] [debug] #1 005c3644 in public OnPlayerClickTextDraw (0, 130) from pwn.amx
[17:46:12] [debug] Run time error 3: "Stack/heap collision (insufficient stack size)"
[17:46:12] [debug]  Stack pointer (STK) is 0x9D8E64, heap pointer (HEA) is 0x9D9160
[17:46:12] [debug] AMX backtrace:
[17:46:12] [debug] #0 0040dda8 in public Iter_OnPlayerDisconnect (0, 2) from pwn.amx
[17:46:12] [debug] #1 native CallLocalFunction () from samp03svr
[17:46:12] [debug] #2 0040dda8 in public OnPlayerDisconnect (0, 2) from pwn.amx
[17:46:12] [debug] #3 native Kick () from samp03svr
[17:46:12] [debug] #4 0040dda8 in public KickPublic (0, 2) from pwn.amx
[17:46:12] [part] Nick_Name has left the server (0:2)

В pawno вообще не шарю. Надеюсь на помощь. Ни пикапов ничего

Сообщение отредактировал Andromeda: 12 марта 2018 — 16:58

0


#2

Отправлено 12 марта 2018 — 17:03

  • Профессионал

Что-то мне подсказывает, что мало памяти выделено, хотя это наверное не так, но пишет так
У тебя есть инклуд, которые перехватывают паблики OnPlayerDisconnect и OnPlayerConnect?

Сообщение отредактировал Nestyreff: 12 марта 2018 — 17:04

0


#3

Отправлено 12 марта 2018 — 20:18

  • Прохожий

Просмотр сообщенияNestyreff (12 марта 2018 — 17:03) писал:

Что-то мне подсказывает, что мало памяти выделено, хотя это наверное не так, но пишет так
У тебя есть инклуд, которые перехватывают паблики OnPlayerDisconnect и OnPlayerConnect?

Чувааааак, в pawno я тупой и не шарю. Скажи название его :ohmy:

Дай свой ВК. Я могу весь мод кинуть тебе.

Сообщение отредактировал Andromeda: 12 марта 2018 — 20:21

0


#4

Отправлено 12 марта 2018 — 20:57

  • Профессионал

Просмотр сообщенияAndromeda (12 марта 2018 — 20:18) писал:

Чувааааак, в pawno я тупой и не шарю. Скажи название его :ohmy:

Дай свой ВК. Я могу весь мод кинуть тебе.

Мне не нужны моды, кинь лучше в начале, там должно быть что-то типо этого:

include <a_samp>
include<название>

и вот таких очень много, вот все эти строчки кинь

0


#5

Отправлено 12 марта 2018 — 21:16

  • Прохожий

Просмотр сообщенияNestyreff (12 марта 2018 — 20:57) писал:

Мне не нужны моды, кинь лучше в начале, там должно быть что-то типо этого:

include <a_samp>
include<название>

и вот таких очень много, вот все эти строчки кинь

Вот: #include <a_samp>
#include <a_http>
#include <a_mysql>
#include <sscanf2>
#include <jit>
#include <streamer>
#include <foreach>
#include <Pawn.CMD>
#include <erp_map>
#include <crashdetect>

0


#6

Отправлено 12 марта 2018 — 21:20

  • Профессионал

Просмотр сообщенияAndromeda (12 марта 2018 — 21:16) писал:

Нажмите сюда, чтобы прочитать это сообщение. [

Показать

]

откройте файл в pawno по пути: папка сервера — pawno — include — jiit
и его код сюда(в спойлере)

Сообщение отредактировал Nestyreff: 12 марта 2018 — 21:21

0


#7

Отправлено 12 марта 2018 — 22:07

  • Прохожий

Просмотр сообщенияNestyreff (12 марта 2018 — 21:20) писал:

откройте файл в pawno по пути: папка сервера — pawno — include — jiit
и его код сюда(в спойлере)

// Copyright (C) 2013-2015 Zeex
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.

#if defined JIT_INC
	#endinput
#endif
#define JIT_INC

forward OnJITCompile();

stock bool:IsJITPresent() {
	#emit zero.pri
	#emit lctrl 7
	#emit retn
	return false; // make compiler happy
}

stock bool:IsJITASMJumpCapable() {
	#emit lctrl 6
	#emit move.alt
	#emit lctrl 8
	#emit neq
	#emit retn
	return false; // make compiler happy
}

0


#8

Отправлено 13 марта 2018 — 08:47

  • Профессионал

Просмотр сообщенияAndromeda (12 марта 2018 — 22:07) писал:

Нажмите сюда, чтобы прочитать это сообщение. [

Показать

]

Киньте код OnPlayerRegister из основного мода

0


#9

Отправлено 13 марта 2018 — 13:35

  • Прохожий

Просмотр сообщенияNestyreff (13 марта 2018 — 08:47) писал:

Киньте код OnPlayerRegister из основного мода

publics: OnPlayerRegister(playerid)
{
PlayerInfo[playerid][pLevel] = 1;
PlayerInfo[playerid][pAdministration228] = 0;
PlayerInfo[playerid][pSupport] = 0;
PlayerInfo[playerid][pSHealth] = 100.0;
PlayerInfo[playerid][pHealth] = 100.0;
PlayerInfo[playerid][pInt] = 0;
PlayerInfo[playerid][Promo] = 0;
PlayerInfo[playerid][pLocal] = 255;
new randphone = 100000 + random(899999);
PlayerInfo[playerid][pPnumber] = randphone;
PlayerInfo[playerid][pReg] = 1;
PlayerInfo[playerid][pCarLic] = 0;
PlayerInfo[playerid][pCash] = 300;
PlayerInfo[playerid][pBank] = 0;
PlayerInfo[playerid][pMobile] = 10;
PlayerInfo[playerid][pChar][1] = 230;
PlayerInfo[playerid][pChar][2] = 230;
PlayerInfo[playerid][pMarriedTo] = strval(«-«);
strmid (PlayerInfo[playerid][pMarriedTo], «-«, 0, strlen(«-«), 255);
PlayerInfo[playerid][pZakonp] = 0;
PlayerInfo[playerid][pHousecash] = 0;
PlayerInfo[playerid][pWantedLevel] = 0;
PlayerInfo[playerid][pMuted] = 0;
PlayerInfo[playerid][pMuteTime] = 0;
PlayerInfo[playerid][pPhousekey] = -1;
PlayerInfo[playerid][pDonatemoney] = 0;
PlayerInfo[playerid][pCarLic] = 0;
PlayerInfo[playerid][pGolod] = 100;
PlayerInfo[playerid][pMedcard] = 0;
PlayerInfo[playerid][pAutoTime] = 0;
PlayerInfo[playerid][pOtmbI4ka] = 0;
PlayerInfo[playerid][pTimeBP] = 0;
PlayerInfo[playerid][pAutoSkill] = 0;
PlayerInfo[playerid][pTruckSkill] = 0;
PlayerInfo[playerid][pSkillT] = 0;
PlayerInfo[playerid][pSkate] = 0;
PlayerInfo[playerid][pSgf] = 0;
PlayerInfo[playerid][pBalon4ik] = 0;
PlayerInfo[playerid][pBint] = 0;
PlayerInfo[playerid][pCoster] = 0;
PlayerInfo[playerid][Promo] = 0;
PlayerInfo[playerid][pBizpokup] = 0;
PlayerInfo[playerid][pQuest] = 0;
PlayerInfo[playerid][pSiga] = 0;
PlayerInfo[playerid][pNazivka] = 0;
PlayerInfo[playerid][pPhonePlayer] = 0;
PlayerInfo[playerid][pDostup] = 0;
PlayerInfo[playerid][pShtanga] = 0;
PlayerInfo[playerid][pVelo] = 0;
PlayerInfo[playerid][pGiri] = 0;
PlayerInfo[playerid][pSpawnChange] = 1;
PlayerInfo[playerid][pBeg] = 0;
PlayerInfo[playerid][pEmailpod] = 0;
PlayerInfo[playerid][pNumbercar] = 0;
PlayerInfo[playerid][pWheels] = 0;
PlayerInfo[playerid][pSpoilers] = 0;
PlayerInfo[playerid][pHydraulics] = 0;
PlayerInfo[playerid][pHBumper] = 0;
PlayerInfo[playerid][pBBumper] = 0;
PlayerInfo[playerid][pNitro] = 0;
PlayerInfo[playerid][pOtel] = 0;
PlayerInfo[playerid][pQuest_1] = 0;
PlayerInfo[playerid][pQuest_2] = 0;
PlayerInfo[playerid][pQuest_3] = 0;
PlayerInfo[playerid][pQuest_4] = 0;
PlayerInfo[playerid][pQuest_5] = 0;
PlayerInfo[playerid][pLWarns] = 0;
PlayerInfo[playerid][pMWarns] = 0;
PlayerInfo[playerid][pDiplom] = 0;
PlayerInfo[playerid][pMath] = 0;
PlayerInfo[playerid][pHistory] = 0;
PlayerInfo[playerid][pBiology] = 0;
PlayerInfo[playerid][pInform] = 0;
PlayerInfo[playerid][pRussian] = 0;
PlayerInfo[playerid][pKeylog] = 0;
PlayerInfo[playerid][pSuperKey] = 0;
for(new i; i<14;i++) AccInvInfo[playerid][i] = 0;
PlayerInfo[playerid][pDataLeader] = strval(«-«);
strmid (PlayerInfo[playerid][pDataLeader], «-«, 0, strlen(«-«), 32);
PlayerInfo[playerid][pDataInvite] = strval(«-«);
strmid (PlayerInfo[playerid][pDataInvite], «-«, 0, strlen(«-«), 32);
SetPlayerColor(playerid, TEAM_HIT_COLOR);
GivePlayerPPCash(playerid, 0);
ClearMarriage(playerid);
new year, month,day;
new query[128];
new string[300];
new playersip[25];
getdate(year, month, day);
GetPlayerIp(playerid,playersip,sizeof(playersip));
new strstre[100];
format(strstre,sizeof(strstre), «%i/%i/%i»,day,month,year);
query = «UPDATE `»TABLE_ACCOUNT»` SET «;
acc_str_strcat(query, sizeof(query), «pDataReg», strstre);
acc_str_strcat(query, sizeof(query), «pIpReg», playersip);
strdel(query, strlen(query)-1, strlen(query));
format(string,sizeof(string),» WHERE `Name` = ‘%s'»,Name(playerid));
strcat(query, string);
mysql_query(query);
DollahScoreUpdate(playerid);
OnPlayerUpdateAc(playerid);
SpawnPlayer(playerid);
return 1;
}

Кстати добавил в папку PAWNO «pawm.cfg» с надписью «-d3». Не было, хотя надо. Теперь + пишет ошибку: pwn.pwn(7) : fatal error 100: cannot read from file: «jit» (возможно это из-за того что я компилирую тем Pawno что не в самой папке. Он просто зависает)

Сообщение отредактировал Andromeda: 13 марта 2018 — 14:44

0


#10

Отправлено 14 марта 2018 — 10:38

  • Прохожий

Просмотр сообщенияNestyreff (13 марта 2018 — 08:47) писал:

Киньте код OnPlayerRegister из основного мода

Ну как там?

0

PHP код:


[11:05:48] [СЕРВЕРУспешно подключился в MYSQL

[11:05:48] [CЕРВЕРНачинаю подгрузку дополнительных функций

[11:05:48] [CЕРВЕРЗагружаю TextDraw`ы

[11:05:48] [CЕРВЕР] Загружаю PickUp
`ы

[11:05:48] [CЕРВЕРЗагружаю объекты

[11:05:48] [CЕРВЕРЗагружаю 3D Тексты

[11:05:48] [CЕРВЕРЗагружаю транспорт

[11:05:48] [CЕРВЕРЗагружаю дома

[11:05:48Number of vehicle models6

[11:05:49] [connection127.0.0.1:63462 requests connection cookie.

[
11:05:50] [connectionincoming connection127.0.0.1:63462 id0

[11:05:50] [joinDiego_Barton has joined the server (0:127.0.0.1)

[
11:05:50] [debugRun time error 3"Stack/heap collision (insufficient stack size)"

[11:05:50] [debug]  Stack pointer (STKis 0x5FD24heap pointer (HEAis 0x5FCE8

[11:05:50] [debugAMX backtrace:

[
11:05:50] [debug#0 0000a710 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#1 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#2 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#3 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#4 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#5 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#6 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#7 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#8 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#9 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#10 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#11 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#12 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#13 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#14 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#15 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#16 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#17 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#18 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#19 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#20 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#21 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#22 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#23 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#24 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#25 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#26 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#27 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#28 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#29 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#30 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#31 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#32 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#33 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#34 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#35 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#36 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#37 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#38 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#39 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#40 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#41 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#42 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#43 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#44 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#45 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#46 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#47 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#48 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#49 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#50 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#51 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#52 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#53 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#54 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#55 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#56 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#57 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#58 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#59 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#60 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#61 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#62 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#63 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#64 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#65 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#66 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#67 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#68 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#69 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#70 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#71 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#72 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#73 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#74 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#75 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#76 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#77 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#78 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#79 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#80 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#81 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#82 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#83 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#84 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#85 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#86 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#87 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#88 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#89 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#90 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#91 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#92 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#93 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#94 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#95 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#96 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#97 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#98 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#99 0000a760 in ?? (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:05:50] [debug#100 0000a760 in public OnPlayerSearchBase (0, 1, 3, 233660, 407788, 233740, 233764) from miod.amx

[11:06:56] [debugRun time error 3"Stack/heap collision (insufficient stack size)"

[11:06:56] [debug]  Stack pointer (STKis 0x5FD14heap pointer (HEAis 0x5FCE8

[11:06:56] [debugAMX backtrace:

[
11:06:56] [debug#0 0000a710 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#1 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#2 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#3 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#4 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#5 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#6 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#7 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#8 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#9 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#10 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#11 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#12 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#13 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#14 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#15 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#16 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#17 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#18 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#19 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#20 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#21 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#22 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#23 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#24 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#25 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#26 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#27 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#28 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#29 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#30 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#31 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#32 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#33 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#34 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#35 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#36 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#37 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#38 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#39 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#40 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#41 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#42 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#43 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#44 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#45 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#46 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#47 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#48 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#49 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#50 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#51 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#52 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#53 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#54 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#55 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#56 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#57 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#58 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#59 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#60 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#61 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#62 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#63 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#64 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#65 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#66 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#67 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#68 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#69 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#70 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#71 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#72 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#73 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#74 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#75 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#76 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#77 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#78 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#79 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#80 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#81 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#82 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#83 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#84 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#85 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#86 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#87 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#88 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#89 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#90 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#91 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#92 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#93 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#94 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#95 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#96 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#97 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#98 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#99 0000a760 in ?? (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx

[11:06:56] [debug#100 0000a760 in public ExitAuto (0, 1, 0, 305500, 305580, 305856, 305888) from miod.amx 



PHP код:


ppublic OnPlayerSearchBase(playerid)

{

    new 
string[250],

        
rows,

        
rows2,

        
checkname[MAX_PLAYER_NAME];

     
GetPlayerName(playeridchecknamesizeof(checkname));
cache_get_data(rowsrows2);

    if(
rows)

    {

         
TimerAuto[playerid] = SetTimerEx("ExitAuto"1000*60false"i"playerid);

        
format(stringsizeof(string),"{FFFFFF}Добро пожаловать {009CFF}%snn{FFFFFF}Вы зашли на сервер {009CFF}SanAndreas{FFFFFF} Role PlaynВаш аккаунт на сервере зарегистрированnnВведите ваш пароль:"GN(playerid));

        
SPD(playerid1DIALOG_STYLE_PASSWORD,"{009CFF}Авторизация",string,"Далее","Выход");

    }

    else

    {

        
format(stringsizeof(string),"{FFFFFF}Добро пожаловать {009CFF}%snn{FFFFFF}Вы зашли на сервер {009CFF}SanAndreas{FFFFFF} Role PlaynВначале необходимо зарегистрироватьсяnnПервым делом придумайте ваш пароль:"GN(playerid));

         
SPD(playerid2DIALOG_STYLE_INPUT,"{009CFF}Регистрация [1/5]",string,"Далее","Выход");

    }

    for(new 
i!= 3i++) TextDrawShowForPlayer(playeridLogo[i]);

       for(new 
x;x<20;x++) SCM(playerid, -1," ");

    return 
true;





PHP код:


ppublic ExitAuto(playerid) return SPD(playerid1DIALOG_STYLE_MSGBOX,"{009CFF}Авторизация""{FFFFFF}Время на авторизацию вышлоn  Для выхода пропишите {009CFF}/q","Принять",""), fkick(playerid); 



Содержание

  1. Run time error 3 stack heap collision insufficient stack size
  2. Run time error 3 stack heap collision insufficient stack size
  3. Форум Pawn.Wiki — Воплоти мечту в реальность!: Ошибка: Run time error 3: Stack/heap collision — Форум Pawn.Wiki — Воплоти мечту в реальность!

Run time error 3 stack heap collision insufficient stack size

I compiled a gamemode and tried to launch it but it simply don’t launch because of the error quoted above.
I read that it’s a problem with ressources and optimization, but I can’t optimize more my code (1500 lines, it’s just a base) and I tried to run the gamemode on my computer : 4Go of RAM, quadcore 2.6GHz Intel CPU and 512Mb VRAM AMD GPU.

What could be wrong ?

Thanks in advance.

So, I just get the final compilator message :

I tried making more «global» variables, they are smaller as I can, and I don’t think I call more function than usual, but still the same error log remaining : http://pastebin.com/13JFpmUv

If you see what’s wrong in my code : http://pastebin.com/3C1wg8wx

Thanks in advance, because I really don’t see.

I tried making more «global» variables, they are smaller as I can, and I don’t think I call more function than usual, but still the same error log remaining : http://pastebin.com/13JFpmUv

If you see what’s wrong in my code : http://pastebin.com/3C1wg8wx

Thanks in advance, because I really don’t see.

Well, it shows me the real reason for the crash with the debug mode, thanks to both of ****** and Patrick_ : the problem came from the printfEx function. I explain myself : I created a function called printEx, but I realized that it’s a bit useless because printf does exactly the same thing but with a console-display message. So I used CTRL + H to replace all the statement «print» by «printf», but it also renames the function and the pre-processor definition, so the compiler compiled fine but with an erroned function.

For the interested persons, the function implementation and his pre-processor definition are here (still in the pastebin I’ve shown before)

#define printf printfEx

stock printfEx (const string [], va_args <>)
<
static out [ 512 ];
va_format ( out , strlen (string), string , va_start 1 >);
return printf ( out );
>

Источник

Run time error 3 stack heap collision insufficient stack size

Fixes for runtime errors

Sections

  • Runtime error 3: Stack/heap collision (insufficient stack size)
  • Runtime error 4: Array index out of bounds
  • Runtime error 5: Invalid memory access
  • Runtime error 7: Stack underflow
  • Runtime error 10: Native function failed
  • Runtime error 11: Divide by zero
  • Runtime error 12: (sleep mode)
  • Runtime error 16: Out of memory
  • Runtime error 17: Invalid/unsupported P-code file format
  • Runtime error 19: File or function is not found
  • Runtime error 20: Invalid index parameter (bad entry point)
  • Runtime error 22: AMX not initialized (or doubly initialized)

Introduction
New scripters are always having issues with certain runtime problems, so this tutorial will help suppress of those errors to ensure a safe, stable mode.

Basically, runtime errors are errors that are generated at runtime and not by your compiler. I’ve listed all of the common ones below (there are either some missing, or so rare that nobody ever receives them) to the best of my knowledge, so read on if you’re interested.

Runtime error 3
Your script has apparently ran out of local memory. The stack is where any local variables are allocated and stored, in terms of memory. This means that the stack and the heap are colliding with each other, which could effectively corrupt data in the long run.

Solution: Try to use less cells for local declaration. For example, huge strings can be declared using «static» so it isn’t allocated every function call. Alternatively, there’s «#pragma dynamic x» but that’s only if you’re lazy.

Runtime error 4
Very simple, you’re trying to access out-of-bound data in an array, in other words, a cell inside of an array that doesn’t exist.

Solution: If you’re using the crashdetect plugin, it’ll tell you which callback the error is in. Simply debug your code until you find the culprit, then remove it.

Runtime error 5
You are either trying to incorrectly access memory, or the system was unable to read or write any memory because of an incorrectly used native.

Solution: Look in the callback and see if you can find the problem. These are really tricky to find, so you have to be careful and debug your code one-by-one.

Runtime error 7
This is caused by removing too much data from the stack. Eventually, the stack register becomes a negative number and corrupts all of your shit.

Solution: Debug the code and remove any code that uses #emit until the problem is found.

Runtime error 10
A native function has been used incorrectly, or one of the parameters are incorrectly used.

Solution: Remove the corresponding native from your code and look up a way to correctly use that function.

Runtime error 11
This is caused by dividing zero with another number.

Solution: Don’t divide by zero, idiot!

Runtime error 12
This is caused by using «sleep mode» in a function other than the entry point (main). This is a very rare issue, and it can sometimes be caused by external libraries.

Solution: Only use «sleep» in the main entry.

Runtime error 16
Your computer has ran out of memory, and there’s no way to store the data any further.

Solution: Get a new computer, or use less memory (pointing back to error 3).

Runtime error 17
Your .AMX file is corrupt and contains an invalid P-code format. This can be caused by trying to run the server while the script is compiling.

Solution: Shut the server off and compile the script again. If you’ve uploaded the .amx file, then upload it again.

Runtime error 19
One of the most common known problems in SA-MP. This simply means that the include and plugin versions might not match. One of them is either outdated, or newer than the other.

Solution: Update your plugins and includes. If you can, disable your plugins until the problem is found.

Runtime error 20
When running a gamemode, the «main» function indicates the entry point for that mode. Without it, your mode won’t function properly.

Solution: Add this snippet under your includes:

Runtime error 22
This is caused by the abstract machine not being initialized properly, or being initialized twice.

Solution: Find out where the problem is coming from. Disable any filterscripts or plugins, and debug your mode. This error also pops up frequently when using #emit incorrectly.

Notes

  • I apologize for any incorrect information. It was late when I made this tutorial, you know.
  • There are more runtime problems (I believe there’s around

25) but I only listed the frequent ones.

  • Whoever stole the pancake mix that was in my drawer, you better fucking give it back, NOW.
  • Conclusion
    Okay, so you’ve managed to reach the end of this tutorial, good for you.

    Alternatively, you can also solve these problems yourself by using common sense, debugging your code and running the usual tests.

    Источник

    Форум Pawn.Wiki — Воплоти мечту в реальность!: Ошибка: Run time error 3: Stack/heap collision — Форум Pawn.Wiki — Воплоти мечту в реальность!

    • Pawn скриптинг
    • Первая помощь
    • Проблемы с компилированием
    • Правила форума
    • Просмотр новых публикаций
    • (2 Страниц)
    • 1
    • 2
    • >
    • Вы не можете создать новую тему
    • Тема закрыта

    • Группа: Пользователи
    • Сообщений: 6
    • Регистрация: 12 марта 18

    SA-MP мод, запускаю, выходит в логах ошибка Run Rime Error 3. И такие текста:

    В pawno вообще не шарю. Надеюсь на помощь. Ни пикапов ничего

    Сообщение отредактировал Andromeda: 12 марта 2018 — 16:58

    • Группа: Vip
    • Сообщений: 1 189
    • Регистрация: 06 октября 17

    Сообщение отредактировал Nestyreff: 12 марта 2018 — 17:04

    • Группа: Пользователи
    • Сообщений: 6
    • Регистрация: 12 марта 18

    Nestyreff (12 марта 2018 — 17:03) писал:

    Чувааааак, в pawno я тупой и не шарю. Скажи название его

    Дай свой ВК. Я могу весь мод кинуть тебе.

    Сообщение отредактировал Andromeda: 12 марта 2018 — 20:21

    • Группа: Vip
    • Сообщений: 1 189
    • Регистрация: 06 октября 17

    Andromeda (12 марта 2018 — 20:18) писал:

    Чувааааак, в pawno я тупой и не шарю. Скажи название его

    Дай свой ВК. Я могу весь мод кинуть тебе.

    Мне не нужны моды, кинь лучше в начале, там должно быть что-то типо этого:

    и вот таких очень много, вот все эти строчки кинь

    • Группа: Пользователи
    • Сообщений: 6
    • Регистрация: 12 марта 18

    Nestyreff (12 марта 2018 — 20:57) писал:

    Мне не нужны моды, кинь лучше в начале, там должно быть что-то типо этого:

    и вот таких очень много, вот все эти строчки кинь

    • Группа: Vip
    • Сообщений: 1 189
    • Регистрация: 06 октября 17

    Andromeda (12 марта 2018 — 21:16) писал:

    Сообщение отредактировал Nestyreff: 12 марта 2018 — 21:21

    • Группа: Пользователи
    • Сообщений: 6
    • Регистрация: 12 марта 18

    Nestyreff (12 марта 2018 — 21:20) писал:

    • Группа: Vip
    • Сообщений: 1 189
    • Регистрация: 06 октября 17

    Andromeda (12 марта 2018 — 22:07) писал:

    • Группа: Пользователи
    • Сообщений: 6
    • Регистрация: 12 марта 18

    Nestyreff (13 марта 2018 — 08:47) писал:

    publics: OnPlayerRegister(playerid)
    <
    PlayerInfo[playerid][pLevel] = 1;
    PlayerInfo[playerid][pAdministration228] = 0;
    PlayerInfo[playerid][pSupport] = 0;
    PlayerInfo[playerid][pSHealth] = 100.0;
    PlayerInfo[playerid][pHealth] = 100.0;
    PlayerInfo[playerid][pInt] = 0;
    PlayerInfo[playerid][Promo] = 0;
    PlayerInfo[playerid][pLocal] = 255;
    new randphone = 100000 + random(899999);
    PlayerInfo[playerid][pPnumber] = randphone;
    PlayerInfo[playerid][pReg] = 1;
    PlayerInfo[playerid][pCarLic] = 0;
    PlayerInfo[playerid][pCash] = 300;
    PlayerInfo[playerid][pBank] = 0;
    PlayerInfo[playerid][pMobile] = 10;
    PlayerInfo[playerid][pChar][1] = 230;
    PlayerInfo[playerid][pChar][2] = 230;
    PlayerInfo[playerid][pMarriedTo] = strval(«-«);
    strmid (PlayerInfo[playerid][pMarriedTo], «-«, 0, strlen(«-«), 255);
    PlayerInfo[playerid][pZakonp] = 0;
    PlayerInfo[playerid][pHousecash] = 0;
    PlayerInfo[playerid][pWantedLevel] = 0;
    PlayerInfo[playerid][pMuted] = 0;
    PlayerInfo[playerid][pMuteTime] = 0;
    PlayerInfo[playerid][pPhousekey] = -1;
    PlayerInfo[playerid][pDonatemoney] = 0;
    PlayerInfo[playerid][pCarLic] = 0;
    PlayerInfo[playerid][pGolod] = 100;
    PlayerInfo[playerid][pMedcard] = 0;
    PlayerInfo[playerid][pAutoTime] = 0;
    PlayerInfo[playerid][pOtmbI4ka] = 0;
    PlayerInfo[playerid][pTimeBP] = 0;
    PlayerInfo[playerid][pAutoSkill] = 0;
    PlayerInfo[playerid][pTruckSkill] = 0;
    PlayerInfo[playerid][pSkillT] = 0;
    PlayerInfo[playerid][pSkate] = 0;
    PlayerInfo[playerid][pSgf] = 0;
    PlayerInfo[playerid][pBalon4ik] = 0;
    PlayerInfo[playerid][pBint] = 0;
    PlayerInfo[playerid][pCoster] = 0;
    PlayerInfo[playerid][Promo] = 0;
    PlayerInfo[playerid][pBizpokup] = 0;
    PlayerInfo[playerid][pQuest] = 0;
    PlayerInfo[playerid][pSiga] = 0;
    PlayerInfo[playerid][pNazivka] = 0;
    PlayerInfo[playerid][pPhonePlayer] = 0;
    PlayerInfo[playerid][pDostup] = 0;
    PlayerInfo[playerid][pShtanga] = 0;
    PlayerInfo[playerid][pVelo] = 0;
    PlayerInfo[playerid][pGiri] = 0;
    PlayerInfo[playerid][pSpawnChange] = 1;
    PlayerInfo[playerid][pBeg] = 0;
    PlayerInfo[playerid][pEmailpod] = 0;
    PlayerInfo[playerid][pNumbercar] = 0;
    PlayerInfo[playerid][pWheels] = 0;
    PlayerInfo[playerid][pSpoilers] = 0;
    PlayerInfo[playerid][pHydraulics] = 0;
    PlayerInfo[playerid][pHBumper] = 0;
    PlayerInfo[playerid][pBBumper] = 0;
    PlayerInfo[playerid][pNitro] = 0;
    PlayerInfo[playerid][pOtel] = 0;
    PlayerInfo[playerid][pQuest_1] = 0;
    PlayerInfo[playerid][pQuest_2] = 0;
    PlayerInfo[playerid][pQuest_3] = 0;
    PlayerInfo[playerid][pQuest_4] = 0;
    PlayerInfo[playerid][pQuest_5] = 0;
    PlayerInfo[playerid][pLWarns] = 0;
    PlayerInfo[playerid][pMWarns] = 0;
    PlayerInfo[playerid][pDiplom] = 0;
    PlayerInfo[playerid][pMath] = 0;
    PlayerInfo[playerid][pHistory] = 0;
    PlayerInfo[playerid][pBiology] = 0;
    PlayerInfo[playerid][pInform] = 0;
    PlayerInfo[playerid][pRussian] = 0;
    PlayerInfo[playerid][pKeylog] = 0;
    PlayerInfo[playerid][pSuperKey] = 0;
    for(new i; i 0

    Источник

    Ошибка не совсем при компилировании, а когда заходит любой человек, дает эти текста и сервер полностью не функционирует. (Деньги, Уровень и т.д. на нуле)

     

    [17:44:47] [join] Nick_Name has joined the server (Тут IP)
    [17:45:27] [debug] Run time error 3: «Stack/heap collision (insufficient stack size)»
    [17:45:27] [debug] Stack pointer (STK) is 0x9D89F4, heap pointer (HEA) is 0x9D9160
    [17:45:27] [debug] AMX backtrace:
    [17:45:27] [debug] #0 004b97b4 in public OnPlayerRegister (0) from pwn.amx
    [17:45:27] [debug] #1 005c3644 in public OnPlayerClickTextDraw (0, 130) from pwn.amx
    [17:46:12] [debug] Run time error 3: «Stack/heap collision (insufficient stack size)»
    [17:46:12] [debug] Stack pointer (STK) is 0x9D8E64, heap pointer (HEA) is 0x9D9160
    [17:46:12] [debug] AMX backtrace:
    [17:46:12] [debug] #0 0040dda8 in public Iter_OnPlayerDisconnect (0, 2) from pwn.amx
    [17:46:12] [debug] #1 native CallLocalFunction () from samp03svr
    [17:46:12] [debug] #2 0040dda8 in public OnPlayerDisconnect (0, 2) from pwn.amx
    [17:46:12] [debug] #3 native Kick () from samp03svr
    [17:46:12] [debug] #4 0040dda8 in public KickPublic (0, 2) from pwn.amx
    [17:46:12] [part] Nick_Name has left the server (0:2)

    Паблик «OnPlayerRegister»:

     

    publics: OnPlayerRegister(playerid)
    {
    PlayerInfo[playerid][pLevel] = 1;
    PlayerInfo[playerid][pAdministration228] = 0;
    PlayerInfo[playerid][pSupport] = 0;
    PlayerInfo[playerid][pSHealth] = 100.0;
    PlayerInfo[playerid][pHealth] = 100.0;
    PlayerInfo[playerid][pInt] = 0;
    PlayerInfo[playerid][Promo] = 0;
    PlayerInfo[playerid][pLocal] = 255;
    new randphone = 100000 + random(899999);
    PlayerInfo[playerid][pPnumber] = randphone;
    PlayerInfo[playerid][pReg] = 1;
    PlayerInfo[playerid][pCarLic] = 0;
    PlayerInfo[playerid][pCash] = 300;
    PlayerInfo[playerid][pBank] = 0;
    PlayerInfo[playerid][pMobile] = 10;
    PlayerInfo[playerid][pChar][1] = 230;
    PlayerInfo[playerid][pChar][2] = 230;
    PlayerInfo[playerid][pMarriedTo] = strval(«-«);
    strmid (PlayerInfo[playerid][pMarriedTo], «-«, 0, strlen(«-«), 255);
    PlayerInfo[playerid][pZakonp] = 0;
    PlayerInfo[playerid][pHousecash] = 0;
    PlayerInfo[playerid][pWantedLevel] = 0;
    PlayerInfo[playerid][pMuted] = 0;
    PlayerInfo[playerid][pMuteTime] = 0;
    PlayerInfo[playerid][pPhousekey] = -1;
    PlayerInfo[playerid][pDonatemoney] = 0;
    PlayerInfo[playerid][pCarLic] = 0;
    PlayerInfo[playerid][pGolod] = 100;
    PlayerInfo[playerid][pMedcard] = 0;
    PlayerInfo[playerid][pAutoTime] = 0;
    PlayerInfo[playerid][pOtmbI4ka] = 0;
    PlayerInfo[playerid][pTimeBP] = 0;
    PlayerInfo[playerid][pAutoSkill] = 0;
    PlayerInfo[playerid][pTruckSkill] = 0;
    PlayerInfo[playerid][pSkillT] = 0;
    PlayerInfo[playerid][pSkate] = 0;
    PlayerInfo[playerid][pSgf] = 0;
    PlayerInfo[playerid][pBalon4ik] = 0;
    PlayerInfo[playerid][pBint] = 0;
    PlayerInfo[playerid][pCoster] = 0;
    PlayerInfo[playerid][Promo] = 0;
    PlayerInfo[playerid][pBizpokup] = 0;
    PlayerInfo[playerid][pQuest] = 0;
    PlayerInfo[playerid][pSiga] = 0;
    PlayerInfo[playerid][pNazivka] = 0;
    PlayerInfo[playerid][pPhonePlayer] = 0;
    PlayerInfo[playerid][pDostup] = 0;
    PlayerInfo[playerid][pShtanga] = 0;
    PlayerInfo[playerid][pVelo] = 0;
    PlayerInfo[playerid][pGiri] = 0;
    PlayerInfo[playerid][pSpawnChange] = 1;
    PlayerInfo[playerid][pBeg] = 0;
    PlayerInfo[playerid][pEmailpod] = 0;
    PlayerInfo[playerid][pNumbercar] = 0;
    PlayerInfo[playerid][pWheels] = 0;
    PlayerInfo[playerid][pSpoilers] = 0;
    PlayerInfo[playerid][pHydraulics] = 0;
    PlayerInfo[playerid][pHBumper] = 0;
    PlayerInfo[playerid][pBBumper] = 0;
    PlayerInfo[playerid][pNitro] = 0;
    PlayerInfo[playerid][pOtel] = 0;
    PlayerInfo[playerid][pQuest_1] = 0;
    PlayerInfo[playerid][pQuest_2] = 0;
    PlayerInfo[playerid][pQuest_3] = 0;
    PlayerInfo[playerid][pQuest_4] = 0;
    PlayerInfo[playerid][pQuest_5] = 0;
    PlayerInfo[playerid][pLWarns] = 0;
    PlayerInfo[playerid][pMWarns] = 0;
    PlayerInfo[playerid][pDiplom] = 0;
    PlayerInfo[playerid][pMath] = 0;
    PlayerInfo[playerid][pHistory] = 0;
    PlayerInfo[playerid][pBiology] = 0;
    PlayerInfo[playerid][pInform] = 0;
    PlayerInfo[playerid][pRussian] = 0;
    PlayerInfo[playerid][pKeylog] = 0;
    PlayerInfo[playerid][pSuperKey] = 0;
    for(new i; i&lt;14;i++) AccInvInfo[playerid] = 0;
    PlayerInfo[playerid][pDataLeader] = strval(«-«);
    strmid (PlayerInfo[playerid][pDataLeader], «-«, 0, strlen(«-«), 32);
    PlayerInfo[playerid][pDataInvite] = strval(«-«);
    strmid (PlayerInfo[playerid][pDataInvite], «-«, 0, strlen(«-«), 32);
    SetPlayerColor(playerid, TEAM_HIT_COLOR);
    GivePlayerPPCash(playerid, 0);
    ClearMarriage(playerid);
    new year, month,day;
    new query[128];
    new string[300];
    new playersip[25];
    getdate(year, month, day);
    GetPlayerIp(playerid,playersip,sizeof(playersip));
    new strstre[100];
    format(strstre,sizeof(strstre), «%i/%i/%i»,day,month,year);
    query = «UPDATE `»TABLE_ACCOUNT»` SET «;
    acc_str_strcat(query, sizeof(query), «pDataReg», strstre);
    acc_str_strcat(query, sizeof(query), «pIpReg», playersip);
    strdel(query, strlen(query)-1, strlen(query));
    format(string,sizeof(string),» WHERE `Name` = ‘%s'»,Name(playerid));
    strcat(query, string);
    mysql_query(query);
    DollahScoreUpdate(playerid);
    OnPlayerUpdateAc(playerid);
    SpawnPlayer(playerid);
    return 1;
    }

    Все инклуды которые прописаны в моде:

    #include &lt;a_samp&gt;
    #include &lt;a_http&gt;
    #include &lt;a_mysql&gt;
    #include &lt;sscanf2&gt;
    #include &lt;jit&gt;
    #include &lt;streamer&gt;
    #include &lt;foreach&gt;
    #include &lt;Pawn.CMD&gt;
    #include &lt;erp_map&gt;
    #include &lt;crashdetect&gt;

    Еще инклуд «jit

    // Copyright (C) 2013-2015 Zeex
    //
    // Permission is hereby granted, free of charge, to any person obtaining a
    // copy of this software and associated documentation files (the «Software»),
    // to deal in the Software without restriction, including without limitation
    // the rights to use, copy, modify, merge, publish, distribute, sublicense,
    // and/or sell copies of the Software, and to permit persons to whom the
    // Software is furnished to do so, subject to the following conditions:
    //
    // The above copyright notice and this permission notice shall be included in
    // all copies or substantial portions of the Software.
    //
    // THE SOFTWARE IS PROVIDED «AS IS», WITHOUT WARRANTY OF ANY KIND, EXPRESS
    // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    // DEALINGS IN THE SOFTWARE.

    #if defined JIT_INC
    #endinput
    #endif
    #define JIT_INC

    forward OnJITCompile();

    stock bool:IsJITPresent() {
    #emit zero.pri
    #emit lctrl 7
    #emit retn
    return false; // make compiler happy
    }

    stock bool:IsJITASMJumpCapable() {
    #emit lctrl 6
    #emit move.alt
    #emit lctrl 8
    #emit neq
    #emit retn
    return false; // make compiler happy
    }

    Я точно не знаю зачем все это, но просили на других форумах.

    «

    #2. Многократное использование одинакового текста или чисел.

    Рассматривая исключительно из интереса слитые в общий доступ игровые моды, можно заменить ситуацию, когда в начале мода присутствуют макросы, содержащие, например, текст о том, что игрок не авторизован.

    #define MSG_NOADMIN1(%0)		SendClientMessage(%0, COLOR_GREEN, "Вы не авторизированы!")
    #define MSG_NOTPLAYER(%0)		SendClientMessage(%0, COLOR_GREEN, "Игрок с указанным тобой id не найден")
    #define MSG_NODRIVER(%0)		SendClientMessage(%0, COLOR_GREEN, "Ты должен находиться в машине и быть за рулём")

    Казалось бы, упростили себе задачу: теперь не нужно прописывать один и тот же текст огромное число раз, достаточно лишь прописать MSG_NOADMIN1, MSG_NOTPLAYER или MSG_NODRIVER. Однако, данный метод не влияет положительно на расход памяти. Для того, чтобы ответить на вопрос «почему?», следует вспомнить, что такое макрос и что с ним происходит в процессе компиляции.

    Макрос — директива. Она обрабатывается препроцессором. Грубо говоря, перед началом компиляции свою работу начинает препроцессор, который, помимо ряда других действий, «подставляет» значения на место своего использования.

    #define DEFINED_MESSAGE "Your text"
    SendDefinedMessage(playerid)
    {
    	SendClientMessage(playreid, -1, DEFINED_MESSAGE);
    }
    SendDefinedMessage(playerid)
    {
    	SendClientMessage(playreid, -1, "Your text");
    }

    И, соответственно, компилироваться будет уже код, в котором отсутствуют директивы.

    Поэтому, если один и тот же макрос вы используете несколько раз, то препроцессор несколько раз подставляет один и тот же текст в разные участки кода. Каждый такой текст попадает в сегмент данных (секционную память). Соответственно, в конечном итоге в секционную память попадает один и тот же текст неоднократно, что ее явно раздувает. Рассмотрим такой пример на чистом игровом моде. Скомпилируем такой участок кода:

    #define TEXT "your text"
    public OnGameModeInit()
    {
    	printf(TEXT);
    	printf(TEXT);
    	return 1;
    }

    В информации о компилировании присутствует информация о том, сколько места необходимо для хранения каждого вида информации. То есть в информации о компилировании появляются следующие строки:

    Header size:            140 bytes
    Code size:              108 bytes
    Data size:               80 bytes
    Stack/heap size:      16384 bytes; estimated max. usage=9 cells (36 bytes)
    Total requirements:   16688 bytes

    Обратите внимание на строку «Data size«. Это и есть занятое пространство в секционной памяти (ее еще называют статической). При таком использовании макроса статическая память будет занята на 56 байт. А теперь попробуем поместить текст один раз в статическую память и пользоваться им так, как и раньше. В этом нам поможет оператор static. На локальном уровне (внутри одного файла) именно его содержимое попадает в сегмент данных. Следует учесть, что значения, объявленные при помощи static, попадают в сегмент данных лишь один раз (при компиляции) и в процессе работы сервера не удаляются оттуда. Потому память и статическая — она не изменяет свою наполненность в процессе работы сервера. В итоге, с использованием оператора static, наш текст будет иметь следующий вид:

    static TEXT[] = "your text";

    В общем виде данный мною ранее участок кода примет такой облик:

    static TEXT[] = "your text";
    public OnGameModeInit()
    {
    	printf(TEXT);
    	printf(TEXT);
    	return 1;
    }

    Скомпилируем получившийся код. Смотрим снова на информацию, полученную в процессе компилирования.

    Header size:            140 bytes
    Code size:              112 bytes
    Data size:               40 bytes
    Stack/heap size:      16384 bytes; estimated max. usage=9 cells (36 bytes)
    Total requirements:   16676 bytes

    Снова все свое внимание уделяем строке «Data size«. Мы, как и раньше, дважды используем один и тот же текст в процессе работы сервера. Но теперь размер статической памяти уменьшился вдвое. Почему? Это как раз и связано с тем, что мы лишь единожды занесли текст в сегмент данных и в дальнейшем работали только с ним.

    Данная ситуация касается не только макросов, но и в целом отправки одинакового текста.

    CMD:sendmessage(playerid, params[])
    {
    	if(isnull(params))
    		return SendClientMessage(playerid, -1, "Используйте /sendmessage [playerid] [text]");
    	new id;
    	if(sscanf(params, "us[100]", id, params))
    		return SendClientMessage(playerid, -1, "Используйте /sendmessage [playerid] [text]");
    	else if(id == INVALID_PLAYER_ID)
    		return SendClientMessage(playerid, -1, "Указанный Вами игрок не найден на сервере.");
    	
    	SendClientMessage(playerid, -1, "Сообщение успешно отправлено в чат от лица указанного пользователя.");
    	OnPlayerText(id, params);
    	return 1;
    }

    Заметьте, один и тот же текст («Используйте /sendmessage [playerid] [text]») дважды используется в одной и той же команде. Это значит, что он дважды будет помещен в сегмент данных. Назревает вопрос: почему бы не уменьшить использованный размер сегмента данных и не занести данный текст лишь единожды? Сделаем это при помощи оператора static.

     

    CMD:sendmessage(playerid, params[])
    {
    	static USE_CMD_MSG[] = "Используйте /sendmessage [playerid] [text]";
    	
    	if(isnull(params))
    		return SendClientMessage(playerid, -1, USE_CMD_MSG);
    	new id;
    	if(sscanf(params, "us[100]", id, params))
    		return SendClientMessage(playerid, -1, USE_CMD_MSG);
    	else if(id == INVALID_PLAYER_ID)
    		return SendClientMessage(playerid, -1, "Указанный Вами игрок не найден на сервере.");
    	
    	SendClientMessage(playerid, -1, "Сообщение успешно отправлено в чат от лица указанного пользователя.");
    	OnPlayerText(id, params);
    	return 1;
    }

    • Выгоду можно получить лишь тогда, когда текст используется действительно многократно. Например, если у Вас данные для подключения записаны в макрос, выгоду Вы не получите, ведь эти данные используются лишь однажды. 
    • Значение макросов можно «вставить» в строку без форматирования. С переменными (static) такое не получится. Поэтому переводить в данном случае названия сервера, версию сервера с макроса на переменную стоит с умом. Ведь можно получить ошибки, которые не все могут исправить.
    • Static функционирует лишь внутри того или иного файла. Соответственно, значение данного оператора (строку, записанную с помощью static), Вы не сможете использовать во включаемых файлах (includes). Потому в таковом случае придется использовать оператор new. Текст будет также записан в память всего лишь однажды. И, если объявление осуществляется на глобальном уровне, то ничего абсолютно не изменится. Если же через оператор new объявлять какие-либо константы внутри функций, они каждый раз будут инициализироваться при вызове этой функции, что повлияет на скорость.
    • Навряд ли в процессе работы сервера Вы будете изменять данные тексты. Чтобы в будущем не ошибиться и ничего себе не «сломать», рекомендуется ставить возле таких текстов оператор const. Например, « static const SERVER_NAME[] = «Your server’s name!»; »
    • Для большей оптимизации и большего сокращения расхода памяти Вы также можете применить упаковку строк. Об упаковке строк урок Вы сможете найти на нашем форуме, воспользовавшись поиском.

    Q1: Ведь на строки уходит совсем немного памяти — буквально байты, пусть даже килобайты. Зачем это промышлять?

    A1: Любой разработчик должен стремиться к оптимизации. Прежде всего в оптимизацию входит улучшение производительности и уменьшение затраченной памяти. Возможно, не лишним было бы занести в оптимизацию и читаемость кода. Пусть это даже байты, но чем меньше ресурсов затрачено, тем лучше. Более того, для того, чтобы заменить #define на static нужно вовсе немного времени. Останется лишь еще оформить его как строку, а значит указать, что содержит массив (доставить [размер]), добавить присвоение (=), а также доставить на конце строки точку с запятой. Это явно ни час работы, ни полчаса и даже не минута. Однако, не нужно и слишком «загоняться» с этим. Не стоит убивать свое время на трансляцию текста из макросов в static. Лишь стоит иметь в виду в будущем, как лучше задать тот или иной участок кода.

    Q2: Как получить информацию, предоставленную в данной теме?

    A2: Вы можете указать ключ компиляции в конфигурационном файле. Для этого в файле pawn.cfg, находящемуся в папке pawno, необходимо ввести «-v2» без кавычек. При отсутствии данного файла Вам следует его создать.

    Здравствуйте!

    У меня при получении данных из MySQL, возникает проблема из-за которой сервер зависает(по server_log.txt):

    [19:03:18] [debug] Run time error 3: «Stack/heap collision (insufficient stack size)»

    [19:03:18] [debug] Stack pointer (STK) is 0x1CAE8, heap pointer (HEA) is 0x1CB3C

    [19:03:18] [debug] AMX backtrace:

    [19:03:18] [debug] #0 ???????? in public OnDialogResponse () from mod.amx

    Как я понял, это происходит из-за того, что возникает переполнения стека.

    Вот код:

            new query[1024];
    new sqlpass[64]; 
    new result[2688];
    new dialog[256];
    printf("Loading account");
            mysql_real_escape_string(password, sqlpass);
            format(query, sizeof(query), "SELECT * FROM `accounts` WHERE `password` = '%s' AND `ID` = '%i'", sqlpass, playerVar[playerid][aID]);
    
            mysql_query(query);
            mysql_store_result();
            if(mysql_num_rows() == 1)
    {
           mysql_fetch_row_format(result, "|");
    
    sscanf(result, "p<|>is[32]s[32]s[16]iiis[16]iiis[64]s[32]iiiiiiis[64]iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii",
           playerVar[playerid][aID],
           playerVar[playerid][aName],
           playerVar[playerid][aPassword],
           playerVar[playerid][aIp],
           playerVar[playerid][aDayreg],
           playerVar[playerid][aMonthreg],
              playerVar[playerid][aYearreg],
              playerVar[playerid][aIpreg],
              playerVar[playerid][aSex],
              playerVar[playerid][aModel],
              playerVar[playerid][aSkin],
                    playerVar[playerid][aMail],
                    playerVar[playerid][aDrug],
                    playerVar[playerid][aDrugmoney],
                    playerVar[playerid][aLevel],
                    playerVar[playerid][aPassport],
                    playerVar[playerid][aAge],
                    playerVar[playerid][aExp],
                    playerVar[playerid][aAdminlevel],
                    playerVar[playerid][aHelperlevel],
                    playerVar[playerid][aAdminkey],
    и т.д.

    Как я понял, это из-за длины переменной result[2688].

    Если сделать её слишком маленькой, запрос не влазит, и sscanf выдает переполнение result, если слишком большой, то крашит мод.

    Подскажите, как мне быть?

    Run-time error messages

    A script may stop running, and chat at you the complaint «Script run-time error», followed by another complaint such as:

    Script run-time error: Heap Error

    Don’t speak nonsense. For example, don’t return a list of one entry that is the result of a routine that returns no result.

    Script run-time error: Lists may not contain lists

    Don’t try adding a list into a list.

    Script run-time error: Math Error

    Float divided by zero, integer divided by zero, etc.

    See Error/Math for functions that can generate this.

    Script run-time error: Stack-Heap Collision

    The Stack has collided with the Bytecode or the Heap. (The script has run out of memory)

    In LSO each script runs inside 16 KiB of memory divided out among Bytecode, Stack, and Heap.

    You can cause collision by compiling too much script, which produces too much Bytecode. The script compiles and saves successfully, but when you rez an object containing the script, the script crashes, immediately or while running.

    See llGetFreeMemory and Memory for more details.

    Run-time error demo scripts

    Compile and run examples like these to experience the script run-time errors.

    default
    {
        state_entry()
        {
            llOwnerSay((string) [llOwnerSay("bye")]); // Script run-time error: Heap Error
        }
    }
    
    default
    {
        state_entry()
        {
            list once = [];
            list twice = [once, once]; // Script run-time error: Lists may not contain lists
        }
    }
    
    default
    {
        state_entry()
        {
            float one = 1.0;
            float zero = 0.0;
            float quotient = one / zero; // Script run-time error: Math Error
            llOwnerSay((string) quotient);
        }
    }
    
    default
    {
        state_entry()
        {
            list entries = [0];
            while (TRUE)
            {
                entries += entries; // Script run-time error: Stack-Heap Collision
                llOwnerSay((string) llGetListLength(entries));
            }
        }
    }
    

    Compile-time error messages

    The SL GUI may reject some code that you feel is perfectly clear, printing ERROR at you and then explaining with some further complaint.

    ERROR : Type mismatch

    You must name the .x .y .z .s components of a vector or rotation that you’re assigning, you can’t assign them all at once from a list, for instance:

    default
    {
        state_entry()
        {
            vector vec = (vector) [1, 2, 3]; // ERROR : Type mismatch
            llOwnerSay((string) vec);
        }
    }
    

    ERROR : Byte code assembly failed — out of memory

    You must make each script reasonably small.

    For example, the compiler says you typed too much script if you cascade too many else-if’s:

    demoElseIfCompileError(integer count)
    {
        if (count == 0)
        {
            ;
        }
        else if (count == 1)
        {
            ;
        }
        else if (count == 2)
        {
            ;
        }
        ...
        ... // ERROR : Byte code assembly failed -- out of memory
        ... // or ERROR : Syntax error
        ...
        else if (count == ...)
        {
            ;
        }
    }
    

    How much script is too much script can vary astonishingly. For example, the 2007-08 Second Life clients varied as much as 30X, from one to the next. Specifically, the Windows client accepted 22 else-if’s and refused 23 else-if’s, while Mac OS X was accepting 692 else-if’s and refusing 693 else-if’s. On Second Life compilation is now delegated to the server, so these differences have mostly vanished. Standalone test environments and non-LL grids may still compile scripts differently.

    Compilation limits that vary by operating system in effect work as a copy-restriction mechanism. Any resident can run the script compiled by the less limited compiler, but residents who have only the more limited compiler cannot save changes to the source.

    See llGetFreeMemory, llMessageLinked.

    ERROR : Syntax error

    You must punctuate the script and spell the words of the script as will please the compiler, of course.

    Also you must make each script reasonably small. The compiler may astonishingly complain of a «syntax» error rather than politely complaining more specifically of an «out of memory» «byte code assembly failed» error, when you make a script unreasonably large.

    For example, the 2007-08 Windows Second Life client complained of a Syntax error if you cascaded too many else-if’s. The exact limits enforced can vary astonishingly. For example, the 2007-08 Windows Second Life client sometimes accepted as many as 22 cascaded else-if’s, but also sometimes rejected as few as 19 cascaded else-if’s, depending on other details of the script.

    Programmers who learned LSL on one compiler may feel that that compiler’s limits are reasonable, e.g., up to five hundred cascaded else-if’s in Mac OS X, while programmers trained on another compiler may feel instead that only its significantly different limits are reasonable, e.g., no more than a dozen cascaded else-if’s in Windows.

    Понравилась статья? Поделить с друзьями:
  • Run time error 2147417848 80010108 vba excel
  • Run time error 2147319779
  • Run time error 2147221040 800401d0
  • Run time error 2147023170 800706be
  • Run time error 2146697208 800c0008 как исправить