Silenci0 / UMC

Ultimate Map Chooser plugin
Other
43 stars 16 forks source link

Occasional crash on TF2 just before map switch. (And sometimes during) #3

Closed StrikerMan780 closed 5 years ago

StrikerMan780 commented 6 years ago

UMC seems to randomly crash TF2 servers just before the map transition. It's rare, but it happens. Can't share more detail because I can't really get a bead on what may be causing it. Seems to happen either just before the scoreboard is shown, or when it tries to switch.

Silenci0 commented 6 years ago

Thank you for reporting these issues. Lets see if we can narrow the problem down a bit (aka time to play 50 questions!) since it could be something small and generally inane that could be causing the crashes:

Its okay if you don't know the answers to the above, but even the most insignificant detail could be key to figuring out the crash. Being that its occurring on map change or just before the map changes, it could be a number of things occurring at the time that lead to said crash.

StrikerMan780 commented 6 years ago

I don't think there's an interval of time. I've had the crash happen on CTF, CP, and misc maps... so I doubt it has to do with the gametype, but may be worth checking.

I find it happens most when transitioning between groups, but that may be coincidental.

I have some maps with really long filenames, like mario_dm_mariokart_2014_super_v2 (which is 32 characters!), and ctf_facing_worlds_2011.

The server has every stock TF2 map in the cycle, among dozens of custom ones. I don't use workshop, I manually upload my maps.

I have the default 3 rounds set.

If I manage to grab a crash dump from accelerator, would that help?

Silenci0 commented 6 years ago

A few crash dumps from accelerator might be helpful in pin pointing the problem.

StrikerMan780 commented 6 years ago

Odd, it happened again, but it was on a map with a name not very long, and it didn't produce a crash dump on accelerator either (happened when I transitioned from dm_blockfort to trade_clocktown_v1a, two maps on different gametypes). (And I'm pretty sure accelerator is working... has no problems making dumps if it's something like a bad entity model or whatever.)

StrikerMan780 commented 6 years ago

BTW, this is what my mapcycle looks like:

"umc_mapcycle"
{
    "Casual & Dick-Around"
    {
        "command" "exec config_casual.cfg"

        "dm_mariokart2_b3" { "command" "strkmod_mario 1" }
        "dm_mariokart3_v1" { "command" "strkmod_mario 1" }
        "dm_greenhillzone_b2" {}
        "dm_boostertower_v2" { "command" "strkmod_mario 1" }

        "mario_kart_deluxe_v2" { "command" "strkmod_mario 1" }
        "mario_kart_deluxe_v5" { "command" "strkmod_mario 1" }
        "mario_kart_2011_v3" { "command" "strkmod_mario 1" }
        "mario_kart_cp_a11f" { "command" "strkmod_mario 1;sm_lightstyles 1" }
        "mario_dm_mariokart_2014_super_v2" { "command" "strkmod_mario 1" }

        "sm64_big_boos_haunt" { "command" "strkmod_mario 1" }
        "sm64_hazy_maze_cave" { "command" "strkmod_mario 1" }

        "trade_clocktown_v1a" { "command" "mp_timelimit 60" }
        "trade_houseofchaos2" {}
        "trade_speed_highway_v1" { "command" "mp_timelimit 15" }
        "trade_jollyrogerbay_v2" { "command" "mp_timelimit 15;strkmod_mario 1" }
        "trade_plaza_station_square_v1" { "command" "mp_timelimit 15" }
        "trade_delfinoplaza_final" { "command" "mp_timelimit 15;strkmod_mario 1" }
        "trade_windfallisland_final" { "command" "mp_timelimit 15" }
        "trade_minecraft_2016_v4" { "command" "mp_timelimit 15" }
        "trade_minecraft_realms" { "command" "mp_timelimit 15" }
        "trade_duketown_v1" { "command" "mp_timelimit 15" }
        "trade_stardust" { "command" "mp_timelimit 15" }
        "trade_eden_2b" { "command" "mp_timelimit 15;sv_gravity 300" }
        "trade_mmm_v1" { "command" "mp_timelimit 50" }
        "trade_mumbos_mountain_v2" { "command" "mp_timelimit 15" }
        "trade_templeofdonger_v25" {}
        "trade_frantic_factory_v4a" {}
        "trade_psykopat2_xmas" {}
        "trade_hyrulecastle" { "command" "mp_timelimit 15" }

        "cyberpunk2_a" {}
        "oot3d_hyrule" { "command" "mp_timelimit 60" }

        "ww_outset_island" {}

        "hgss_goldenrodcity_b2" { "command" "mp_timelimit 25" }
        "pkmn_goldenrodcity_b3" { "command" "mp_timelimit 20" }
        "pkmn_saffroncity_b3" { "command" "mp_timelimit 15" }
        "pkmn_sootopoliscity_b2" { "command" "mp_timelimit 15" }

        "rats_tequila_b01" { "command" "mp_timelimit 15" }

        // Shared
    }
    "Capture The Flag"
    {
        "command" "exec config_competitive.cfg;mp_timelimit 30"

        // Stock
        "ctf_2fort" { "display" "{MAP} (Stock)" }
        "ctf_2fort_invasion" { "display" "{MAP} (Stock)" }
        "ctf_doublecross" { "display" "{MAP} (Stock)" }
        "ctf_foundry" { "display" "{MAP} (Stock)" }
        "ctf_gorge" { "display" "{MAP} (Stock)" }
        "ctf_hellfire" { "display" "{MAP} (Stock)" }
        "ctf_landfall" { "display" "{MAP} (Stock)" }
        "ctf_sawmill" { "display" "{MAP} (Stock)" }
        "ctf_thundermountain" { "display" "{MAP} (Stock)" }
        "ctf_turbine" { "display" "{MAP} (Stock)" }
        "ctf_well" { "display" "{MAP} (Stock)" }

        // Custom
        "ctf_convoy_v2" {}
        "ctf_facing_worlds_2011" { "command" "sm_classrestrict_red_snipers 2;sm_classrestrict_blu_snipers 2" }
        "ctf_spacebase" {}
        "ctf_bedrooms3" {}
        "ctf_vikings_final" {}
        "ctf_totalwar_v2" {}
        "ctf_runway2" {}
        "ctf_ocean_machine" {}
    }
    "Capture Point"
    {
        "command" "exec config_competitive.cfg"

        // Stock
        "cp_5gorge" { "display" "{MAP} (Stock)" }
        "cp_badlands" { "display" "{MAP} (Stock)" }
        "cp_cloak" { "display" "{MAP} (Stock)" }
        "cp_coldfront" { "display" "{MAP} (Stock)" }
        "cp_degrootkeep" { "display" "{MAP} (Stock)" }
        "cp_dustbowl" { "display" "{MAP} (Stock)" }
        "cp_egypt_final" { "display" "{MAP} (Stock)" }
        "cp_fastlane" { "display" "{MAP} (Stock)" }
        "cp_foundry" { "display" "{MAP} (Stock)" }
        "cp_freight_final1" { "display" "{MAP} (Stock)" }
        "cp_gorge" { "display" "{MAP} (Stock)" }
        "cp_granary" { "display" "{MAP} (Stock)" }
        "cp_gravelpit" { "display" "{MAP} (Stock)" }
        "cp_gullywash_final1" { "display" "{MAP} (Stock)" }
        "cp_junction_final" { "display" "{MAP} (Stock)" }
        "cp_mercenarypark" { "display" "{MAP} (Stock)" }
        "cp_metalworks" { "display" "{MAP} (Stock)" }
        "cp_mossrock" { "display" "{MAP} (Stock)" }
        "cp_mountainlab" { "display" "{MAP} (Stock)" }
        "cp_powerhouse" { "display" "{MAP} (Stock)" }
        "cp_process_final" { "display" "{MAP} (Stock)" }
        "cp_snakewater_final1" { "display" "{MAP} (Stock)" }
        "cp_snowplow" { "display" "{MAP} (Stock)" }
        "cp_standin_final" { "display" "{MAP} (Stock)" }
        "cp_steel" { "display" "{MAP} (Stock)" }
        "cp_sunshine" { "display" "{MAP} (Stock)" }
        "cp_vanguard" { "display" "{MAP} (Stock)" }
        "cp_well" { "display" "{MAP} (Stock)" }
        "cp_yukon_final" { "display" "{MAP} (Stock)" }

        // Custom
        "cp_lushbowl_final" {}
        "cp_hotelhell_v2" { "command" "tf_sentrygun_damage 4" }
        "cp_kakariko_b1" {}
        "cp_helmsdeep_v2" {}
        "cp_snowbridge_sm_v1b" {}
        "cp_mario_bros_beta8" {}
        "cp_npskyrimriverwood" {}
        "cp_pacman_plus_wtf" {}
        "cp_piratelife_b6" {}
        "cp_toys_v2" {}

        "rats_tequila_b01" {}
    }
    "ClusterBuck"
    {
        "command" "exec config_clusterbuck.cfg"

        "dm_wizzard" {}
        "dm_blockfort" {}
        "dm_hangumhigh_tf2" {}
        "dm_minecraft" {}
        "dm_longest_yard" {}
    }
    "Holiday Events"
    {
        "command" "exec config_competitive.cfg"

        "cp_gorge_event" { "display" "{MAP} (Stock)" }
        "cp_manor_event" { "display" "{MAP} (Stock)" }
        "cp_sunshine_event" { "display" "{MAP} (Stock)" }

        "koth_harvest_event" { "display" "{MAP} (Stock)" }
        "koth_lakeside_event" { "display" "{MAP} (Stock)" }
        "koth_maple_ridge_event" { "display" "{MAP} (Stock)" }
        "koth_moonshine_event" { "display" "{MAP} (Stock)" }
        "koth_viaduct_event" { "display" "{MAP} (Stock)" }

        "pd_pit_of_death_event" { "display" "{MAP} (Stock)" }

        "plr_hightower_event" { "display" "{MAP} (Stock)" }

        "pl_fifthcurve_event" { "display" "{MAP} (Stock)" }
        "pl_millstone_event" { "display" "{MAP} (Stock)" }

        "sd_doomsday_event" { "display" "{MAP} (Stock)" }
    }
    "King of The Hill"
    {
        "command" "exec config_competitive.cfg"

        // Stock
        "koth_badlands" { "display" "{MAP} (Stock)" }
        "koth_brazil" { "display" "{MAP} (Stock)" }
        "koth_harvest_final" { "display" "{MAP} (Stock)" }
        "koth_highpass" { "display" "{MAP} (Stock)" }
        "koth_king" { "display" "{MAP} (Stock)" }
        "koth_lakeside_final" { "display" "{MAP} (Stock)" }
        "koth_lazarus" { "display" "{MAP} (Stock)" }
        "koth_nucleus" { "display" "{MAP} (Stock)" }
        "koth_probed" { "display" "{MAP} (Stock)" }
        "koth_sawmill" { "display" "{MAP} (Stock)" }
        "koth_suijin" { "display" "{MAP} (Stock)" }
        "koth_viaduct" { "display" "{MAP} (Stock)" }

        // Custom
        "koth_megaman6_b5" {}
        "koth_saturnvalley" {}
        "koth_trainsawlaser_rc1" {}
        "koth_mansionrats_rc1" {}
        "koth_nightclub_b6" {}
        "koth_aquaticruin_final2" {}
        "koth_partyisland_v10" {}
        "koth_dead_simple_classic" {}
        "koth_hyrulecastle" {}
        "koth_atrocity" {}
    }
    "Medieval"
    {
        "command" "exec config_competitive.cfg"

        // Stock
        "cp_degrootkeep"
        {
            "display" "{MAP} (Stock)"
            "command" "sm_lightstyles 1"
        }

        // Custom
        "pl_morrigan_alley_b3" {}
        "cp_helmsdeep_v2" {}
    }
    "Pass Time"
    {
        "command" "exec config_competitive.cfg"

        // Stock
        "pass_timbertown" { "display" "{MAP} (Stock)" }
        "pass_district" { "display" "{MAP} (Stock)" }
        "pass_brickyard" { "display" "{MAP} (Stock)" }

        // Custom
        "pass_turbine_a1" {}
        "pass_soccer_b3" {}
        "pass_volley_beach_a1" {}
        "pass_stadium" {}
    }
    "Payload & Payload Race"
    {
        "command" "exec config_competitive.cfg"

        // Stock
        "plr_bananabay" { "display" "{MAP} (Stock)" }
        "plr_hightower" { "display" "{MAP} (Stock)" }
        "plr_nightfall_final" { "display" "{MAP} (Stock)" }
        "plr_pipeline" { "display" "{MAP} (Stock)" }

        "pl_badwater"  { "display" "{MAP} (Stock)" }
        "pl_barnblitz" { "display" "{MAP} (Stock)" }
        "pl_borneo" { "display" "{MAP} (Stock)" }
        "pl_cactuscanyon" { "display" "{MAP} (Stock)" }
        "pl_enclosure_final" { "display" "{MAP} (Stock)" }
        "pl_frontier_final" { "display" "{MAP} (Stock)" }
        "pl_goldrush" { "display" "{MAP} (Stock)" }
        "pl_hoodoo_final" { "display" "{MAP} (Stock)" }
        "pl_snowycoast" { "display" "{MAP} (Stock)" }
        "pl_swiftwater_final1" { "display" "{MAP} (Stock)" }
        "pl_thundermountain" { "display" "{MAP} (Stock)" }
        "pl_upward" { "display" "{MAP} (Stock)" }

        // Custom
        "pl_victoryroad_b1" {}
        "pl_minepit" {}
        "pl_minecraft_redstone_s15" {}
        "pl_morrigan_alley_b3" {}
        "pl_donkeykong_final" {}
        "pl_jungle_a1c" {}
    }
    "Player Destruction"
    {
        "command" "exec config_competitive.cfg"

        "pd_watergate" {}
    }
    "Race"
    {
        "command" "exec config_competitive.cfg"

        "wacky_races_v2" {}
        "balloon_race_v3_t9" {}
    }
    "Sniper Wars"
    {
        "command" "exec config_snipermatch.cfg"

        "sn_goldeneye" {}
        "sn_snipeorama_tf2" {}
        "sn_sniper_tajmahal_deluxe" {}
        "sn_furor_teutonicus" {}
        "sniper_hac_tomb" {}
        "sniper_paintball_rc1" {}
        "dm_hangumhigh_tf2" {}
    }
    "Special Delivery"
    {
        "command" "exec config_competitive.cfg"

        // Stock
        "sd_doomsday" { "display" "{MAP} (Stock)" }
    }
    "Surf"
    {
        "command" "exec config_surf.cfg"

        "surf_horizon_v3" {}
        "surf_utopia_v3" {}
        "surf_supermario" {}
    }
    "Territorial Control"
    {
        "command" "exec config_competitive.cfg"

        // Stock
        "tc_hydro" { "display" "{MAP} (Stock)" }
    }
    "Team Deathmatch"
    {
        "command" "exec config_tdm.cfg"

        "Arena_Metal_Gear_Solid_1" {}
    }
}
Silenci0 commented 6 years ago

Thank you for sharing your map cycle file. After looking over this and doing some digging there are a number of conclusions I have come to and information that I can provide. A lot of this will be conjecture/assumptions, but considering the depth of the problem, the mitigation/solution to this issue might be among the various considerations established below. This will be a long post with a lot of tech jargon (sorry in advance). Its a lot of ground to cover, but I hope that it is informative/helpful.

Lets dive into the potential problems:

  1. There are too many maps in the cycle file. Looking into this angle, I did find that several server owners for CS:GO had complained about there being a lag issue on their servers every time a map vote would come up/load in-game. A lot of these people had stated that part of this reason might have been due to how many maps they had in their lists (most had 200+ maps in their umccycle file). This, however, did not state if they were using commands/configs within their map file for any particular groups or what other plugins. While I realize this isn't CS:GO, they were still using UMC and it was the previous version of it. Since my version is a fork that I updated for ZPS as well as adding general fixes/features, it is bound to have some of the problems of the original plugins that are more complex to deal with.
  2. Too many plugins doing too much on the server, which can cause potential problems when left unchecked. Along side the UMC plugin and all the maps/configs/commands it has to load upon doing a change map (or calling a vote), the potential of other plugins that are running on the server contributing to the crash alongside UMC is also very likely as plugins can easily have small leaks in memory or possible problems with operation or conflicts with one another. This, alongside other factors (such as maps, their entity/edict count, specific configs/gamemodes being used, and general back end performance of the game's engine/server software in question) can easily add up and cause various issues (lag, crashes, rubber banding, etc.).
  3. There is too much to parse for the plugin, causing it to have a harder time in handling any commands upon map change and resulting in a crash exclusively due to the plugin. This goes along the same logic as 2 (where too many plugins are doing too much), but the thing that tips the scale is the UMC plugin doing its operations prior to the map change (such as issuing map commands or configuration changes), causing the crash.
  4. Edict issues involving maps. Sometimes maps are not as optimized as they could be. While not all of them can cause this problem, some maps can be so poorly optimized that certain things simply remain in memory even after the map change. This is also in part due to the engine and how it handles memory allocation/deallocation, which also factors into this to some degree. In the case of too many edicts or issues involving too many edicts, over time, it can cause the server to crash or hardlock, particularly after many map changes to maps with high edict counts and/or poor optimization, which might explain the rare/spontaneousness of the crashes.

With the above in mind, there are a few possible mitigations to this issue:

  1. In regards to above problems 1 and 3, changing how the plugin works/parses info and how it handles information in general would most likely fix this problem, however, it would require a complete re-write of the plugin. Because of the work involved with re-writing UMC, it would be better to make a new plugin altogether. The idea has been passed around a few times over the the years to make a new plugin with UMC's verbosity of features with a more streamlined approach, however its never really been pursued too much. Admittedly, it would be better to make a new plugin for mapchoosing than continuing to use UMC (but it still does not solve UMC's problem).

  2. Clean up the UMC configuration file and reduced the number of groups/maps. In the configuration file that you have shared, you have about 184 map entries (which is quite a bit of maps) spread across a variety of groups all of which have several different configurations, options, and commands that are executed. Simplifying or reducing the amount of groups/maps/commands/etc. in the UMC map cycle file might help alleviate this issue or make it less frequent. Several tasks can be broken down from this:

    • Combine several map groups together. For example, a number of the map groups that use exec config_competitive.cfg could be combined into one to two map groups rather than several smaller groups. This might help alleviate the problem of the plugin trying to parse/create many map groups for these maps.
    • Reduce the number of maps in your configuration file. Because you have a lot of maps (and some of them have a few specific configurations in them) it might be worth while to see if you can reduce the number of maps you have in rotation. Old maps, maps that do not get played often, duplicate map entries (having similar version of mariokart or duplicate entries like rats_tequila) or maps that are fun but terribly optimized (goes along with problem 4 in terms of edict problems) might need to be removed from the server. Being that your server seems to host a lot of maps, you might want to consider removing unplayed/unpopular maps first before anything else.
    • Consider using map specific configs instead of using the plugin to issue commands for specific maps. I'm not sure if TF2 still has this feature/function anymore, but if it does, it might be better to have a map config for any specific commands for each map so that it reduces the amount of things the plugin itself has to do. To do that, create a cfg file named after a map and place it in the servers tf/cfg directory. You may want to test that to see if it works or not first though, just in case.
    • Potentially remove the display commands from the stock maps. Because there are a lot of stock maps and a lot of maps with specific commands and a lot of groups/maps in general, it might create less work for the plugin. Alternatively, it might be a good idea to put all stock maps into their own specific group(s) where you can just put (Stock) in the group name instead.
  3. Ensure all plugins are up-to-date and are necessary (this goes along with the 2nd item. If you have maps that certain plugins rely on and those maps don't get played, it might be worth while to remove those plugins if they are not needed. It might also be a good idea to make sure the plugins you are using are updated and work with TF2 (make a back up of the old plugins just in case you decide to upgrade). If you are using custom plugins, make sure those are up-to-date with the version of Sourcemod that you are using and make sure that they are not conflicting with other plugins.

In the end, most of the mitigations/solutions are not exactly easy things to do, require a lot of work, and may not actually fix the problem (though in all likelihood will reduce the occurrence of said issue). Because we are not sure of the specifics of this crash, pinpointing the actual cause of the crash will help in solving it.

Assuming the problem is UMC itself, the best solution would be a re-write/new map plugin based on UMC's feature set if the problem is how UMC parses maps, commands, and other such things. However, this would realistically take a long time to accomplish. While better as a long term solution, it might not happen any time soon (time constraints and such for myself or possibly other modders would make getting a working solution more difficult on top of design of the plugin and what features will/won't get added etc.) so it would not solve the immediate problem in the short term, which does not help with the problem currently being experience right now.

For short term results, the other mitigations may help reduce the likelihood of a crash being caused by certain aspects of UMC and/or other plugins and configurations being loaded by simplifying what is being run/used on the server. This assumes that UMC is only part of the problem but not truly the root cause. For example, it could very well be that UMC is working correctly, but because other plugins and configs are running and doing a lot of stuff in the background simultaneously to UMC, the problem that occurs during a map change might be happening when the UMC plugin loads new configs and commands before or after map change, which could be causing the crash as well. Because its occurrence is occasional and does not happen often or every time after a set period of time/map changes, this leads me to believe that UMC is not necessarily the issue specifically, but in all likelihood a part of the overall problem that results in a crash.

For now, I will work on the other issues in an attempt fix those, but I believe this issue is more complex and will ultimately take more time/information to pinpoint and resolve the specific issue. It could very well be a possibility that I cannot resolve it due to the plugin's design which might require a re-write or a completely new plugin. I will leave this issue open in case more information is available, but I cannot guarantee a quick/meaningful resolution to this issue at this time.

StrikerMan780 commented 6 years ago

Speaking of new plugins, I've long wanted someone to make an extension for Mapchooser Extended that allows you to vote for a config, or a mapcycle file (changing the mapcyclefile cvar), before the main map vote, because at least there, I know it's stable. I don't crash if I'm not using UMC. Perhaps adding maprate-based map weighting and sorting to MCE's core as well.

Anyhow, I did get one crash dump on map change, dunno if it's relevant: https://crash.limetech.org/n52leil4o2oy

Silenci0 commented 5 years ago

This bug is more of a plugin design flaw than a bug and it is something that can't be easily fixed. It seems, after looking into this as well as reading up on several posts, that the main culprit is the Display options used in the UMC mapcycle file to change the name of the map. Others that can help make this issue worse is too many maps/groups in the mapcycle file. In order to avoid or lessen the impact, it is advised to do the following:

In general, it is better to keep things simple since the more large and complex the UMC mapcycle becomes, the more likely that the plugin will become unstable due to having to parse through various options and features all at once. Reducing complexity will generally help out more than reducing the number of maps as some users reported having very large map selections without having issues. Closing issue.