Skip to content

UseGangZoneCheck crashes the server after GMX if NPCs are used #943

Open
@edgyaf

Description

@edgyaf

Describe the bug
The server crashes after GMX, if UseGangZoneCheck native is used at least once and NPCs are used on the server. MCVE doesn't crash, if the ConnectNPC is commented out or the UseGangZoneCheck is commented out. The server also crashes, if the NPC is kicked in OnGameModeExit (so the fact that the specified NPC is already connected after GMX doesn't matter).

To Reproduce
Steps to reproduce the behavior:

  1. Run this script (train_lv from default SA-MP package, same for the recordings):
#include <open.mp>

main()
{

}

public OnGameModeInit()
{
    print("OnGameModeInit Start");

    ConnectNPC("TrainDriverLV", "train_lv");

    for (new i, zoneid; i < MAX_GANG_ZONES; i ++)
    {
        if (random(2))
        {
            zoneid = GangZoneCreate(-random(4096), -random(4096), random(4096), random(4096));

            if (random(2))
            {
                UseGangZoneCheck(zoneid, true);
            }
        }
    }

    print("OnGameModeInit End");
}
  1. Launch the server.
  2. Enter gmx.

Expected behavior
The server doesn't crash.

Screenshots and/or logs
omp_minidump.dmp (without crashdetect)

[2024-07-28T00:37:29+0200] [Info] Loading plugin: crashdetect
[2024-07-28T00:37:29+0200] [Info]   CrashDetect plugin 4.22-3-g62f647f
[2024-07-28T00:37:29+0200] [Info] OnGameModeInit Start
[2024-07-28T00:37:29+0200] [Info] OnGameModeInit End
[2024-07-28T00:37:30+0200] [Info] Legacy Network started on port 7777
[2024-07-28T00:37:31+0200] [Info] [connection] incoming connection: 127.0.0.1:54136 id: 0
[2024-07-28T00:37:31+0200] [Info] [npc:join] TrainDriverLV has joined the server (0:127.0.0.1)
[2024-07-28T00:37:45+0200] [Info] OnGameModeInit Start
[2024-07-28T00:37:45+0200] [Info] OnGameModeInit End
[2024-07-28T00:37:45+0200] [Info] [debug] Server crashed due to an unknown error
[2024-07-28T00:37:45+0200] [Info] [debug] Native backtrace:
[2024-07-28T00:37:45+0200] [Info] [debug] #0 62093de6 in ?? () in components\GangZones.dll
[2024-07-28T00:37:45+0200] [Info] [debug] #1 002e6585 in ?? () in omp-server.exe
[2024-07-28T00:37:45+0200] [Info] [debug] #2 61fd104e in ?? () in components\LegacyNetwork.dll
[2024-07-28T00:37:45+0200] [Info] [debug] #3 002afe2e in ?? () in omp-server.exe
[2024-07-28T00:37:45+0200] [Info] [debug] #4 002a92a6 in ?? () in omp-server.exe
[2024-07-28T00:37:45+0200] [Info] [debug] #5 004cea90 in ?? () in omp-server.exe
[2024-07-28T00:37:45+0200] [Info] [debug] #6 76a77ba9 in ?? () in C:\WINDOWS\System32\KERNEL32.DLL
[2024-07-28T00:37:45+0200] [Info] [debug] #7 7710c10b in ?? () in C:\WINDOWS\SYSTEM32\ntdll.dll
[2024-07-28T00:37:45+0200] [Info] [debug] #8 7710c08f in ?? () in C:\WINDOWS\SYSTEM32\ntdll.dll
[2024-07-28T00:37:45+0200] [Info] [debug] Registers:
[2024-07-28T00:37:45+0200] [Info] [debug] EAX: 00000000 EBX: 00000d6b ECX: 063cd038 EDX: 03a42404
[2024-07-28T00:37:45+0200] [Info] [debug] ESI: 02ae5070 EDI: 03a4241b EBP: 001ef3e4 ESP: 001ef374
[2024-07-28T00:37:45+0200] [Info] [debug] EIP: 62093de6 EFLAGS: 00210287
[2024-07-28T00:37:45+0200] [Info] [debug] Stack:
[2024-07-28T00:37:45+0200] [Info] [debug] ESP+00000000: 00000000 00000000 00000000 00989680
[2024-07-28T00:37:45+0200] [Info] [debug] ESP+00000020: 0530f8a4 03a4241b 02ae5070 43480000
[2024-07-28T00:37:45+0200] [Info] [debug] ESP+00000040: 039b4304 063cd038 02ae5060 051db080
[2024-07-28T00:37:45+0200] [Info] [debug] ESP+00000060: 00000002 008f0750 008f0788 00000d6b
[2024-07-28T00:37:45+0200] [Info] [debug] ESP+00000080: 00000d6b 001ef5f0 16a13db0 02764b94
[2024-07-28T00:37:45+0200] [Info] [debug] ESP+000000a0: 00000000 00000000 00000000 00000000
[2024-07-28T00:37:45+0200] [Info] [debug] ESP+000000c0: 00000000 00000000 00000000 00000000
[2024-07-28T00:37:45+0200] [Info] [debug] ESP+000000e0: 00000000 00000000 00000000 00000000
[2024-07-28T00:37:45+0200] [Info] [debug] ESP+00000100: 00000000 d7cca131 001ef498 16a07b28
[2024-07-28T00:37:45+0200] [Info] [debug] ESP+00000120: 001ef498 00000228 00000228 00000228
[2024-07-28T00:37:45+0200] [Info] [debug] ESP+00000140: 000019e3 00000000 00000000 7ffef000
[2024-07-28T00:37:45+0200] [Info] [debug] ESP+00000160: 00002afc 63871bd3 00000022 7ffef000
[2024-07-28T00:37:45+0200] [Info] [debug] ESP+00000180: 001ef54c 01a06048 ffffffff ffffffff
[2024-07-28T00:37:45+0200] [Info] [debug] ESP+000001a0: 00000397 00000000 80000000 e2578bea
[2024-07-28T00:37:45+0200] [Info] [debug] ESP+000001c0: 7ffef000 0000aa64 77101b22 001ef598
[2024-07-28T00:37:45+0200] [Info] [debug] ESP+000001e0: 00ccccf5 004d0ed4 000019e3 61b29396
[2024-07-28T00:37:45+0200] [Info] [debug] ESP+00000200: 001ef5ec 77101810 ffffffff 001ef59c
[2024-07-28T00:37:45+0200] [Info] [debug] ESP+00000220: 00000d6b 001ef5f0 61b4f7af 00003d1d
[2024-07-28T00:37:45+0200] [Info] [debug] ESP+00000240: 16a07b28 00944a38 00000d6b 033a2098
[2024-07-28T00:37:45+0200] [Info] [debug] ESP+00000260: 001ef498 001ef800 61fda190 00000000
[2024-07-28T00:37:45+0200] [Info] [debug] ESP+00000280: 002afe2e 00003d1d 00000000 16a07b28
[2024-07-28T00:37:45+0200] [Info] [debug] ESP+000002a0: 16a07b28 16a07b28 00000d6b 00000000
[2024-07-28T00:37:45+0200] [Info] [debug] ESP+000002c0: 0e7fdc58 00001388 00000000 0262a020
[2024-07-28T00:37:45+0200] [Info] [debug] ESP+000002e0: 00000000 00000000 001ef66c 001ef66c
[2024-07-28T00:37:45+0200] [Info] [debug] ESP+00000300: 00000004 00000004 00000024 0000002f
[2024-07-28T00:37:45+0200] [Info] [debug] ESP+00000320: 00000017 0000001f 008e9068 00007470
[2024-07-28T00:37:45+0200] [Info] [debug] ESP+00000340: 008e90b8 00007470 001ef818 002a8f13
[2024-07-28T00:37:45+0200] [Info] [debug] ESP+00000360: 008679d8 008acf88 008acfa0 008acfa0
[2024-07-28T00:37:45+0200] [Info] [debug] ESP+00000380: 0085d188 0085d1c8 0085d1c8 00000007
[2024-07-28T00:37:45+0200] [Info] [debug] ESP+000003a0: 00867cf0 005621c8 005621c8 00000000
[2024-07-28T00:37:45+0200] [Info] [debug] ESP+000003c0: 6b726164 001ef700 00000001 00000024
[2024-07-28T00:37:45+0200] [Info] [debug] ESP+000003e0: 008acf80 008acf68 3f800000 008e9630
[2024-07-28T00:37:45+0200] [Info] [debug] Loaded modules:
[2024-07-28T00:37:45+0200] [Info] [debug] 002a0000 - 00580000 omp-server.exe
[2024-07-28T00:37:45+0200] [Info] [debug] 770a0000 - 77252000 ntdll.dll
[2024-07-28T00:37:45+0200] [Info] [debug] 76a60000 - 76b50000 KERNEL32.DLL
[2024-07-28T00:37:45+0200] [Info] [debug] 766c0000 - 76939000 KERNELBASE.dll
[2024-07-28T00:37:45+0200] [Info] [debug] 74f10000 - 74f6f000 WS2_32.dll
[2024-07-28T00:37:45+0200] [Info] [debug] 74f70000 - 7502a000 RPCRT4.dll
[2024-07-28T00:37:45+0200] [Info] [debug] 75a30000 - 760cd000 SHELL32.dll
[2024-07-28T00:37:45+0200] [Info] [debug] 76d60000 - 76dd9000 msvcp_win.dll
[2024-07-28T00:37:45+0200] [Info] [debug] 75690000 - 757a2000 ucrtbase.dll
[2024-07-28T00:37:45+0200] [Info] [debug] 74d10000 - 74eba000 USER32.dll
[2024-07-28T00:37:45+0200] [Info] [debug] 75030000 - 7504a000 win32u.dll
[2024-07-28T00:37:45+0200] [Info] [debug] 74ec0000 - 74ee3000 GDI32.dll
[2024-07-28T00:37:45+0200] [Info] [debug] 761c0000 - 762a2000 gdi32full.dll
[2024-07-28T00:37:45+0200] [Info] [debug] 76380000 - 76483000 CRYPT32.dll
[2024-07-28T00:37:45+0200] [Info] [debug] 76c70000 - 76cef000 ADVAPI32.dll
[2024-07-28T00:37:45+0200] [Info] [debug] 76940000 - 76a04000 msvcrt.dll
[2024-07-28T00:37:45+0200] [Info] [debug] 760d0000 - 76156000 sechost.dll
[2024-07-28T00:37:45+0200] [Info] [debug] 734d0000 - 73501000 WINMM.dll
[2024-07-28T00:37:45+0200] [Info] [debug] 73510000 - 7357d000 MSVCP140.dll
[2024-07-28T00:37:45+0200] [Info] [debug] 76600000 - 7661a000 bcrypt.dll
[2024-07-28T00:37:45+0200] [Info] [debug] 74c80000 - 74c95000 VCRUNTIME140.dll
[2024-07-28T00:37:45+0200] [Info] [debug] 75150000 - 75175000 IMM32.DLL
[2024-07-28T00:37:46+0200] [Info] [debug] 622a0000 - 622c2000 Actors.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 62280000 - 6229c000 Checkpoints.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 62260000 - 6227f000 Classes.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 62220000 - 62251000 Console.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 621b0000 - 6221d000 CustomModels.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 620e0000 - 621a7000 Databases.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 620c0000 - 620dd000 Dialogs.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 62090000 - 620b1000 GangZones.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 62060000 - 62085000 LegacyConfig.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 61fb0000 - 6205b000 LegacyNetwork.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 61f80000 - 61fa1000 Menus.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 61f40000 - 61f72000 Objects.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 61b20000 - 61cba000 Pawn.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 76a10000 - 76a5b000 SHLWAPI.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 61f10000 - 61f31000 Pickups.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 61ee0000 - 61f09000 Recordings.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 61e00000 - 61e25000 TextDraws.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 61af0000 - 61b14000 TextLabels.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 61ad0000 - 61ae9000 Timers.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 61ab0000 - 61acd000 Variables.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 61a80000 - 61aaf000 Vehicles.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 743a0000 - 743b3000 kernel.appcore.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 61730000 - 61788000 crashdetect.DLL
[2024-07-28T00:37:46+0200] [Info] [debug] 755c0000 - 75682000 SHCORE.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 757b0000 - 75a2c000 combase.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 76b60000 - 76bc3000 bcryptPrimitives.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 726b0000 - 72da1000 windows.storage.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 725e0000 - 726a7000 wintypes.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 695d0000 - 69651000 uxtheme.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 76ea0000 - 76ff5000 ole32.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 6afd0000 - 6b096000 PROPSYS.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 76620000 - 766bc000 OLEAUT32.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 77000000 - 77082000 clbcatq.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 670e0000 - 6711d000 CFGMGR32.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 62460000 - 624ec000 Windows.FileExplorer.Common.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 710b0000 - 710c9000 profapi.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 5fbb0000 - 5fc0f000 Windows.StateRepositoryPS.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 61e90000 - 61ec0000 windows.staterepositoryclient.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 61e70000 - 61e8f000 edputil.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 6b310000 - 6b4b2000 urlmon.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 6b0a0000 - 6b2da000 iertutil.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 6b2f0000 - 6b30d000 srvcli.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 6b2e0000 - 6b2eb000 netutils.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 5fb80000 - 5fba7000 cldapi.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 70550000 - 70576000 SspiCli.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 6afb0000 - 6afc2000 virtdisk.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 6ceb0000 - 6cef3000 Wldp.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 5f7f0000 - 5f874000 appresolver.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 74c50000 - 74c6f000 USERENV.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 5f7a0000 - 5f7e9000 Bcp47Langs.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 62550000 - 627d0000 OneCoreUAPCommonProxyStub.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 72520000 - 72571000 mswsock.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 6cfe0000 - 6cff2000 napinsp.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 6cfc0000 - 6cfd6000 pnrpnsp.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 74b40000 - 74bfc000 DNSAPI.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 74c10000 - 74c34000 IPHLPAPI.DLL
[2024-07-28T00:37:46+0200] [Info] [debug] 76b50000 - 76b57000 NSI.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 6cfb0000 - 6cfbe000 winrnr.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 6cf90000 - 6cfa1000 wshbth.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 6cf70000 - 6cf8e000 nlansp_c.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 6b820000 - 6b87d000 fwpuclnt.dll
[2024-07-28T00:37:46+0200] [Info] [debug] 6b880000 - 6b888000 rasadhlp.dll

Commit hash in master
https://github.com/openmultiplayer/open.mp/actions/runs/10116117829

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingnightly

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions