Jump to content

[41.71] [MP Dedicated/Self(?)] Modded Map Set Total Cell Count Has A Limit Due To Heap Buffer Overflow


UdderlyEvelyn

Recommended Posts

Version: 41.71
Mode: MP/Dedicated
Mods: Many mods, but it doesn't matter which as long as the total number of cells affected by the map mods hits a certain amount, so it's not technically "mod-specific".
Old/New Save: Happens with old or new once you cross the line of how many cells.

 

Reproduction:
1. Install lots of map mods, particularly ones that add many cells to make it easier to hit the limit like Slocan Lake, Fort Knox, and Eerie Country along with a bunch more.
2. Run the server (this part works fine).
3. Join with any client, you will be greeted with a blank screen that says "Quit to Desktop" at the bottom on a button (the error has no translation so appears blank). The actual error is that map_zone.bin can't be saved, and the log preceding it tells you it's because the heap has been overflowed.

 

If you check the log on client *or* server it will give you more detail about the error, here's an example of a local dedicated server kicking me for it:

ERROR: General     , 1658611037615> 2,414,282,505> java.nio.BufferOverflowException
ERROR: General     , 1658611037615> 2,414,282,505>     at java.base/java.nio.Buffer.nextPutIndex(Unknown Source)
ERROR: General     , 1658611037615> 2,414,282,505>     at java.base/java.nio.HeapByteBuffer.putShort(Unknown Source)
ERROR: General     , 1658611037615> 2,414,282,505>     at zombie.iso.IsoMetaGrid.saveZone(IsoMetaGrid.java:1852)
ERROR: General     , 1658611037615> 2,414,282,505>     at zombie.network.GameServer.receiveRequestData(GameServer.java:5385)
ERROR: General     , 1658611037615> 2,414,282,505>     at zombie.network.PacketTypes$PacketType.onServerPacket(PacketTypes.java:1012)
ERROR: General     , 1658611037615> 2,414,282,505>     at zombie.network.GameServer.mainLoopDealWithNetData(GameServer.java:1541)
ERROR: General     , 1658611037615> 2,414,282,505>     at zombie.network.GameServer.main(GameServer.java:816)
WARN : General     , 1658611037615> 2,414,282,505> GameServer.kick> The player UdderlyEvelyn was kicked. The reason was You have been kicked from this server because map_zone.bin could not be saved., null

 

It would seem to me that if this heap could be increased, or if perhaps the process could be distributed among multiple calls instead of one go, it would fix the issue. I'm also curious if generating the initial files in SP and then transferring them to the dedicated server (not sure if this is a one-time generation or if it's generated every time one joins, etc. - still learning the save format) would allow this to be bypassed, since this does not occur in SP.


As a quick way to fix it, perhaps the buffer can be initialized based on the cell count in the maps (I assume it has to do with the number of cells since removing larger maps seems to let you add multiple smaller maps, but this is a guess) rather than a fixed value (I assume it is a fixed value at present)? 

 

Since this is one such error, I'd also like to ask why some errors force you to quit to desktop when joining a server - they don't seem the right kind of fatal to need that and it makes troubleshooting/testing take way longer. If possible I'd request that this not occur with such errors on join, but I understand if there's technical reasons I am unaware of for it (I am a programmer myself, but I have not read PZ's code or anything as yet).

 

Edit: Example list of map mods (and required tilesets) that is just shy of the limit, install one or two more and it will cause the issue:

Mods=tkTiles_01;DylansTiles;Diederiks Tile Palooza;FantaStreetTiles_01;AdmMTiles;BigZombieMonkeys_tile_pack;SkizotsTiles;GreensTiles;EN_Flags;AquatsarYachtClub;KingsmouthKY;wildberries;RedRacer;hopewell_eng;Trelai_4x4_Steam;NWBlockade;Ashenwood;FortKnoxLinked;FortKnoxRoad;BedfordFalls;BillionaireSafehouse;Blackwood;CONRTF;Chernaville;DeadinHongKong;DeltaCreekMunitions;EdsAutoSalvage;EerieCountry;Elysium_Island;firecamp;Fort Benning;FORTREDSTONE;Fort Waterfront;FrankfortKY;Grapeseed;Greenleaf;InGameMaps;InGameMaps_FortKnoxLinked;InGameMaps_FortKnoxRoad;klin;Laconia;Laconia Expansion;lakeivytownship;Linden;LittleTownship;Militaryairport;MonmouthCounty;MRE;Muldraugh Fire Department;Riverside Fire Department;NewEkron;ParkingLot;EN_Newburbs;Otr;OtrSR;PitstopLegacy;RabbitHashKY;RavenCreek;Refordville;rbr;rbrA;Riverwood;BedfordRoad;pz_rosewoodexp_map;SanctuaryHills;SantuarioMapMod;SaveOurStation_Core;SaveOurStation_KnoxCountry;Seaside;SecretBaseRoadV2;RavenCreekEerieCompatibleSlocanLake;RavenCreekEerieCompatibleSlocanLakeIngameMap;StudioSouthShore;Suvival's Store;TrimbleCountyPowerStation;Tugaland;West Point Fire Department;WestPointTrailerParkAndVhsStore;WesternTown;WesternScrapCarYard;Xonics Mega Mall;ExclusionZone;Chinatown;
Map=Chinatown;Northwest Blockade;Klin;Kingsmouth;NewDenver;Rosebery;Silverton;NewDenver_Connection_map;NewDenver_map;Rosebery_map;Silverton_map;li_township;RavenCreek;FortRedstone;CONRTF;Elysium_Island;MREX;militaryairport;BillionaireSafehouse;WestPointTrailerParkAndVhsStore;pz_rosewoodexp_map;NewEkron;Linden;Fort Benning;researchbase;rbr_road;RabbitHashKY;Fort Waterfront;Greenleaf;RedstoneRaceway;TrimbleCountyPowerStation;Over the River - Secondary Route;Otr;Laconia;Laconia Expansion;Trelai_4x4;Dead in Hong Kong;Suvival's Store;LittleTownship;Tugaland;Pitstop;Blackwood;Grapeseed;Bedford road;North;South;West;Near Fort Knox;To Bedford Falls;To Eerie Country;Fort Knox linked to Eerie Country_map;Eerie Country;Eerie A;Eerie B;Eerie C;Eerie D;Fort Knox linked to Eerie Country;From Bedford Falls to Fort Knox;BedfordFalls;From Bedford Falls to Fort Knox_map;Xonics Mega Mall;Xonics Mega Mall Exterior;Xonics Mega Mall Interior;Xonics Mega Mall Roof;MonmouthCounty;InGameMaps_Main;Muldraugh, KY
WorkshopItems=2707344076;2392987599;2773732963;2799120190;2671890843;2169435993;2619072426;2646041510;2831252135;2001719506;2744114761;2634426926;2832136889;2503622437;2819655145;2817859141;2800337234;2820363371;2335368829;522891356;2768818690;2536865912;2766626985;2734683361;2730975264;2797636826;2789237738;2485420813;1254546530;2693585128;2595249356;1516836158;2779248414;2582178794;2463499011;2778799110;2756689895;2595785944;2803292383;2434339338;2790749470;2804574707;2821027450;2252982049;2709828723;2542249811;2778676843;2737546323;2804453891;2789097802;2712480036;2789257975;2671414643;926737806;2603239477;2597946327;2815966702;2196102849;2726058465;2807152393;2802298898;2735894249;2718350686;2775803004;2783077891;2398274461;2783179512;2183283602;2461163224;2753396660;2672968796;2802755864;2781180323;2787439893;2721653030;2819565407;2800054149;1713269594;2785623545;2384329562;2599752664;2337452747;2554699200;2711526629;2804428637;2774834715;2740919036;2734679675;2772575623;2478247379;2785549133;2799152995;2719592131;2818847163;2778576730;2618213077;2811383142;2805630347;2469388752;2566953935;2489148104;2516123638;2522173579;2441990998;2443275640;2422681177;2409333430;2642541073;2457212020;2498500781;2273010892;2675429658;2567438952;2282429356;2592358528;2743496289;2811232708;2681635926;2636100523;2792425535;2782258356;1510950729;2771297715;2781895054;2759339330;2732639855;1475243816;2791656602;2064137012;1773965512;2292487242;2734164805;2830343776;2834352171;2694079976;2730158335;2809595776;2808679062;2127583399;2760742937;2241990680;2594865484;2688676019;2711057211;2286124931;1924146603;1988306113;2513537093;2701170568;2798170078;2616986064;2402057349;2714198296;2553593324;2706119869;2434125078;2454293014;2685168362;2075777590;2732804047;1517585848;2657661246;2377867605;2687515849;2142622992;2815560151;1922750845;2704811006;2831590169;2366717227;2688151429;2769706949;1955995443;2809719515;2696083206;1651019937;2629074154;2759895539;2709199201;2780392280;1315313725;2787291513;2507488373;2050264961;2780637194;2801714948;2688737276;2709502667;2422848231;2629286881;2658619264;2766223413;2713921292;2831715402;2048411289;2643606499;2447729538;2463184726;2392709985;710542108;2529746725;2688538916;566115016;2680473910;2688809268;2732594572;2627877543;2464581798;2577243435;2602450182;2582648054;2812890317;2458631365;2710407461;2693227148;2737665235;2237300246;2659216714;2637692469;2714848168;2651349283;2686624983;2762648316;2725378876;2289429759;2713055926;2712632417;2687798127;2752895143;2478768005;2739375743;2734051025;2495778666;2392676812;2268557398;2724151227;2613146550;2802600810;2290690369;2400370190;2401339485;2790397567;2810378872;2790428261;2800412098;2789503316;2802456220;2789839628;2784607980;2699856770;2648152698;2645975408;2801575579;2715579154;2822408566;2372994639;2681257693;2754567348;2786499395;2125659488;2122265954;2667899942;2819367991;1703604612;2445720450;2188496940;2465017864;2487022075;2648779556;2707957711;2831786301;2635550102;2795036124;2497342974;

You'll have to forgive me that the workshop items list has way more IDs than necessary for repro, I was able to easily trim the other two lists to just the relevant things but this one has not only other map mods I was adding/removing to try to troubleshoot but a lot of unrelated mod workshop IDs that I excluded from the Mod= list.

Edited by UdderlyEvelyn
Link to comment
Share on other sites

I mean, it's 66 maps and 274 mods.

 

There has to be a limit at some point. It can't just go on infinitely and proffer a good outcome. This'll mean anyone that connects will have to download a file over 10 MB just defining zones of the map.

 

But anyway: one of the problems is some mods create an absolute, unbelievable ton of vehicle spawn zones for some reason. I don't really get why that's necessary, but it seems to suddenly be common.

Link to comment
Share on other sites

Okay, in the next update the buffers for map_meta.bin and map_zone.bin have been increased. It shoudl help with this, but people with slow connections (or ones with some degree of packet loss) might have trouble joining your server, having to download potentially so much data. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...