Start Line: ./hlds_linux -autorestart -game cstrike +maxplayers 32 +ip XXX +port 27015 -pingboost 2 +sys_ticrate 800 +exec server.cfg +map jail_oly_rehab -dev -debug -condebug -pidfile /data/server_268882/logs/268882.cs.pid
[New LWP 20586]
[New LWP 17574]
[New LWP 26209]
[New LWP 22129]
[New LWP 22117]
[New LWP 26210]
[New LWP 17707]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `./hlds_linux -autorestart -game cstrike +maxplayers 32 +ip XXX +port'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0xf3190dd9 in CHalfLifeMultiplay::DeathNotice (this=0xa70d408, pVictim=0xa8d61e0, pKiller=0xf35bdbb8, pevInflictor=0x0) at ../cstrike/dlls/multiplay_gamerules.cpp:3808
#0 0xf3190dd9 in CHalfLifeMultiplay::DeathNotice (this=0xa70d408, pVictim=0xa8d61e0, pKiller=0xf35bdbb8, pevInflictor=0x0) at ../cstrike/dlls/multiplay_gamerules.cpp:3808
#1 0xf319704c in CHalfLifeMultiplay::PlayerKilled (this=0xa70d408, pVictim=0xa8d61e0, pKiller=0xf35bdbb8, pInflictor=0x0) at ../cstrike/dlls/multiplay_gamerules.cpp:3629
#2 0xf31b9b6b in CBasePlayer::Killed (this=0xa8d61e0, pevAttacker=0xf35bdbb8, iGib=0) at ../cstrike/dlls/player.cpp:2402
#3 0xf29638d3 in Hook_Void_Entvar_Int(Hook*, void*, entvars_s*, int) () from cstrike/addons/amxmodx/modules/hamsandwich_amxx_i386.so
#4 0xff856a50 in ?? ()
killer_weapon_name = 0xf3282b10 "world"
killer_index = 0
gluon = 0xf3282b16 "gluon gun"
tau = 0xf3282b20 "tau_cannon"
iGotHeadshot = <optimized out>
From To Syms Read Shared Object Library
No linux-gate.so.1
0xf76eb914 0xf7731c78 Yes ./libstdc++.so.6
0xf7692ad0 0xf769396c Yes (*) /lib/i386-linux-gnu/i686/cmov/libdl.so.2
0xf7679870 0xf7685f87 Yes (*) /lib/i386-linux-gnu/i686/cmov/libpthread.so.0
0xf74df420 0xf760fc0e Yes (*) /lib/i386-linux-gnu/i686/cmov/libc.so.6
0xf7486600 0xf74b3ed5 Yes (*) /lib/i386-linux-gnu/i686/cmov/libm.so.6
0xf777d860 0xf77950fc Yes (*) /lib/ld-linux.so.2
0xf746ee04 0xf747e490 Yes ./libgcc_s.so.1
0xf6e1fc50 0xf6f74571 Yes (*) /home/data/server_268882/268882.cs16/engine_i486.so
0xf6d6c9b0 0xf6d6feaa Yes (*) /lib/i386-linux-gnu/i686/cmov/librt.so.1
0xf6d5a5c0 0xf6d64d74 Yes (*) ./libsteam_api.so
0xf6d40a00 0xf6d4d1b8 Yes /home/data/server_268882/268882.cs16/filesystem_stdio.so
0xf5e37e80 0xf691f040 Yes (*) ./steamclient.so
0xf5cb2670 0xf5d28020 Yes (*) ./crashhandler.so
0xf33afd00 0xf3454ebc Yes (*) /home/data/server_268882/268882.cs16/./cstrike/addons/metamod/dlls/metamod.so
0xf3151350 0xf3275340 Yes /home/data/server_268882/268882.cs16/cstrike/dlls/cs.so
0xf300ab40 0xf30648a4 Yes (*) /home/data/server_268882/268882.cs16/cstrike/addons/amxmodx/dlls/amxmodx_mm_i386.so
0xf2601c40 0xf2690300 Yes (*) cstrike/addons/amxmodx/modules/mysql_amxx_i386.so
0xf29dae30 0xf2a08168 Yes (*) cstrike/addons/amxmodx/modules/fakemeta_amxx_i386.so
0xf29bb2b0 0xf29bf5f8 Yes (*) cstrike/addons/amxmodx/modules/fun_amxx_i386.so
0xf295db90 0xf2999588 Yes (*) cstrike/addons/amxmodx/modules/hamsandwich_amxx_i386.so
0xf25a0640 0xf25acea8 Yes (*) cstrike/addons/amxmodx/modules/engine_amxx_i386.so
0xf10e6ad0 0xf10ed8ab Yes (*) /lib/i386-linux-gnu/i686/cmov/libnss_files.so.2
0xf1204c40 0xf1207bce Yes (*) /lib/i386-linux-gnu/i686/cmov/libnss_dns.so.2
0xf10d0720 0xf10dcce4 Yes (*) /lib/i386-linux-gnu/i686/cmov/libresolv.so.2
0xf2c91ed0 0xf2c92f78 Yes (*) cstrike/addons/amxmodx/modules/sockets_amxx_i386.so
(*): Shared library is missing debugging information.
Stack level 0, frame at 0xff855950:
eip = 0xf3190dd9 in CHalfLifeMultiplay::DeathNotice (../cstrike/dlls/multiplay_gamerules.cpp:3808); saved eip = 0xf319704c
called by frame at 0xff8559b0
source language c++.
Arglist at 0xff8558ec, args: this=0xa70d408, pVictim=0xa8d61e0, pKiller=0xf35bdbb8, pevInflictor=0x0
Locals at 0xff8558ec, Previous frame's sp is 0xff855950
Saved registers:
ebx at 0xff85593c, ebp at 0xff855948, esi at 0xff855940, edi at 0xff855944, eip at 0xff85594c
End of crash report
Metalist:
Code:
[ 1] AMX Mod X RUN - amxmodx_mm_i386. v1.8.3-d ini Start ANY
[ 2] MySQL RUN - mysql_amxx_i386. v1.8.3-d pl1 ANY ANY
[ 3] FakeMeta RUN - fakemeta_amxx_i3 v1.8.3-d pl1 ANY ANY
[ 4] Fun RUN - fun_amxx_i386.so v1.8.3-d pl1 ANY ANY
[ 5] Ham Sandwich RUN - hamsandwich_amxx v1.8.3-d pl1 ANY ANY
[ 6] Engine RUN - engine_amxx_i386 v1.8.3-d pl1 ANY ANY
You are not supposed to call Killed() without defining an inflictor.
Usually, inflictor is defined from TakeDamage() and will be saved in g_pevLastInflictor global variable.
Next Killed calls PlayerKilled this way: g_pGameRules->PlayerKilled(this, pevAttacker, g_pevLastInflictor);
Then DeathNotice is called with a null inflictor.
Looking at your debug, you're passing 0 for killer, which means the "world".
You get a crash on the last line of the above code, because the killer is not a player, and it tries to get inflictor classname from a null pointer. You could argue there is missing check, but internally you are supposed to set g_pevLastInflictor.
You should probably call TakeDamage instead with some damage > player's current health.
To get a valid killer's edict as "world", ExecuteHamB has to receive "0" as value.
But with your check, it should not be possible. I've actually tested your small stock under window and Linux, did not get any crash.
Looking at your crash, you're hooking Ham_Killed and crash happens from there. Are you sure you don't set killer to 0 there?
Since you can reproduce, what happens if you're using ExecuteHam without B?
To get a valid killer's edict as "world", ExecuteHamB has to receive "0" as value.
But with your check, it should not be possible. I've actually tested your small stock under window and Linux, did not get any crash.
Looking at your crash, you're hooking Ham_Killed and crash happens from there. Are you sure you don't set killer to 0 there?
Since you can reproduce, what happens if you're using ExecuteHam without B?
I can confirm that.
PHP Code:
#0 0xf3190dd9 in CHalfLifeMultiplay::DeathNotice (this=0xa70d408, pVictim=0xa8d61e0, pKiller=0xf35bdbb8, pevInflictor=0x0) at ../cstrike/dlls/multiplay_gamerules.cpp:3808 #0 0xf3190dd9 in CHalfLifeMultiplay::DeathNotice (this=0xa70d408, pVictim=0xa8d61e0, pKiller=0xf35bdbb8, pevInflictor=0x0) at ../cstrike/dlls/multiplay_gamerules.cpp:3808 #1 0xf319704c in CHalfLifeMultiplay::PlayerKilled (this=0xa70d408, pVictim=0xa8d61e0, pKiller=0xf35bdbb8, pInflictor=0x0) at ../cstrike/dlls/multiplay_gamerules.cpp:3629 #2 0xf31b9b6b in CBasePlayer::Killed (this=0xa8d61e0, pevAttacker=0xf35bdbb8, iGib=0) at ../cstrike/dlls/player.cpp:2402 #3 0xf29638d3 in Hook_Void_Entvar_Int(Hook*, void*, entvars_s*, int) () from cstrike/addons/amxmodx/modules/hamsandwich_amxx_i386.so #4 0xff856a50 in ?? ()
Hook_Void_Entvar_Int it's from Hamsandwich. The trick here is your ham function execution is getting hooked by a Hamsandwich forward, dealing with the crash
Problem solved, was guilty ReHLDS v1.28 (670) from Wed Feb 10 18:41:54 CET 2016
I downgraded rehlds to v1.28 (669) from Wed Feb 10 06:05:51 CET 2016 and everything works correctly