splewis / csgo-pug-setup

CS:GO Sourcemod plugin for setting up private pug/10man games
GNU General Public License v3.0
411 stars 91 forks source link

Segfault on player join #368

Open Soren90 opened 3 years ago

Soren90 commented 3 years ago

Expected behavior

The server not to segfault on player join

Actual behavior

Log from server (then server restart):

csgo-ds | Executing dedicated server config file
csgo-ds | L 01/28/2021 - 18:52:38: server_cvar: "nextlevel" ""
csgo-ds | L 01/28/2021 - 18:52:38: server_cvar: "mp_autoteambalance" "0"
csgo-ds | L 01/28/2021 - 18:52:38: server_cvar: "mp_freezetime" "1"
csgo-ds | L 01/28/2021 - 18:52:38: server_cvar: "mp_maxrounds" "30"
csgo-ds | L 01/28/2021 - 18:52:38: server_cvar: "mp_roundtime" "1.75"
csgo-ds | L 01/28/2021 - 18:52:38: server_cvar: "mp_roundtime_defuse" "1.75"
csgo-ds | L 01/28/2021 - 18:52:38: server_cvar: "mp_roundtime_hostage" "1.75"
csgo-ds | L 01/28/2021 - 18:52:38: server_cvar: "mp_timelimit" "0"
csgo-ds | L 01/28/2021 - 18:52:38: server_cvar: "sv_alltalk" "1"
csgo-ds | L 01/28/2021 - 18:52:38: server_cvar: "sv_competitive_official_5v5" "1"
csgo-ds | L 01/28/2021 - 18:52:38: Starting Freeze period
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init prop_physics_multiplayer
csgo-ds | Can't init func_clip_vphysics
csgo-ds | Can't init point_worldtext
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init func_occluder
csgo-ds | Can't init light
csgo-ds | Can't init light
csgo-ds | Can't init light
csgo-ds | Can't init func_occluder
csgo-ds | Can't init func_occluder
csgo-ds | Can't init func_occluder
csgo-ds | Can't init func_occluder
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init func_occluder
csgo-ds | Can't init func_occluder
csgo-ds | Can't init func_occluder
csgo-ds | Can't init func_occluder
csgo-ds | Can't init func_occluder
csgo-ds | Can't init func_occluder
csgo-ds | Can't init func_occluder
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init func_occluder
csgo-ds | Can't init func_occluder
csgo-ds | Can't init light
csgo-ds | Can't init light_spot
csgo-ds | Can't init light_spot
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init light
csgo-ds | Can't init light
csgo-ds | Can't init light_spot
csgo-ds | Can't init func_occluder
csgo-ds | Can't init func_occluder
csgo-ds | Can't init func_occluder
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init func_occluder
csgo-ds | Can't init func_occluder
csgo-ds | Can't init light_spot
csgo-ds | Can't init light
csgo-ds | Can't init light
csgo-ds | Can't init light_spot
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init func_areaportal
csgo-ds | Can't init light
csgo-ds | Can't init light
csgo-ds | Can't init logic_auto
csgo-ds | Can't init postprocess_controller
csgo-ds | Can't init light_environment
csgo-ds | Can't init color_correction
csgo-ds | Can't init light_spot
csgo-ds | Can't init game_player_equip
csgo-ds | Can't init filter_activator_team
csgo-ds | Can't init filter_activator_team
csgo-ds | Can't init point_clientcommand
csgo-ds | Can't init trigger_multiple
csgo-ds | Can't init trigger_multiple
csgo-ds | Can't init logic_script
csgo-ds | Can't init trigger_multiple
csgo-ds | Can't init trigger_multiple
csgo-ds | Can't init logic_script
csgo-ds | Can't init trigger_multiple
csgo-ds | Can't init trigger_multiple
csgo-ds | Can't init logic_script
csgo-ds | Can't init trigger_multiple
csgo-ds | Can't init trigger_multiple
csgo-ds | Can't init logic_script
csgo-ds | Can't init trigger_multiple
csgo-ds | Can't init trigger_multiple
csgo-ds | Can't init logic_script
csgo-ds | Can't init trigger_multiple
csgo-ds | Can't init trigger_multiple
csgo-ds | L 01/28/2021 - 18:52:38: World triggered "Match_Start" on "de_dust2"
csgo-ds | /home/steam/csgo/srcds_run: line 318:   104 Segmentation fault      (core dumped) $HL_CMD
csgo-ds | Add "-debug" to the /home/steam/csgo/srcds_run command line to generate a debug.log to help with solving this problem
csgo-ds | Thu Jan 28 18:52:38 UTC 2021: Server restart in 10 seconds

When running in -debug mode, the debug.log is empty

Steps to reproduce

Setting sm_pugsetup_autosetup 0 and everything works fine. When the server is up I can also login to the server set sm_pugsetup_autosetup to 1 with rcon without any issues.

Am i missing some kind of dependency in the container?

Soren90 commented 3 years ago

I also just tested moving all the plugins except pugsetup.smx to the disabled folder. And the issue is still there.

r4f4w commented 3 years ago

Same problem here!

What is funny is that i already have one server running this plugin, and when i grab the plugin that is totally functioning and throw into another fresh install of sourcemod, i get this anonnying error. (With same extensions, config cfg files, etc)

The working server is running SourceMod 1.10.0.6501, and the faulty one is running SourceMod 1.10.0.6502 (wich i don't think is gonna change a lot to give such an error)

This bug is probably some incompatibility with another plugin/extension, but i can't figure out wich one.

r4f4w commented 3 years ago

SourceMod 1.10.0.6501 is good but SourceMod 1.10.0.6502 is giving segmentation error.

r4f4w commented 3 years ago

It worked, then i close it, re-open and there it goes, the same error again. Can't figure out what is going on.

r4f4w commented 3 years ago

It seems like there is nothing to do with Sourcemod version

Soren90 commented 3 years ago

Im my experience it seems like it has something to do with the server waking up from hibernation. I don't have any server availabe to test on at the moment, but the error was kind of inconsistent and but I was able to replicate the issue when I was the first player to join.

I haven't accually tried turning off hibernation. That could be a possible workaround

Soren90 commented 3 years ago

Yes, finally i got it!!

I'm running this server on docker image, so what i did was change my cpu pinning and give more cpu limit to my server. After this, i closed and open it again just to make sure, and it's working for sure now!

Hmm are you sure this solved the issue? I don't have any CPU limit on my server.

r4f4w commented 3 years ago

Yes, finally i got it!! I'm running this server on docker image, so what i did was change my cpu pinning and give more cpu limit to my server. After this, i closed and open it again just to make sure, and it's working for sure now!

Hmm are you sure this solved the issue? I don't have any CPU limit on my server.

Yeah, i restarted 4 times, on the 5th time, the error goes again.

What makes me angry is that is not consistent, sometimes it works, and suddenly don't

Already deleted my comment

r4f4w commented 3 years ago

Im my experience it seems like it has something to do with the server waking up from hibernation. I don't have any server availabe to test on at the moment, but the error was kind of inconsistent and but I was able to replicate the issue when I was the first player to join.

I haven't accually tried turning off hibernation. That could be a possible workaround

So, this is actually working, but i won't confirm until i re-test like 30 times just to make sure 😂

Running more tests and i will give a report.

r4f4w commented 3 years ago

I'm having a little problem that my cfg is setting sv_hibernate_ms to 0, but when server start and i check, the value is default 20.

Don't know why my server.cfg is not changing that value.

Maybe because it has sm_cvar in front?

r4f4w commented 3 years ago

I'm having a little problem that my cfg is setting sv_hibernate_ms to 0, but when server start and i check, the value is default 20.

Don't know why my server.cfg is not changing that value.

Maybe because it has sm_cvar in front?

Yup, removing sm_cvar got it to work, and now it's not giving more segmentation fault.

I will let you know if does come back, but as for now, thanks for the tip @Soren90 !

mashsajid commented 3 years ago

@Soren90 Did you fixed it?

Soren90 commented 3 years ago

@Soren90 Did you fixed it?

Nope. Still same issue. It seems like only workaround that works is turning off hibernation. Haven't tried it myself tho.

r4f4w commented 3 years ago

@Soren90 Did you fixed it?

Nope. Still same issue. It seems like only workaround that works is turning off hibernation. Haven't tried it myself tho.

I can confirm that turning off hibernation does work and solves the problem.

mashsajid commented 3 years ago

I had the same problem. It will be fixed by changing sm_pugsetup_use_game_warmup 1 to 0 in pugsetup.cfg

rkantos commented 3 years ago

I seem to be getting this with Get5 plugin. It doesn't seem to have the same kind of configuration for the warmup. I think also turning of hibernation is a workaround for this issue - I don't remember seeing the same issue with someone being on the server when it is configured by the addon+plugin.

NaathySz commented 2 years ago

I know this thing is old, but still happen and maybe i can help someone in future; If you dont want turn this cvars talked above, you can do it:

try not leave server in LIVE, because it can cause this bug. Basically, if the match started and players leave in mid of match, when someone try join after (server hibernation + pug setup in live), it can cause this issue and crash. Maybe its not the only reason to this bug, but it can help anyway.

I know it cannot be our fault, so if you are in this trouble, just make this:

  1. Restart your server and NOT join yet!!
  2. Write sm plugins unload pugsetup in your server panel.
  3. After plugin unload, try join. Plugin will load again automatically after you join and prevens to crash.

For me it work, i hope i can help someone with this. And sorry my bad english :P

Soren90 commented 2 years ago

I know this thing is old, but still happen and maybe i can help someone in future; If you dont want turn this cvars talked above, you can do it:

try not leave server in LIVE, because it can cause this bug. Basically, if the match started and players leave in mid of match, when someone try join after (server hibernation + pug setup in live), it can cause this issue and crash. Maybe its not the only reason to this bug, but it can help anyway.

I know it cannot be our fault, so if you are in this trouble, just make this:

  1. Restart your server and NOT join yet!!
  2. Write sm plugins unload pugsetup in your server panel.
  3. After plugin unload, try join. Plugin will load again automatically after you join and prevens to crash.

For me it work, i hope i can help someone with this. And sorry my bad english :P

Thanks for reply! Have this worked long term? I the problem might show up again if all players leave the server and joins again after hibernation. But if you dont need that because you restart the server every time, then you should be fine.

Maybe a solution would be to set sm plugins unload pugsetup in server.cfg or somewhere else?

NaathySz commented 2 years ago

I know this thing is old, but still happen and maybe i can help someone in future; If you dont want turn this cvars talked above, you can do it: try not leave server in LIVE, because it can cause this bug. Basically, if the match started and players leave in mid of match, when someone try join after (server hibernation + pug setup in live), it can cause this issue and crash. Maybe its not the only reason to this bug, but it can help anyway. I know it cannot be our fault, so if you are in this trouble, just make this:

  1. Restart your server and NOT join yet!!
  2. Write sm plugins unload pugsetup in your server panel.
  3. After plugin unload, try join. Plugin will load again automatically after you join and prevens to crash.

For me it work, i hope i can help someone with this. And sorry my bad english :P

Thanks for reply! Have this worked long term? I the problem might show up again if all players leave the server and joins again after hibernation. But if you dont need that because you restart the server every time, then you should be fine.

Maybe a solution would be to set sm plugins unload pugsetup in server.cfg or somewhere else?

it will not solve, but i will talk to splewis about it, lets see if he fix. If not, i can try do it myself

splewis commented 2 years ago

I don't have any magic knowledge on why the server crashes here, or how to fix it. It's exceptionally hard to debug server crashes since valve removed debug symbols from the server binary; there's not much I can do to help. "Fixing" such a bug is likely just trying random ideas and trial+error until things "work". If someone actually uploads crash dumps from accelerator that might give some hints as to where the crash happens.

In general, hibernation can be somewhat buggy when it comes to plugin interactions, so I would recommend it be turned off.

NaathySz commented 2 years ago
Here is a fix. It will stop match if its live and only 1 player last in server. He will not play alone in LIVE match, most just disconnect too. So, it will back to warmup and auto setup again. You can enable and disable this by a convar. By default it is disabled ConVar: `sm_pugsetup_forceend_on_players_leave "0"` Better than crash, huh?