pawn-lang / YSI-Includes

Just the YSI include files, none of the extra stuff.
211 stars 105 forks source link

Malloc_Free (Alloc:slot=6694182) error #575

Open MatheusAgL opened 2 years ago

MatheusAgL commented 2 years ago
[05:37:24] [debug] Long callback execution detected (hang or performance issue)
[05:37:24] [debug] AMX backtrace:
[05:37:24] [debug] #0 0003c054 in Malloc_Free (Alloc:slot=6694182) at C:\Users\MASTER-PC\Desktop\Brasil-New-Start\dependencies\YSI-Includes\YSI_Coding\y_timers\..\y_malloc\y_malloc_funcs.inc:900
[05:37:24] [debug] #1 0003db90 in _Timer_F (Timer:slot=6694182, force=6694230) at C:\Users\MASTER-PC\Desktop\Brasil-New-Start\dependencies\YSI-Includes\YSI_Coding\y_timers\y_timers_impl.inc:511
[05:37:24] [debug] #2 0006660c in FadePopup (playerid=0, tempo=2000) at systems/hud/textdraws.inc:227
[05:37:24] [debug] #3 00156adc in StopDriftScore (playerid=0) at systems/vehicles/drift/popup.inc:127
[05:37:24] [debug] #4 001564dc in OnPlayerDriftEnd (playerid=0, reason=1, Float:distance=17.72940, time=1629) at systems/vehicles/drift/popup.inc:96
[05:37:24] [debug] #5 0012aa74 in WC_OnPlayerUpdate (0)  at C:\Users\MASTER-PC\Desktop\Brasil-New-Start\dependencies\drift-detection\drift-detection.inc:165
[05:37:24] [debug] #6 00102620 in OnPlayerUpdateACT (playerid=0) at C:\Users\MASTER-PC\Desktop\Brasil-New-Start\dependencies\samp-weapon-config\weapon-config.inc:2800
[05:37:24] [debug] #7 000910f0 in public OnPlayerUpdate (0) at systems/protection/rAct.inc:339
new Timer:timer_hide_popup[MAX_PLAYERS];

timer HidePopup[2000](playerid)
    PlayerTextDrawHide(playerid, popup_textdraw[playerid]);

stock FadePopup(playerid, tempo = 2000) {
    stop timer_hide_popup[playerid];
    timer_hide_popup[playerid] = defer HidePopup[tempo](playerid);
}
MatheusAgL commented 2 years ago
[debug] Long callback execution detected (hang or performance issue)
[debug] AMX backtrace:
[debug] #0 0003c42c in Malloc_Free (Alloc:slot=6647277) at C:\Users\MASTER-PC\Desktop\Brasil-New-Start\dependencies\YSI-Includes\YSI_Coding\y_timers\..\y_malloc\y_malloc_funcs.inc:903
[debug] #1 0003df00 in _Timer_F (Timer:slot=6647277, force=0) at C:\Users\MASTER-PC\Desktop\Brasil-New-Start\dependencies\YSI-Includes\YSI_Coding\y_timers\y_timers_impl.inc:511
[debug] #2 000686c4 in public @_yTKickBanido (6647213, 0) at C:\Users\MASTER-PC\Desktop\Brasil-New-Start\gamemodes\main.pwn:166
timer KickBanido[1000](playerid) {
    return Kick(playerid);
}

defer KickBanido[1000](idplayer);
MatheusAgL commented 2 years ago

When I try the version 5.05.0505, it generates these errors:

redefinition of constant/macro (symbol "u@$")

Y-Less commented 2 years ago

Are you stopping a timer inside itself?

MatheusAgL commented 2 years ago

I did some tests and found that in the recent version I can't stop a timer in OnPlayerDisconnect, as the server freezes if the timer is already stopped.

Example:

public OnPlayerConnect(playerid) {
    LoginTimer[playerid] = repeat FinishInterpolateCamera(playerid);
}

public OnPlayerSpawn(playerid) {
    stop LoginTimer[playerid];
}

public OnPlayerDisconnect(playerid, reason) {
    stop LoginTimer[playerid];
}
tinwritescode commented 2 years ago

I did some tests and found that in the recent version I can't stop a timer in OnPlayerDisconnect, as the server freezes if the timer is already stopped.

Example:

public OnPlayerConnect(playerid) {
  LoginTimer[playerid] = repeat FinishInterpolateCamera(playerid);
}

public OnPlayerSpawn(playerid) {
  stop LoginTimer[playerid];
}

public OnPlayerDisconnect(playerid, reason) {
  stop LoginTimer[playerid];
}

same problem to me

Y-Less commented 6 months ago

Is this still a problem? I've done some more work on enabling killing timers twice.