NexiusTailer / Nex-AC

Anticheat system
https://pawn.wiki/index.php?/topic/27641-nex-ac/
GNU Lesser General Public License v3.0
212 stars 156 forks source link

Server Crashing [ SAMP ] #306

Closed karthigenius closed 4 months ago

karthigenius commented 4 months ago
[10/04/2024 05:12:07] Server crashed while executing ACRP.amx
[10/04/2024 05:12:07] AMX backtrace:
[10/04/2024 05:12:07] #0 native BlockIpAddress () in samp03svr
[10/04/2024 05:12:07] #1 00012b70 in public Iter_OnPlayerDisconnect (playerid=5, reason=1) at C:\Karthi\Atlantic City Roleplay\AtlanticCityRP\pawno\include\nex-ac.inc:3884
[10/04/2024 05:12:07] #2 000021b0 in public SSCANF_OnPlayerDisconnect (5, 1)  at C:\Karthi\Atlantic City Roleplay\AtlanticCityRP\pawno\include\foreach.inc:940
[10/04/2024 05:12:07] #3 00001408 in public TIMERFIX_OnPlayerDisconnect (playerid=5, reason=1) at C:\Karthi\Atlantic City Roleplay\AtlanticCityRP\pawno\include\sscanf2.inc:1157
[10/04/2024 05:12:07] #4 00000e34 in public OnPlayerDisconnect (playerid=5, reason=1) at C:\Karthi\Atlantic City Roleplay\AtlanticCityRP\pawno\include\timerfix.inc:208
[10/04/2024 05:12:07] Native backtrace:
[10/04/2024 05:12:07] #0 f790562f in _Z13GetStackTraceRSt6vectorI10StackFrameSaIS0_EEPv () in plugins/crashdetect.so
[10/04/2024 05:12:07] #1 f78fd53d in _ZN11CrashDetect20PrintNativeBacktraceERSoRKN2os7ContextE () in plugins/crashdetect.so
[10/04/2024 05:12:07] #2 f78fed58 in _ZN11CrashDetect20PrintNativeBacktraceERKN2os7ContextE () in plugins/crashdetect.so
[10/04/2024 05:12:07] #3 f78fef1c in _ZN11CrashDetect7OnCrashERKN2os7ContextE () in plugins/crashdetect.so
[10/04/2024 05:12:07] #4 f7904edf in ?? () in plugins/crashdetect.so
[10/04/2024 05:12:07] #5 f7f55570 in __kernel_rt_sigreturn () in linux-gate.so.1
[10/04/2024 05:12:07] #6 f7f55549 in __kernel_vsyscall () in linux-gate.so.1
[10/04/2024 05:12:07] #7 f7a31aa7 in ?? () in /lib/i386-linux-gnu/libc.so.6
[10/04/2024 05:12:07] #8 f79e0685 in gsignal () in /lib/i386-linux-gnu/libc.so.6
[10/04/2024 05:12:07] #9 f79c93ac in abort () in /lib/i386-linux-gnu/libc.so.6
[10/04/2024 05:12:07] #10 f7a243fc in ?? () in /lib/i386-linux-gnu/libc.so.6
[10/04/2024 05:12:07] #11 f7a2445c in __libc_fatal () in /lib/i386-linux-gnu/libc.so.6
[10/04/2024 05:12:07] #12 f7a2c26b in ?? () in /lib/i386-linux-gnu/libc.so.6
[10/04/2024 05:12:07] #13 f7a3306a in pthread_mutex_lock () in /lib/i386-linux-gnu/libc.so.6
[10/04/2024 05:12:07] #14 0808e7f1 in ?? () in ./samp03svr
[10/04/2024 05:12:07] #15 0806d7e7 in ?? () in ./samp03svr
[10/04/2024 05:12:07] #16 080d75de in ?? () in ./samp03svr
[10/04/2024 05:12:07] #17 080950e4 in ?? () in ./samp03svr
[10/04/2024 05:12:07] #18 f7900168 in _ZN11CrashDetect10OnCallbackEiPiS0_ () in plugins/crashdetect.so
[10/04/2024 05:12:07] #19 f79032ab in ?? () in plugins/crashdetect.so
[10/04/2024 05:12:07] Registers:
[10/04/2024 05:12:07] EAX: 00000000 EBX: 00000010 ECX: 00000010 EDX: 00000006
[10/04/2024 05:12:07] ESI: 00000010 EDI: f79a7fc0 EBP: ffd184a8 ESP: ffd18200
[10/04/2024 05:12:07] EIP: f7f55549 EFLAGS: 00200246
[10/04/2024 05:12:07] Stack:
[10/04/2024 05:12:07] ESP+00000000: ffd184a8 00000006 00000010 f7a31aa7
[10/04/2024 05:12:07] ESP+00000020: ffd184a8 00000000 ffd18300 f7a36f16
[10/04/2024 05:12:07] ESP+00000040: 00000000 00000000 00000000 00000000
[10/04/2024 05:12:07] ESP+00000060: ffd18310 f142a014 ffd18298 0807bba8
[10/04/2024 05:12:07] ESP+00000080: 00000002 54ca2531 008fcf67 00000000
[10/04/2024 05:12:07] ESP+000000a0: ffd18310 ffd18310 00000001 5c740e00
[10/04/2024 05:12:07] ESP+000000c0: f79a7fc0 ffd18428 ffd184a8 f79e0685
[10/04/2024 05:12:07] ESP+000000e0: ffffffff f79e066a f7bd3000 f79c93ac
[10/04/2024 05:12:07] ESP+00000100: 00000020 00000000 f7bd1a60 f7a1bb7f
[10/04/2024 05:12:07] ESP+00000120: f7b6ace8 ffd184c1 f7bd3000 f7a26b37
[10/04/2024 05:12:07] ESP+00000140: 0894704f f32969d8 00000005 00000000
[10/04/2024 05:12:07] ESP+00000160: 00000009 088d5a60 f3296c11 f7f60548
[10/04/2024 05:12:07] ESP+00000180: ffd18448 f32969dd 00000005 f7f8e000
[10/04/2024 05:12:07] ESP+000001a0: 19893679 00000000 088a3e50 f7f609a6
[10/04/2024 05:12:07] ESP+000001c0: 00000000 00000003 00001000 f7abe146
[10/04/2024 05:12:07] ESP+000001e0: 00000000 ffffffff 00000000 5c740e00
[10/04/2024 05:12:07] ESP+00000200: 00000000 00001000 00000003 5c740e00
[10/04/2024 05:12:07] ESP+00000220: f7b6ae88 00000036 9e5c5cde 0007cafc
[10/04/2024 05:12:07] ESP+00000240: f7b6ae88 00000036 00000000 f7a242b7
[10/04/2024 05:12:07] ESP+00000260: a69f0e1f ffd18420 00000008 00000001
[10/04/2024 05:12:07] ESP+00000280: f7f51080 00000000 f7f5572b 5c740e00
[10/04/2024 05:12:07] ESP+000002a0: f7b6ae88 f7bd3000 ffd18538 f7a2445c
[10/04/2024 05:12:07] ESP+000002c0: ffd18590 0894d21d 00000000 f7a2c26b
[10/04/2024 05:12:07] ESP+000002e0: 0894d21d 00000000 f7bd3000 f7a3306a
[10/04/2024 05:12:07] ESP+00000300: 00000000 00000000 00000002 ffd18590
[10/04/2024 05:12:07] ESP+00000320: 0894d21d 00000000 f7bd6ce0 f7a76318
[10/04/2024 05:12:07] ESP+00000340: 0894d21d ffd1859c ffd185e8 5c740e00
[10/04/2024 05:12:07] ESP+00000360: 00000000 00002ee0 0894ce94 ffd18590
[10/04/2024 05:12:07] ESP+00000380: 0894ce94 ffd18590 00002ee0 0000000f
[10/04/2024 05:12:07] ESP+000003a0: e9b64f48 ffd185b8 ffd185bc f78f7e9d
[10/04/2024 05:12:07] ESP+000003c0: e9592010 00002a28 ffd185f8 080950e4
[10/04/2024 05:12:07] ESP+000003e0: 00012b70 00000000 080d7540 f796d000
[10/04/2024 05:12:07] Loaded modules:
[10/04/2024 05:12:07] 00000000 - 00187dc3 samp03svr
[10/04/2024 05:12:07] f7f55000 - f7f563c2 linux-gate.so.1
[10/04/2024 05:12:07] f7f46000 - f7f46ac8 /lib/i386-linux-gnu/libdl.so.2
[10/04/2024 05:12:07] f7f41000 - f7f42168 /lib/i386-linux-gnu/libpthread.so.0
[10/04/2024 05:12:07] f7d0d000 - f7f4dc71 /lib/i386-linux-gnu/libstdc++.so.6
[10/04/2024 05:12:07] f7c05000 - f7d0bb94 /lib/i386-linux-gnu/libm.so.6
[10/04/2024 05:12:07] f7bde000 - f7c01ea0 /lib/i386-linux-gnu/libgcc_s.so.1
[10/04/2024 05:12:07] f79a9000 - f7be4f05 /lib/i386-linux-gnu/libc.so.6
[10/04/2024 05:12:07] f7f57000 - f7f8eb8d /lib/ld-linux.so.2
[10/04/2024 05:12:07] f796e000 - f79a5844 plugins/sscanf.so
[10/04/2024 05:12:07] f78e3000 - f796da04 plugins/crashdetect.so
[10/04/2024 05:12:07] f78db000 - f78e22bd plugins/timerfix.so
[10/04/2024 05:12:07] f78d2000 - f78d30cc /lib/i386-linux-gnu/librt.so.1
[10/04/2024 05:12:07] f77d7000 - f78d3631 plugins/streamer.so
[10/04/2024 05:12:07] f761f000 - f77e173c plugins/pawncmd.so
[10/04/2024 05:12:07] f7565000 - f761f1b1 plugins/SKY.so
[10/04/2024 05:12:07] f71d4000 - f7569eb2 plugins/mysql.so
[10/04/2024 05:12:07] f71b0000 - f71d3d32 /home/container/plugins/../log-core.so
[10/04/2024 05:12:07] f5d6d000 - f5ffebb6 plugins/bcrypt-samp.so
[10/04/2024 05:12:07] f5900000 - f5d8f8a6 plugins/discord-connector.so
[10/04/2024 05:12:07] f56eb000 - f590b348 /home/container/plugins/../log-core2.so
[10/04/2024 05:12:07] f3150000 - f3309815 plugins/sampvoice.so
[10/04/2024 05:12:07] f15e8000 - f1809344 plugins/FCNPC.so
[10/04/2024 05:12:07] f78d7000 - f78d8f70 plugins/nativechecker.so

I haven't used BlockIpAddress () anywhere in my script other than the following code

forward OnCheatDetected(playerid, ip_address[], type, code);
public OnCheatDetected(playerid, ip_address[], type, code)
{
      if (type == AC_GLOBAL_TRIGGER_TYPE_PLAYER)
      {
          switch(code)
          {
              case 5, 6, 11, 22:
              {
                  return 1;
              }
              case 32: // CarJack
              {
                  new
                      Float:x,
                      Float:y,
                      Float:z;

                  AntiCheatGetPos(playerid, x, y, z);
                  return SetPlayerPos(playerid, x, y, z);
              }
              default:
              {
                  if (gettime() - pAntiCheatLastCodeTriggerTime[playerid][code] < AC_TRIGGER_ANTIFLOOD_TIME)
                      return 1;

                  pAntiCheatLastCodeTriggerTime[playerid][code] = gettime();
                  AC_CODE_TRIGGERED_COUNT[code]++;

                  new trigger_type = AC_CODE_TRIGGER_TYPE[code];

                  switch(trigger_type)
                  {
                      case AC_CODE_TRIGGER_TYPE_DISABLED: return 1;
                      case AC_CODE_TRIGGER_TYPE_WARNING:
                      {
                       new str[128];
                       format(str, sizeof(str),"%s[%d] suspected of using cheat programs: %s [code: %03d].", GetRPName(playerid), playerid, AC_CODE_NAME[code], code);
                       SendAdminMessage(COLOR_RED, str);
                       SM(playerid, -1, "You were suspected of using cheat programs: %s [code: %03d].", AC_CODE_NAME[code], code);
                       new szString[128];
                       format(szString, sizeof(szString), "%s[%d] suspected of using cheat programs: %s [code: %03d].", GetRPName(playerid), playerid, AC_CODE_NAME[code], code);
                      }
                      case AC_CODE_TRIGGER_TYPE_KICK:
                      {
                       new str[128];
                       format(str, sizeof(str),"%s[%d] was kicked on suspicion of using cheat programs: %s [code: %03d].", GetRPName(playerid), playerid, AC_CODE_NAME[code], code);
                       SendAdminMessage(COLOR_RED, str);
                          SM(playerid, -1, "You were kicked on suspicion of using cheat programs: %s [code: %03d].", AC_CODE_NAME[code], code);
                          AntiCheatKickWithDesync(playerid, code);
                      }
                  }
              }
          }
      }
      else // AC_GLOBAL_TRIGGER_TYPE_IP
      {
          AC_CODE_TRIGGERED_COUNT[code]++;
          new str[128];
          format(str, sizeof(str),"<AC-BAN-IP> IP address %s was blocked: %s [code: %03d].", ip_address, AC_CODE_NAME[code], code);
          SendAdminMessage(COLOR_RED, str);
          BlockIpAddress(ip_address, 0);
      }
      return 1;
}

The Crash Debug Showing the Native Crash, Which was used only in your Include.

I really wanna know this is happening...

Note:

This was not happening every time, But Happening Sometime.

NexiusTailer commented 4 months ago

I don't see the cause in my include since the crash occurs in a server native.

Do you use any memhack plugins like YSF, SKY or anything like this? Also, which server server are you on (0.3.7 R2/R3?)

karthigenius commented 4 months ago

I don't see the cause in my include since the crash occurs in a server native.

Do you use any memhack plugins like YSF, SKY or anything like this? Also, which server server are you on (0.3.7 R2/R3?)

Plugins that i am Using ...

sscanf.so crashdetect.so timerfix.so streamer.so pawncmd.so SKY.so mysql.so bcrypt-samp.so discord-connector.so sampvoice.so FCNPC.so nativechecker.so

Server Version 0.3.7 R2

karthigenius commented 4 months ago

i agree with the point you mentioned

The sky include was declared after your anti-cheat,

The weapon-config was added after your anti-cheat to avoid conflict and the weapon config is using the sky include

NexiusTailer commented 4 months ago

Try to replace SKY plugin with Pawn.RakNet as a dependency for weapon-config.

karthigenius commented 4 months ago

Try to replace SKY plugin with Pawn.RakNet as a dependency for weapon-config.

Pawn.Raknet is Crashing with SAMP voice latest Plugin In SAMP

NexiusTailer commented 4 months ago

Oh, then try to temporary disable SKY & weapon-config. It's important to understand if this plugin is the real cause or there is something else.

karthigenius commented 4 months ago

Oh, then try to temporary disable SKY & weapon-config. It's important to understand if this plugin is the real cause or there is something else.

Actually, The crash was random and Not Happening every time, I found that this is not Anticheat issue , Because the Crash Happening while a random player disconnecting,

So i checked the callback, The only thing i added was following code into OnPlayerDisconnect callaback

if(PlayerInfo[playerid][pPrisonActor] != INVALID_PLAYER_ID)
{
    if(IsValidDynamicActor(PlayerInfo[playerid][pPrisonActor]))
    {
        DestroyDynamicActor(PlayerInfo[playerid][pPrisonActor]);
    }
}

so it seems like the crash is related to Streamer Plugin and I didn't get any crash like this before using these natives

karthigenius commented 4 months ago

The Issue was not because of Nex AC and i am closing the issue