alliedmodders / sourcemod

SourceMod - Source Engine Scripting and Administration
http://www.sourcemod.net/
985 stars 423 forks source link

SM crashes after automatic gamedata update if ForceRestartAfterUpdate is used #1211

Closed kgns closed 2 years ago

kgns commented 4 years ago

Help us help you

Environment

Description

When "ForceRestartAfterUpdate" in configs/core.cfg is used as "yes", after an automatic gamedata update, SourceMod unloads itself using meta unload 1 (usually 1, but whatever the id of SourceMod is at that time), and then forces a map change to reload everything by sending a changelevel <current_map> server command. While trying to change the map, server crashes every time.

Problematic Code (or Steps to Reproduce)

1. Remove every MetaMod plugin to be sure the crash is not coming from any other MetaMod plugin (if you have any)
2. Remove every SourceMod extension to be sure the crash is not coming from a SourceMod extension (renaming extensions folder is the easiest)
3. Restart the server
4. meta unload 1
5. changelevel <map> (whichever map you have on at that point)
6. It should crash

Logs

I've sent my dump to @asherkin he gave me the following log to be sent here:



Thread 0 (crashed):
  0: sourcemod.logic.so!Logger::_UpdateFiles [ Logger.cpp:309 + 0x5 ]
     https://github.com/alliedmodders/sourcemod/blob/ecad8f25a838f4ec0c2f9cfe956d18008470db3d/core/logic/Logger.cpp#L309
     eip: 0xec1f6cb4  esp: 0xffc5bbc0  ebp: 0xffc5cbf8  ebx: 0x00000011
     esi: 0xec2169c0  edi: 0xec2169c0  eax: 0x00000000  ecx: 0x00000011
     edx: 0x0b1fead8  efl: 0x00010286

     Found via instruction pointer in context

  1: sourcemod.logic.so!Logger::OnSourceModLevelChange [ Logger.cpp:245 + 0x10 ]
     https://github.com/alliedmodders/sourcemod/blob/ecad8f25a838f4ec0c2f9cfe956d18008470db3d/core/logic/Logger.cpp#L245
     eip: 0xec1f6241  esp: 0xffc5cc00  ebp: 0xffc5cc18

     Found via previous frame's frame pointer

  2: sourcemod.2.csgo.so!SourceModBase::LevelInit [ sourcemod.cpp:350 + 0xc ]
     https://github.com/alliedmodders/sourcemod/blob/ecad8f25a838f4ec0c2f9cfe956d18008470db3d/core/sourcemod.cpp#L350
     eip: 0xec281ccc  esp: 0xffc5cc20  ebp: 0xffc5cc48

     Found via previous frame's frame pointer

  3: sourcemod.2.csgo.so!__SourceHook_FHCls_IServerGameDLLLevelInitfalse::CMyDelegateImpl::Call [ FastDelegate.h:1419 + 0x29 ]
     https://github.com/alliedmodders/metamod-source/blob/e2c0348fc3f8c0787429b399de083226800f8c61/core/sourcehook/FastDelegate.h#L1419
     eip: 0xec283ab4  esp: 0xffc5cc50  ebp: 0xffc5cc78

     Found via previous frame's frame pointer

  4: metamod.2.csgo.so!__SourceHook_MFHCls_SGD_LevelInit::Func [ metamod.cpp:83 + 0x4b ]
     https://github.com/alliedmodders/metamod-source/blob/de330743d82984bc36020b7808e7838d9b594dec/core/metamod.cpp#L83
     eip: 0xed624ff8  esp: 0xffc5cc80  ebp: 0x00000000

     Found via previous frame's frame pointer```
peace-maker commented 3 years ago

This might be fixed by #1377. Is this still an issue?

peace-maker commented 2 years ago

I've tried to reproduce with the steps above and don't get a crash. So that cleanup mentioned above seems to sorted this issue.