03.02.2019, 23:05
(
Последний раз редактировалось Alteh; 04.02.2019 в 06:41.
)
Код:
[debug] Run time error 12: "(sleep mode)" [debug] Backtrace (most recent call first): #0 public Malloc_SolidifyTimer()+0x3d178 from GameMode.amx
Код:
//OnScriptInit
SetTimer("Malloc_SolidifyTimer", 0, 0);
SetTimer("Malloc_SolidifyTimer", 0, 0);
forward Malloc_SolidifyTimer();
public Malloc_SolidifyTimer()
{
P:1("Malloc_SolidifyTimer called");
Malloc_TrySetup();
Malloc_SolidifyHeap();
}
static Malloc_SolidifyHeap()
{
if (YSI_g_sHeapSetup == 2) return 1;
++YSI_g_sHeapSetup;
#emit LCTRL 3
#emit MOVE.alt
#emit SCTRL 5
#emit SCTRL 4 // Set the original stack pointer.
// Call to save "stk" and "frm", since they aren't in early builds.
#emit PUSH.C 0
#emit SYSREQ.C heapspace // The pre-processor can't touch this.
#emit STACK 4
// Unfortunately, "heapspace" has a parameter pushed first so it saves the
// wrong stack value (the value 4 below where it should be). The only other
// opcode that reliably saves "stk" in "amx->stk" without trying to call a
// native function is "OP_RETN", so let's BADLY invoke it! Note that we
// still need the "heapspace" call (or any function call) to save "hea" and
// "frm", which are NOT saved by "OP_RETN" but are by "OP_SYSREQ_C".
#emit PUSH.C 0 // No parameters
#emit LCTRL 6 // Return to the next instruction...
#emit ADD.C 20
#emit PUSH.pri
#emit PUSH.alt // Same frame.
#emit RETN
// "return" to here...
#emit HALT 12
return 0;
}
static Malloc_TrySetup()
{
P:1("Malloc_TrySetup called");
new
temp;
#emit LCTRL 3
#emit STOR.S.pri temp
if (temp > Malloc_FindStackTop() + 4)
{
P:W("y_malloc set up via \"CallLocalFunction\", memory corruption is a remote possibility");
}
temp = MALLOC_MEMORY * 4;
// Allocate a ton of space on the heap.
#emit LCTRL 2
#emit LOAD.S.alt temp
#emit ADD
#emit STOR.S.pri temp
// Now there's only the normal bit of the stack and heap left.
if (temp == AMX_HEADER_HEA + MALLOC_MEMORY * 4 * 2)
{
// Already allocated and now trying to double allocate.
return;
}
if (temp != AMX_HEADER_HEA + MALLOC_MEMORY * 4)
{
P:F("y_malloc: Not the first HEAP allocation!");
return;
}
else
{
#emit LOAD.S.pri temp
#emit SCTRL 2
if (YSI_g_sHeapStart) return;
}
YSI_g_sHeapStart = temp - MALLOC_MEMORY * 4;
P:2("Malloc_OnScriptInit: %d %d %d", YSI_g_sHeapStart, MALLOC_MEMORY * 4, AMX_HEADER_HEA);
#emit CONST.alt YSI_gMallocMemory
#emit LOAD.pri __YSI_g_sHeapStart
#emit SUB
#emit SHR.C.pri 2 // Divide by 4 to get cells.
#emit STOR.pri __YSI_g_sHeapStart
YSI_gMallocMemory[YSI_g_sHeapStart] = MALLOC_MEMORY - 1;
YSI_g_sUnusedStart = YSI_g_sHeapStart + 1;
// Blank the whole memory. Maybe required if the heap has been used
// already (better to be safe than sorry).
memset(YSI_gMallocMemory[YSI_g_sHeapStart + 1], 0, MALLOC_MEMORY - 1);
#if _DEBUG > 3
// The "#if" is actually ignored by these "#emit" codes, as always.
#emit CONST.alt YSI_gMallocMemory
#emit STOR.S.alt temp
printf("Malloc_OnScriptInit: AMX_HEADER_HEA = %d, YSI_gMallocMemory = %d, YSI_g_sHeapStart = %d", _:AMX_HEADER_HEA, temp, YSI_g_sHeapStart);
printf("Malloc_OnScriptInit: YSI_gMallocMemory + 4 * YSI_g_sHeapStart = %d", temp + 4 * YSI_g_sHeapStart);
#endif
// This is never read, but we now have a spare cell because we HAD to
// allocate an array of some size.
YSI_gMallocMemory[0] = MALLOC_MEMORY;
}
before ongamemodeinit:
Код:
main() { }
so... what do I do?
EDIT: Solved, I just had to remove crashdetect when running my game mode in VPS.
https://github.com/Zeex/samp-plugin-...ster/README.md



