theAsmodai / metamod-r

Metamod is a plugin/DLL manager that sits between the Half-Life Engine and an HL Game mod, allowing the dynamic loading/unloading of mod-like DLL plugins to add functionality to the HL server or game mod. Metamod-r is improved version of metamod.
GNU General Public License v3.0
153 stars 38 forks source link

Crash on meta unload #47

Closed jeefo closed 3 years ago

jeefo commented 5 years ago

Metamod-r randomly crashes on meta unload modules that have some commands added with pfnAddServerCommand.

Metamod-r built from source with debug, to get correct backtrace.

Currently loaded plugins: description stat pend file vers src load unload [ 1] Reunion RUN - reunion_mm_i386.so v0.1.0.92 ini Start Never [ 2] AMX Mod X RUN - amxmodx_mm_i386.so v1.10.0.5254 ini Start ANY
[ 4] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.10.0.5254 pl2 ANY ANY
[ 5] CSX RUN - csx_amxx_i386.so v1.10.0.5254 pl2 ANY ANY
4 plugins, 4 running version Protocol version 48 Exe version 1.1.2.7/Stdio (cstrike) ReHLDS version: 3.6.0.671-dev Build date: 12:52:00 May 7 2019 (1851) Build from: https://github.com/dreamstalker/rehlds/commit/3f809d0 game version ReGameDLL version: 5.7.0.330-dev Build date: 12:56:40 Apr 23 2019 Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/94f0fdb meta unload amx L 08/14/2019 - 15:50:27: [META] WARNING: dll: Couldn't close plugin file 'hamsandwich_amxx_i386.so': invalid handle L 08/14/2019 - 15:50:27: [META] dll: Unloaded plugin 'Ham Sandwich' for reason 'null (request from plugin[0])' L 08/14/2019 - 15:50:27: [META] dll: Rebuilding callbacks... L 08/14/2019 - 15:50:27: [META] dll: Callbacks rebuilded. L 08/14/2019 - 15:50:27: [META] dll: Rebuilding callbacks... L 08/14/2019 - 15:50:27: [META] dll: Callbacks rebuilded. L 08/14/2019 - 15:50:27: [META] WARNING: dll: Couldn't close plugin file 'csx_amxx_i386.so': invalid handle L 08/14/2019 - 15:50:27: [META] dll: Unloaded plugin 'CSX' for reason 'null (request from plugin[0])' L 08/14/2019 - 15:50:27: [META] dll: Rebuilding callbacks... L 08/14/2019 - 15:50:27: [META] dll: Callbacks rebuilded. L 08/14/2019 - 15:50:27: [META] dll: Rebuilding callbacks... L 08/14/2019 - 15:50:27: [META] dll: Callbacks rebuilded.

Thread 1 "hlds_linux" received signal SIGSEGV, Segmentation fault. 0xf334b85b in MRegCmdList::remove(int) () from /opt/steam/hlds_l/./cstrike/addons/metamod/metamod_i386.so (gdb) bt

0 0xf334b85b in MRegCmdList::remove(int) () from /opt/steam/hlds_l/./cstrike/addons/metamod/metamod_i386.so

1 0xf335deed in MPlugin::unload(PLUG_LOADTIME, PL_UNLOAD_REASON, bool&) () from /opt/steam/hlds_l/./cstrike/addons/metamod/metamod_i386.so

2 0xf335099b in cmd_doplug(PLUG_CMD) () from /opt/steam/hlds_l/./cstrike/addons/metamod/metamod_i386.so

3 0xf3351009 in _INTERNAL::g_meta_cmds::{lambda()#3}::_FUN() () from /opt/steam/hlds_l/./cstrike/addons/metamod/metamod_i386.so

4 0xf334f246 in server_meta() () from /opt/steam/hlds_l/./cstrike/addons/metamod/metamod_i386.so

5 0xf3386138 in ?? ()

6 0xf7539345 in Cmd_ExecuteString_internal(char const, cmd_source_s, IGameClient) () from /opt/steam/hlds_l/engine_i486.so

7 0xf753a43e in Cbuf_Execute() () from /opt/steam/hlds_l/engine_i486.so

8 0xf3386110 in ?? ()

Backtrace stopped: previous frame inner to this frame (corrupt stack?) (gdb)

0 0xf334b85b in MRegCmdList::remove(int) () from /opt/steam/hlds_l/./cstrike/addons/metamod/metamod_i386.so

1 0xf335deed in MPlugin::unload(PLUG_LOADTIME, PL_UNLOAD_REASON, bool&) () from /opt/steam/hlds_l/./cstrike/addons/metamod/metamod_i386.so

2 0xf335099b in cmd_doplug(PLUG_CMD) () from /opt/steam/hlds_l/./cstrike/addons/metamod/metamod_i386.so

3 0xf3351009 in _INTERNAL::g_meta_cmds::{lambda()#3}::_FUN() () from /opt/steam/hlds_l/./cstrike/addons/metamod/metamod_i386.so

4 0xf334f246 in server_meta() () from /opt/steam/hlds_l/./cstrike/addons/metamod/metamod_i386.so

5 0xf3386138 in ?? ()

6 0xf7539345 in Cmd_ExecuteString_internal(char const, cmd_source_s, IGameClient) () from /opt/steam/hlds_l/engine_i486.so

7 0xf753a43e in Cbuf_Execute() () from /opt/steam/hlds_l/engine_i486.so

8 0xf3386110 in ?? ()

Backtrace stopped: previous frame inner to this frame (corrupt stack?)