Someone help me understand the log CrashDetect. Please?
#1

Below is the log. When i start the server.


http://pastebin.com/90DHxUEt


When, i save the houses, bizz, sbizz and cars in mysql...


http://pastebin.com/n4zsFuWi


OBS:. I put in Pastebin , because a error here in forum.


Before I put this version of crashdetect. he only appeared errors when carrying cars and saved. Plus the server only fall after I gave GMX.

And now that I put this version, the server shortly after connecting, or start saving cars.

If someone can help me, thank you. For I know not what I do.

Sorry the english.. i from brazil.
Reply
#2

The crash was caused from CarregarTunning. You've an array with size of 1120, so the valid indexes are 0-1119. In the script, it exceeds the limits; hence it's the runtime error about Index out of bounds.

About the second one, it was a crash due to an unknown reason and it printed nothing to help us for the crash.

I will only suggest you to compile your scripts with debug info and it may give the exact line which crashed the server. It says how to do that here: https://github.com/Zeex/samp-plugin-...ith-debug-info

Do what it's written in that link and re-compile BVS2.pwn
Upload the files to the server, and run it again. The next time it will crash, post the new results here.
Reply
#3

Hey thanks for helping me )

Below is the request:

Pawn Compiler with -d2:
pawn Код:
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase

Header size:          13860 bytes
Code size:          2797976 bytes
Data size:          3727200 bytes
Stack/heap size:     262144 bytes; estimated max. usage: unknown, due to recursion
Total requirements: 6801180 bytes
Pawn Compiler with -d3
pawn Код:
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase

Header size:          13860 bytes
Code size:          3560156 bytes
Data size:          3727200 bytes
Stack/heap size:     262144 bytes; estimated max. usage: unknown, due to recursion
Total requirements: 7563360 bytes
Server_Log (i changed the array of 1120 to 1241, MAX_VEHICLES)
pawn Код:
----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3x, (C)2005-2013 SA-MP Team

[14:07:51] filterscripts = ""  (string)
[14:07:51]
[14:07:51] Server Plugins
[14:07:51] --------------
[14:07:51]  Loading plugin: streamer
[14:07:51]

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

[14:07:51]   Loaded.
[14:07:51]  Loading plugin: mysql
[14:07:51]

  > MySQL plugin R7 successfully loaded.

[14:07:51]   Loaded.
[14:07:51]  Loading plugin: crashdetect
[14:07:51]   CrashDetect v4.12 is OK.
[14:07:51]   Loaded.
[14:07:51]  Loaded 3 plugins.

[14:07:52]
[14:07:52] Filterscripts
[14:07:52] ---------------
[14:07:52]   Loaded 0 filterscripts.

[14:07:53] Carregou 0 cofres
[14:07:53] Carregou 1 cofres
[14:07:53] Carregou 2 cofres
[14:07:53] Carregou 3 cofres
[14:07:53] Carregou 4 cofres
[14:07:53] Carregou 5 cofres
[14:07:53] Carregou 6 cofres
[14:07:53] Carregou 7 cofres
[14:07:53] Carregou 8 cofres
[14:07:54] Carregou 9 cofres
[14:07:54] Carregou 10 cofres
[14:07:54] Carregou 11 cofres
[14:07:54] Carregou 12 cofres
[14:07:54] Carregou 13 cofres
[14:07:54] Carregou 14 cofres
[14:07:54] Carregou 15 cofres
[14:07:54] Carregou 16 cofres
[14:07:54] Carregou 17 cofres
[14:07:54] Carregou 18 cofres
[14:07:54] Carregou 19 cofres
[14:07:54] Carregou 20 cofres
[14:07:54] Carregou 21 cofres
[14:07:54] Carregou 22 cofres
[14:07:54] Carregou 23 cofres
[14:07:54] Carregou 24 cofres
[14:07:54] Carregou 25 cofres
[14:07:54] Carregou 26 cofres
[14:07:54] Carregou 27 cofres
[14:07:54]
---------------------------------------------------------
[14:07:54] Server Ligado: [29/11/2013 14:07:54]
[14:07:54] ---------------------------------------------------------

[14:07:54] -----------------------------
[14:07:54] *** GM - BVL RPG Iniciado ***
[14:07:54] -----------------------------
[14:07:55] 28 Orgs Carregadas
[14:07:55] [MORRO] Dono do Morro = 0
[14:07:55] Sistema de Helper Carregado! Vagas: 16
[14:07:55]  
[14:07:55]  
[14:07:55]  Brasil Street Vision
[14:07:55]  
[14:07:55] Number of vehicle models: 89
[14:07:55] [BVS]: 241 Casas Carregadas
[14:07:56] [BVS]: 7 Empresas carregadas
[14:07:57] [BVS]: 22 SEmpresas carregadas
[14:07:57] [BVS]: 129 Carros Carregados
[14:08:26] Incoming connection: 127.0.0.1:49983
[14:08:26] [join] iryston has joined the server (0:127.0.0.1)
[14:08:38] iryston Entrou no [BVL]
//I ran the command to the rescue: Bizz, Sbizz, Cars and houses in mysql
[14:09:04] [BVS]: 7 Bizz Save
[14:09:04] [BVS]: 22 SBizz Save
//Was to show, save cars. Houses save.
[14:09:04] [debug] Server crashed due to an unknown error
[14:09:05] [debug] Native backtrace:
[14:09:05] [debug] #0 7737e3be in ?? () from C:\Windows\SysWOW64\ntdll.dll
[14:09:05] [debug] #1 7737e023 in ?? () from C:\Windows\SysWOW64\ntdll.dll
[14:09:05] [debug] #2 769c14ad in ?? () from C:\Windows\syswow64\kernel32.dll
[14:09:05] [debug] #3 720d3c1b in ?? () from C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_50934f2ebcb7eb57\MSVCR90.dll
[14:09:05] [debug] #4 1000a217 in ?? () from K:\plugins\mysql.DLL
[14:09:05] [debug] #5 00469046 in ?? () from K:\samp-server.exe
[14:09:05] [debug] #6 00488afd in ?? () from K:\samp-server.exe
[14:09:05] [debug] #7 00495151 in ?? () from K:\samp-server.exe
[14:09:05] [debug] #8 00495161 in ?? () from K:\samp-server.exe
Reply
#4

Why have you set the size of the memory (from stack and heap) to 65536 (from #pragma dynamic)?

Make it greater when you get: Run time error 3: "Stack/heap collision (insufficient stack size)" only.

And by the way, it'd be 4096 * 2 = result * 2 and go on.

About that crash, I cannot help because it was due to an unknown reason. When it prints more things, then I'll be able to help you fix it.
Reply
#5

Thanks..

Where can I fix this?

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Why have you set the size of the memory (from stack and heap) to 65536 (from #pragma dynamic)?

Make it greater when you get: Run time error 3: "Stack/heap collision (insufficient stack size)" only.

And by the way, it'd be 4096 * 2 = result * 2 and go on.
And about crash..
It happens when I run this command:
pawn Код:
if(strcmp(cmd, "/save", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {

            if(PlayerInfo[playerid][pAdmin] > 1342)
            {
                if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1343) { return SendClientMessage(playerid, COLOR_GRAD1, "You dont workink! (/work)"); }
                mysql_function_query(Connect, "SELECT * FROM `empresas`", true, "SaveBizz", "");
                mysql_function_query(Connect, "SELECT * FROM `sempresas`", true, "SaveSBizz", "");
                mysql_function_query(Connect, "SELECT * FROM `veiculos`", true, "SaveCars", "");
                mysql_function_query(Connect, "SELECT * FROM `casas`", true, "SaveHouses", "");
                SendClientMessage(playerid, -1,"Starting save of, Bizz, Sbizz, Cars and Houses");
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "insufficient Permission!");
            }
        }
        return 1;
    }
Public SaveBizz:
pawn Код:
public SaveBizz()
{
    new rows, fields,TotalBusinesses;
    cache_get_data(rows, fields);
    while(TotalBusinesses < rows)
    {
        new Str[315];
        format(Str,156,"UPDATE `empresas` SET `Vendida`='%i',`Dono`='%s',`Mensagem`='%s',`Extorcao`='%s',",BizzInfo[TotalBusinesses][bOwned],BizzInfo[TotalBusinesses][bOwner],BizzInfo[TotalBusinesses][bMessage],BizzInfo[TotalBusinesses][bExtortion]);
        format(Str,315,"%s`LevelNecessario`='%i',`PrecoCompra`='%i',`EntradaCusto`='%i',`Till`='%i',`Trancada`='%i' WHERE `ID`='%i'",Str,BizzInfo[TotalBusinesses][bLevelNeeded],BizzInfo[TotalBusinesses][bBuyPrice],BizzInfo[TotalBusinesses][bEntranceCost],BizzInfo[TotalBusinesses][bTill],BizzInfo[TotalBusinesses][bLocked],TotalBusinesses);
        mysql_function_query(Connect, Str, false, "","");
        //print("");
        //print(Str);
        TotalBusinesses++;
    }
    printf("[BVS]: %d Bizz Save",TotalBusinesses);
    return 1;
}
Public SaveSBizz
pawn Код:
public SaveSBizz()
{
    new rows, fields,TotalSBusinesses;
    cache_get_data(rows, fields);
    while(TotalSBusinesses < rows)
    {
        new Str[317];
        format(Str,133,"UPDATE `sempresas` SET `Dono`='%s',`Mensagen`='%s',`Extorcao`='%s',",SBizzInfo[TotalSBusinesses][sbOwner], SBizzInfo[TotalSBusinesses][sbMessage], SBizzInfo[TotalSBusinesses][sbExtortion]);
        format(Str,317,"%s`LevelNecessario`='%i',`PrecoCompra`='%i',`EntradaCusto`='%i',`Till`='%i',`Trancada`='%i',`Comprada`='%i' WHERE `ID`='%i'",Str,SBizzInfo[TotalSBusinesses][sbLevelNeeded],SBizzInfo[TotalSBusinesses][sbBuyPrice]
        ,SBizzInfo[TotalSBusinesses][sbEntranceCost],SBizzInfo[TotalSBusinesses][sbTill],SBizzInfo[TotalSBusinesses][sbLocked],SBizzInfo[TotalSBusinesses][sbOwned],TotalSBusinesses);
        mysql_function_query(Connect, Str, false, "","");
        //print("");
        //print(Str);
        TotalSBusinesses++;
    }
    printf("[BVS]: %d SBizz save",TotalSBusinesses);
    return 1;
}
Public SaveCars
pawn Код:
public SaveCars()
{
    new rows, fields,TotalCars;
    cache_get_data(rows, fields);
    while(TotalCars < rows)
    {
        new Str[435];
        //UPDATE `veiculos` SET `Modelo`='%i',`Cor1`='value-8',`Cor2`='value-9',`Dono`='value-10',`Descricao`='value-11',`Valor`='value-12',`Vendido`='value-15',`Trancado`='value-16',`owv`='value-17',`LX`='value-18',`LY`='value-19',`LZ`='value-20',`LA`='value-21',`Grana`='value-22',`IPVATime`='value-24',`IPVA`='value-25',`Plate`='value-26' WHERE 1
        format(Str,185,"UPDATE `veiculos` SET `Modelo`='%i',`Cor1`='%i',`Cor2`='%i',`Dono`='%s',`Descricao`='%s',`Valor`='%i',",CarInfo[TotalCars][cModel],CarInfo[TotalCars][cColorOne],
        CarInfo[TotalCars][cColorTwo],CarInfo[TotalCars][cOwner],CarInfo[TotalCars][cDescription],CarInfo[TotalCars][cValue]);
        format(Str,310,"%s`Vendido`='%i',`Trancado`='%i',`LX`='%f',`LY`='%f',`LZ`='%f',`LA`='%f',",Str,CarInfo[TotalCars][cOwned],CarInfo[TotalCars][cLock],
        CarInfo[TotalCars][lx],CarInfo[TotalCars][ly],CarInfo[TotalCars][lz],CarInfo[TotalCars][langle]);
        format(Str,435,"%s`Grana`='%i',`IPVATime`='%i',`IPVA`='%i',`Plate`='%s' WHERE `cID`='%i'",Str,CarInfo[TotalCars][cGrana],CarInfo[TotalCars][cIPVATime],CarInfo[TotalCars][cIPVA],
        CarInfo[TotalCars][cPlate],CarInfo[TotalCars][cID]);
        mysql_function_query(Connect, Str, false, "","");
        //print("");
        //print(Str);
        TotalCars++;
    }
    printf("[BVS]: %d Carros Salvos", TotalCars);
    return 1;
}
Public SaveHouses
pawn Код:
public SaveHouses()
{
    new rows, fields,TotalCasas;
    cache_get_data(rows, fields);
    while(TotalCasas < rows)
    {
        new Str[603];
        format(Str,163,"UPDATE `casas` SET `HealthX`='%i',`HealthY`='%i',`HealthZ`='%i',`ArmorrX`='%i',`ArmorrY`='%i',`ArmorrZ`='%i',",HouseInfo[TotalCasas][hHealthx],
        HouseInfo[TotalCasas][hHealthy],HouseInfo[TotalCasas][hHealthz],HouseInfo[TotalCasas][hArmorrx],HouseInfo[TotalCasas][hArmorry],HouseInfo[TotalCasas][hArmorrz]);
        format(Str,380,"%s`Dono`='%s',`Descricao`='%s',`Valor`='%i',`Saude`='%i',`Colete`='%i',`Interior`='%i',`Trancado`='%i',`Vendido`='%i',",Str,HouseInfo[TotalCasas][hOwner],
        HouseInfo[TotalCasas][hDiscription],HouseInfo[TotalCasas][hValue],HouseInfo[TotalCasas][hHel],HouseInfo[TotalCasas][hArm],HouseInfo[TotalCasas][hInt],HouseInfo[TotalCasas][hLock],HouseInfo[TotalCasas][hOwned]);
        format(Str,557,"%s`Rooms`='%i',`Rent`='%i',`Rentabil`='%i',`Takings`='%i',`Vec`='%i',`Vcol1`='%i',`Vcol2`='%i',`Data`='%i',",Str,HouseInfo[TotalCasas][hRooms],HouseInfo[TotalCasas][hRent],
        HouseInfo[TotalCasas][hRentabil],HouseInfo[TotalCasas][hTakings],HouseInfo[TotalCasas][hVec],HouseInfo[TotalCasas][hVcol1],HouseInfo[TotalCasas][hVcol2],HouseInfo[TotalCasas][hDate]);
        format(Str,603,"%s`Level`='%i' WHERE `ID`='%i'",Str,HouseInfo[TotalCasas][hLevel],TotalCasas);
        mysql_function_query(Connect, Str, false, "","");
        //print("");
        //print(Str);
        TotalCasas++;
    }
    printf("[BVS]: %d Houses Save",TotalCasas);
    return 1;
}
Until yesterday was pretending save normally, I can have no idea of what is happening. =//
Reply
#6

/save is by default a client command for SA-MP so it wouldn't work. You also don't need to use SELECT clause when it's about to save (update) something to the database.

It's better to use 4 global variables that are assigned how many rows for each exist and then just run a loop and you'll be fine. For example:

pawn Код:
// global:
new
    empresas_rows,
    sempresas_rows,
    veiculos_rows,
    casas_rows
;
When you load those (on server startup), in the public function you'll get the rows so:
pawn Код:
// You load Bizz:
cache_get_data(rows, fields);
empresas_rows = rows;
pawn Код:
// Let's say you load Bizz:
cache_get_data(rows, fields);
empresas_rows = rows;
pawn Код:
// You load SBizz:
cache_get_data(rows, fields);
sempresas_rows = rows;
pawn Код:
// You load Cars:
cache_get_data(rows, fields);
veiculos_rows = rows;
pawn Код:
// You load Houses:
cache_get_data(rows, fields);
casas_rows = rows;
So you now know how many rows loaded. When you create a new one (if it's dynamic and you can create them from in-game), then just add + 1 to the variable stores the rows of it.

Remove the forward stuff from those 4.

Something like that:
pawn Код:
// OnPlayerCommandText:
if(strcmp(cmd, "/saveall", true) == 0)
{
    if(PlayerInfo[playerid][pAdmin] <= 1342) SendClientMessage(playerid, COLOR_GRAD1, "insufficient Permission!");
    {
        if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1343) return SendClientMessage(playerid, COLOR_GRAD1, "You dont workink! (/work)");
        SaveBizz();
        SaveSBizz();
        SaveCars();
        SaveHouses();
        SendClientMessage(playerid, -1,"Starting save of, Bizz, Sbizz, Cars and Houses");
    }
    return 1;
}
pawn Код:
stock SaveBizz()
{
    new Str[315];
    for(new TotalBusinesses; TotalBusinesses != empresas_rows; TotalBusinesses++)
    {
        format(Str,156,"UPDATE `empresas` SET `Vendida`='%i',`Dono`='%s',`Mensagem`='%s',`Extorcao`='%s',",BizzInfo[TotalBusinesses][bOwned],BizzInfo[TotalBusinesses][bOwner],BizzInfo[TotalBusinesses][bMessage],BizzInfo[TotalBusinesses][bExtortion]);
        format(Str,315,"%s`LevelNecessario`='%i',`PrecoCompra`='%i',`EntradaCusto`='%i',`Till`='%i',`Trancada`='%i' WHERE `ID`='%i'",Str,BizzInfo[TotalBusinesses][bLevelNeeded],BizzInfo[TotalBusinesses][bBuyPrice],BizzInfo[TotalBusinesses][bEntranceCost],BizzInfo[TotalBusinesses][bTill],BizzInfo[TotalBusinesses][bLocked],TotalBusinesses);
        mysql_function_query(Connect, Str, false, "","");
        //print("");
        //print(Str);
    }
    printf("[BVS]: %d Bizz Save", empresas_rows);
}

stock SaveSBizz()
{
    new Str[317];
    for(new TotalSBusinesses; TotalSBusinesses != sempresas_rows; TotalSBusinesses++)
    {
        format(Str,133,"UPDATE `sempresas` SET `Dono`='%s',`Mensagen`='%s',`Extorcao`='%s',",SBizzInfo[TotalSBusinesses][sbOwner], SBizzInfo[TotalSBusinesses][sbMessage], SBizzInfo[TotalSBusinesses][sbExtortion]);
        format(Str,317,"%s`LevelNecessario`='%i',`PrecoCompra`='%i',`EntradaCusto`='%i',`Till`='%i',`Trancada`='%i',`Comprada`='%i' WHERE `ID`='%i'",Str,SBizzInfo[TotalSBusinesses][sbLevelNeeded],SBizzInfo[TotalSBusinesses][sbBuyPrice]
        ,SBizzInfo[TotalSBusinesses][sbEntranceCost],SBizzInfo[TotalSBusinesses][sbTill],SBizzInfo[TotalSBusinesses][sbLocked],SBizzInfo[TotalSBusinesses][sbOwned],TotalSBusinesses);
        mysql_function_query(Connect, Str, false, "","");
        //print("");
        //print(Str);
    }
    printf("[BVS]: %d SBizz save", sempresas_rows);
}

stock SaveCars()
{
    new Str[435];
    for(new TotalCars; TotalCars != veiculos_rows; TotalCars++)
    {
        format(Str,185,"UPDATE `veiculos` SET `Modelo`='%i',`Cor1`='%i',`Cor2`='%i',`Dono`='%s',`Descricao`='%s',`Valor`='%i',",CarInfo[TotalCars][cModel],CarInfo[TotalCars][cColorOne],
        CarInfo[TotalCars][cColorTwo],CarInfo[TotalCars][cOwner],CarInfo[TotalCars][cDescription],CarInfo[TotalCars][cValue]);
        format(Str,310,"%s`Vendido`='%i',`Trancado`='%i',`LX`='%f',`LY`='%f',`LZ`='%f',`LA`='%f',",Str,CarInfo[TotalCars][cOwned],CarInfo[TotalCars][cLock],
        CarInfo[TotalCars][lx],CarInfo[TotalCars][ly],CarInfo[TotalCars][lz],CarInfo[TotalCars][langle]);
        format(Str,435,"%s`Grana`='%i',`IPVATime`='%i',`IPVA`='%i',`Plate`='%s' WHERE `cID`='%i'",Str,CarInfo[TotalCars][cGrana],CarInfo[TotalCars][cIPVATime],CarInfo[TotalCars][cIPVA],
        CarInfo[TotalCars][cPlate],CarInfo[TotalCars][cID]);
        mysql_function_query(Connect, Str, false, "","");
        //print("");
        //print(Str);
    }
    printf("[BVS]: %d Carros Salvos", veiculos_rows);
}

stock SaveHouses()
{
    new Str[603];
    for(new TotalCasas; TotalCasas != casas_rows; TotalCasas++)
    {
        format(Str,163,"UPDATE `casas` SET `HealthX`='%i',`HealthY`='%i',`HealthZ`='%i',`ArmorrX`='%i',`ArmorrY`='%i',`ArmorrZ`='%i',",HouseInfo[TotalCasas][hHealthx],
        HouseInfo[TotalCasas][hHealthy],HouseInfo[TotalCasas][hHealthz],HouseInfo[TotalCasas][hArmorrx],HouseInfo[TotalCasas][hArmorry],HouseInfo[TotalCasas][hArmorrz]);
        format(Str,380,"%s`Dono`='%s',`Descricao`='%s',`Valor`='%i',`Saude`='%i',`Colete`='%i',`Interior`='%i',`Trancado`='%i',`Vendido`='%i',",Str,HouseInfo[TotalCasas][hOwner],
        HouseInfo[TotalCasas][hDiscription],HouseInfo[TotalCasas][hValue],HouseInfo[TotalCasas][hHel],HouseInfo[TotalCasas][hArm],HouseInfo[TotalCasas][hInt],HouseInfo[TotalCasas][hLock],HouseInfo[TotalCasas][hOwned]);
        format(Str,557,"%s`Rooms`='%i',`Rent`='%i',`Rentabil`='%i',`Takings`='%i',`Vec`='%i',`Vcol1`='%i',`Vcol2`='%i',`Data`='%i',",Str,HouseInfo[TotalCasas][hRooms],HouseInfo[TotalCasas][hRent],
        HouseInfo[TotalCasas][hRentabil],HouseInfo[TotalCasas][hTakings],HouseInfo[TotalCasas][hVec],HouseInfo[TotalCasas][hVcol1],HouseInfo[TotalCasas][hVcol2],HouseInfo[TotalCasas][hDate]);
        format(Str,603,"%s`Level`='%i' WHERE `ID`='%i'",Str,HouseInfo[TotalCasas][hLevel],TotalCasas);
        mysql_function_query(Connect, Str, false, "","");
        //print("");
        //print(Str);
    }
    printf("[BVS]: %d Houses Save",casas_rows);
}
Reply
#7

Hey man, thanks for correcting the saving functions *-*
Very thanks!

I do not understand, on my computer, is crash and closing when the server starts to save.

I took over the server and put it in my VPS. with system, CentOS. and there usually saved without crash ._.

I know I've asked you over and you've helped me a lot! can be sure!
More if you can, from a look at the functions that carry data. For if the bailout was wrong, I guess also missed the load = /

http://pastebin.com/Cr92559U


Man very thanks!
You helped me a lot! of truth;
Reply
#8

You are welcome!

So the problem is that it crashes while trying to save on your computer but it does work in the VPS? It seems as an odd problem, maybe something of the MySQL plugin caused that in Windows? Although, I never had problems with R7 (even if I used that for a week or so). I'd recommend you to use either R33 (static) or R34 and it may fix your problem. The syntax/functions are pretty much the same; however there are few improvements.

Example scripts: https://code.******.com/p/sa-mp-mysq...s.rar&can=2&q=
-> login_system-cache.pwn

The loading part seems to be fine.
Reply
#9

Yes, it's weird. on my computer, does not work. (windows)
In my VPS. Works. (linux)
But that's the least of it, the important thing is to be working. as my pc I'll try to solve if I have to format. lol

Thank you! of heart. is an honor to be helped by you.

++REP!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)