AnAkkk / TFTrue

http://tftrue.esport-tools.net/
GNU General Public License v2.0
37 stars 12 forks source link

TF2 server update combined with TFTrue causes segfault shortly after launch #45

Closed Arie closed 3 years ago

Arie commented 3 years ago
[Sep17 08:50] srcds_linux[30965]: segfault at f7f5cd79 ip 00000000f6550ac1 sp 00000000ffc11190 error 7 in engine_srv.so[f648e000+226000]
[  +0.000156] Code: 31 c0 5b 5e 5f 5d c3 66 90 55 b8 03 00 00 00 89 e5 5d c3 8d b6 00 00 00 00 55 89 e5 57 56 53 31 db 83 ec 1c 8b 45 10 8b 75 08 <c7> 00 00 00 00 00 8b 45 0c c7 00 00 00 00 00 8b be 64 01 00 00 85
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0xf6550ac1 in CBaseServer::GetNetStats(float&, float&) () from /home/tf2server/tf2-1/bin/engine_srv.so
[Current thread is 1 (Thread 0xf7f88a80 (LWP 30965))]
#0  0xf6550ac1 in CBaseServer::GetNetStats(float&, float&) () from /home/tf2server/tf2-1/bin/engine_srv.so
#1  0xeb2c88ee in ?? () from /home/tf2server/tf2-1/tf/addons/TFTrue.so
#2  0xf6622e45 in CServerPlugin::GameFrame(bool) () from /home/tf2server/tf2-1/bin/engine_srv.so
#3  0xf661d3af in SV_Think(bool) () from /home/tf2server/tf2-1/bin/engine_srv.so
#4  0xf661e448 in SV_Frame(bool) () from /home/tf2server/tf2-1/bin/engine_srv.so
#5  0xf65a5928 in _Host_RunFrame_Server(bool) () from /home/tf2server/tf2-1/bin/engine_srv.so
#6  0xf65a6df7 in _Host_RunFrame(float) () from /home/tf2server/tf2-1/bin/engine_srv.so
#7  0xf65b1087 in CHostState::State_Run(float) () from /home/tf2server/tf2-1/bin/engine_srv.so
#8  0xf65b13e6 in CHostState::FrameUpdate(float) () from /home/tf2server/tf2-1/bin/engine_srv.so
#9  0xf65b142d in HostState_Frame(float) () from /home/tf2server/tf2-1/bin/engine_srv.so
#10 0xf6632c23 in CEngine::Frame() () from /home/tf2server/tf2-1/bin/engine_srv.so
#11 0xf6630026 in CDedicatedServerAPI::RunFrame() () from /home/tf2server/tf2-1/bin/engine_srv.so
#12 0xf73d87c9 in RunServer() () from bin/dedicated_srv.so
#13 0xf663011d in CModAppSystemGroup::Main() () from /home/tf2server/tf2-1/bin/engine_srv.so
#14 0xf667a6b8 in CAppSystemGroup::Run() () from /home/tf2server/tf2-1/bin/engine_srv.so
#15 0xf6630e0d in CDedicatedServerAPI::ModInit(ModInfo_t&) () from /home/tf2server/tf2-1/bin/engine_srv.so
#16 0xf73d8493 in CDedicatedAppSystemGroup::Main() () from bin/dedicated_srv.so
#17 0xf74bb568 in CAppSystemGroup::Run() () from bin/dedicated_srv.so
#18 0xf74bb568 in CAppSystemGroup::Run() () from bin/dedicated_srv.so
#19 0xf7392938 in main () from bin/dedicated_srv.so
#20 0x080489cb in main ()
No symbol table info available.
eax            0xf7f5cd79          -134886023
ecx            0xf66c91a8          -160656984
edx            0xf66c8588          -160660088
ebx            0x0                 0
esp            0xffc11190          0xffc11190
ebp            0xffc111b8          0xffc111b8
esi            0xf67a44c0          -159759168
edi            0xf67cf000          -159584256
eip            0xf6550ac1          0xf6550ac1 <CBaseServer::GetNetStats(float&, float&)+17>
eflags         0x210286            [ PF SF IF RF ID ]
cs             0x23                35
ss             0x2b                43
ds             0x2b                43
es             0x2b                43
fs             0x0                 0
gs             0x63                99
From        To          Syms Read   Shared Object Library
0xf7f74130  0xf7f751c4  Yes (*)     /lib/i386-linux-gnu/libdl.so.2
0xf7f575e0  0xf7f66eff  Yes (*)     /lib/i386-linux-gnu/libpthread.so.0
0xf7d8d0e0  0xf7ed9d76  Yes (*)     /lib/i386-linux-gnu/libc.so.6
0xf7f8e090  0xf7fa950b  Yes (*)     /lib/ld-linux.so.2
0xf7d4cde0  0xf7d630b8  Yes (*)     bin/libtier0_srv.so
0xf7d393d0  0xf7d3ccb4  Yes (*)     /lib/i386-linux-gnu/librt.so.1
0xf7c264e0  0xf7cdc965  Yes (*)     /lib/i386-linux-gnu/libstdc++.so.6
0xf7abc170  0xf7b7d4af  Yes (*)     /lib/i386-linux-gnu/libm.so.6
0xf7a962d0  0xf7aab9c5  Yes (*)     /lib/i386-linux-gnu/libgcc_s.so.1
0xf79962e0  0xf79c9408  Yes (*)     bin/libvstdlib_srv.so
0xf7391a90  0xf74dd554  Yes (*)     bin/dedicated_srv.so
0xf72fd950  0xf732a2b4  Yes (*)     bin/libsteam_api.so
0xf71c96a0  0xf71d5a04  Yes (*)     /lib/i386-linux-gnu/libtinfo.so.5
0xf64ed880  0xf66a57e8  Yes (*)     /home/tf2server/tf2-1/bin/engine_srv.so
0xf60263c0  0xf6355b14  Yes (*)     bin/libsteamnetworkingsockets.so
0xf69845b0  0xf69ad124  Yes (*)     /home/tf2server/tf2-1/bin/soundemittersystem_srv.so
0xf5a75800  0xf5b519d4  Yes (*)     /home/tf2server/tf2-1/bin/materialsystem_srv.so
0xf34b0a00  0xf3561424  Yes (*)     /home/tf2server/tf2-1/bin/studiorender_srv.so
0xf316f180  0xf3290314  Yes (*)     /home/tf2server/tf2-1/bin/vphysics_srv.so
0xf342bdd0  0xf34791d4  Yes (*)     /home/tf2server/tf2-1/bin/datacache_srv.so
0xf691b420  0xf69334c4  Yes (*)     /home/tf2server/tf2-1/bin/shaderapiempty_srv.so
0xf04eb970  0xf11fe1c4  Yes (*)     /home/tf2server/tf2-1/tf/bin/server_srv.so
0xf007b5d0  0xf00961b4  Yes (*)     /home/tf2server/tf2-1/bin/scenefilecache_srv.so
0xec342df0  0xec3a9624  Yes (*)     /home/tf2server/tf2-1/bin/replay_srv.so
0xec298760  0xec2fa014  Yes (*)     /lib/i386-linux-gnu/libcurl-gnutls.so.4
0xec2692b0  0xec27cc44  Yes (*)     /lib/i386-linux-gnu/libnghttp2.so.14
0xf3a08300  0xf3a0c194  Yes (*)     /lib/i386-linux-gnu/libidn2.so.0
0xec2489c0  0xec257ae4  Yes (*)     /lib/i386-linux-gnu/librtmp.so.1
0xec213660  0xec230e34  Yes (*)     /lib/i386-linux-gnu/libssh2.so.1
0xf6905260  0xf6906ed4  Yes (*)     /lib/i386-linux-gnu/libpsl.so.5
0xec1d8960  0xec1fa174  Yes (*)     /lib/i386-linux-gnu/libnettle.so.6
0xec014540  0xec1196d4  Yes (*)     /lib/i386-linux-gnu/libgnutls.so.30
0xebfa53c0  0xebfd7164  Yes (*)     /lib/i386-linux-gnu/libgssapi_krb5.so.2
0xebece940  0xebf32024  Yes (*)     /lib/i386-linux-gnu/libkrb5.so.3
0xebe855c0  0xebea3d14  Yes (*)     /lib/i386-linux-gnu/libk5crypto.so.3
0xf3a032a0  0xf3a03f94  Yes (*)     /lib/i386-linux-gnu/libcom_err.so.2
0xebe32f00  0xebe63f34  Yes (*)     /lib/i386-linux-gnu/libldap_r-2.4.so.2
0xf340b670  0xf34120c4  Yes (*)     /lib/i386-linux-gnu/liblber-2.4.so.2
0xebe09aa0  0xebe1c9a9  Yes (*)     /lib/i386-linux-gnu/libz.so.1
0xebc8f0e0  0xebcc7394  Yes (*)     /lib/i386-linux-gnu/libunistring.so.2
0xebc4fe40  0xebc5e8b4  Yes (*)     /lib/i386-linux-gnu/libhogweed.so.4
0xebbc6340  0xebc28c44  Yes (*)     /lib/i386-linux-gnu/libgmp.so.10
0xebadd550  0xebb64654  Yes (*)     /lib/i386-linux-gnu/libgcrypt.so.20
0xeb997850  0xeba3b424  Yes (*)     /lib/i386-linux-gnu/libp11-kit.so.0
0xeb973970  0xeb97f2f4  Yes (*)     /lib/i386-linux-gnu/libtasn1.so.6
0xeb965640  0xeb96bce4  Yes (*)     /lib/i386-linux-gnu/libkrb5support.so.0
0xf3403210  0xf3404434  Yes (*)     /lib/i386-linux-gnu/libkeyutils.so.1
0xeb94b3a0  0xeb957014  Yes (*)     /lib/i386-linux-gnu/libresolv.so.2
0xeb92b5b0  0xeb93c6d4  Yes (*)     /lib/i386-linux-gnu/libsasl2.so.2
0xeb907680  0xeb919a64  Yes (*)     /lib/i386-linux-gnu/libgpg-error.so.0
0xeb8fb260  0xeb8ff724  Yes (*)     /lib/i386-linux-gnu/libffi.so.6
0xeb2bef30  0xeb3b7424  Yes (*)     /home/tf2server/tf2-1/tf/addons/TFTrue.so
0xeb5adca0  0xeb5b0384  Yes (*)     /home/tf2server/tf2-1/tf/addons/metamod/bin/server.so
0xeb56b140  0xeb59f522  Yes (*)     /home/tf2server/tf2-1/tf/addons/metamod/bin/metamod.2.tf2.so
0xeb27c830  0xeb2a2c03  Yes (*)     /home/tf2server/tf2-1/tf/addons/srctvplus.so
0xe9143000  0xea6618a4  Yes (*)     bin/steamclient.so
0xe8f50d30  0xe8fe0a94  Yes (*)     bin/crashhandler.so
0xf7f84950  0xf7f84ea9  Yes (*)     /home/tf2server/tf2-1/tf/addons/sourcemod/bin/sourcemod_mm_i486.so
0xe8eaf640  0xe8f1c862  Yes (*)     /home/tf2server/tf2-1/tf/addons/sourcemod/bin/sourcemod.2.tf2.so
0xe8e18950  0xe8e70e50  Yes (*)     /home/tf2server/tf2-1/tf/addons/sourcemod/bin/sourcemod.logic.so
0xe8bf02e0  0xe8c1a14c  Yes (*)     /home/tf2server/tf2-1/tf/addons/sourcemod/bin/sourcepawn.jit.x86.so
0xf7f7f4a0  0xf7f823a4  Yes (*)     /home/tf2server/tf2-1/tf/addons/sourcemod/extensions/updater.ext.so
0xe8ab9a50  0xe8ae2655  Yes (*)     /home/tf2server/tf2-1/tf/addons/sourcemod/extensions/webternet.ext.so
0xeb53b300  0xeb541cd4  Yes (*)     /lib/i386-linux-gnu/libnss_files.so.2
0xeb5321c0  0xeb5351f4  Yes (*)     /lib/i386-linux-gnu/libnss_dns.so.2
0xe56aa4b0  0xe5748e21  Yes (*)     /home/tf2server/tf2-1/tf/addons/sourcemod/extensions/accelerator.ext.so
0xe70decf0  0xe70ec9b8  Yes (*)     /home/tf2server/tf2-1/tf/addons/sourcemod/extensions/game.tf2.ext.2.tf2.so
0xf7f79ac0  0xf7f7c0e4  Yes (*)     /home/tf2server/tf2-1/tf/addons/sourcemod/extensions/bintools.ext.so
0xe4c3eae0  0xe4c68122  Yes (*)     /home/tf2server/tf2-1/tf/addons/sourcemod/extensions/sdkhooks.ext.2.tf2.so
0xe706ee80  0xe70aa792  Yes (*)     /home/tf2server/tf2-1/tf/addons/sourcemod/extensions/sdktools.ext.2.tf2.so
0xeb553700  0xeb559ec8  Yes (*)     /home/tf2server/tf2-1/tf/addons/sourcemod/extensions/topmenus.ext.so
0xe70196e0  0xe704bee0  Yes (*)     /home/tf2server/tf2-1/tf/addons/sourcemod/extensions/regex.ext.so
0xe6d1aba0  0xe6d44e5c  Yes         /home/tf2server/tf2-1/tf/addons/sourcemod/extensions/dhooks.ext.so
0xe7a07ae0  0xe7a0c7e4  Yes (*)     /home/tf2server/tf2-1/tf/addons/sourcemod/extensions/clientprefs.ext.so
0xe4b0c9d0  0xe4c1d010  Yes (*)     /home/tf2server/tf2-1/tf/addons/sourcemod/extensions/dbi.sqlite.ext.so
0xe4959ac0  0xe4a99c80  Yes         /home/tf2server/tf2-1/tf/addons/sourcemod/extensions/curl.ext.so
(*): Shared library is missing debugging information.
Dump of assembler code for function _ZN11CBaseServer11GetNetStatsERfS0_:
   0xf6550ab0 <+0>: push   %ebp
   0xf6550ab1 <+1>: mov    %esp,%ebp
   0xf6550ab3 <+3>: push   %edi
   0xf6550ab4 <+4>: push   %esi
   0xf6550ab5 <+5>: push   %ebx
   0xf6550ab6 <+6>: xor    %ebx,%ebx
   0xf6550ab8 <+8>: sub    $0x1c,%esp
   0xf6550abb <+11>:    mov    0x10(%ebp),%eax
   0xf6550abe <+14>:    mov    0x8(%ebp),%esi
=> 0xf6550ac1 <+17>:    movl   $0x0,(%eax)
   0xf6550ac7 <+23>:    mov    0xc(%ebp),%eax
   0xf6550aca <+26>:    movl   $0x0,(%eax)
   0xf6550ad0 <+32>:    mov    0x164(%esi),%edi
   0xf6550ad6 <+38>:    test   %edi,%edi
   0xf6550ad8 <+40>:    jg     0xf6550aef <_ZN11CBaseServer11GetNetStatsERfS0_+63>
   0xf6550ada <+42>:    jmp    0xf6550b70 <_ZN11CBaseServer11GetNetStatsERfS0_+192>
   0xf6550adf <+47>:    nop
   0xf6550ae0 <+48>:    add    $0x1,%ebx
   0xf6550ae3 <+51>:    cmp    %ebx,0x164(%esi)
   0xf6550ae9 <+57>:    jle    0xf6550b70 <_ZN11CBaseServer11GetNetStatsERfS0_+192>
   0xf6550aef <+63>:    mov    0x158(%esi),%eax
   0xf6550af5 <+69>:    mov    (%eax,%ebx,4),%edi
   0xf6550af8 <+72>:    mov    (%edi),%eax
   0xf6550afa <+74>:    mov    %edi,(%esp)
   0xf6550afd <+77>:    call   *0x70(%eax)
   0xf6550b00 <+80>:    test   %al,%al
   0xf6550b02 <+82>:    jne    0xf6550ae0 <_ZN11CBaseServer11GetNetStatsERfS0_+48>
   0xf6550b04 <+84>:    mov    (%edi),%eax
   0xf6550b06 <+86>:    mov    %edi,(%esp)
   0xf6550b09 <+89>:    call   *0x64(%eax)
   0xf6550b0c <+92>:    test   %al,%al
   0xf6550b0e <+94>:    je     0xf6550ae0 <_ZN11CBaseServer11GetNetStatsERfS0_+48>
   0xf6550b10 <+96>:    mov    (%edi),%eax
   0xf6550b12 <+98>:    mov    %edi,(%esp)
   0xf6550b15 <+101>:   add    $0x1,%ebx
   0xf6550b18 <+104>:   call   *0x1c(%eax)
   0xf6550b1b <+107>:   mov    (%eax),%edx
   0xf6550b1d <+109>:   mov    %eax,-0x20(%ebp)
   0xf6550b20 <+112>:   mov    %eax,(%esp)
   0xf6550b23 <+115>:   movl   $0x1,0x4(%esp)
   0xf6550b2b <+123>:   call   *0x34(%edx)
   0xf6550b2e <+126>:   mov    0xc(%ebp),%eax
   0xf6550b31 <+129>:   fstps  -0x1c(%ebp)
   0xf6550b34 <+132>:   movss  -0x1c(%ebp),%xmm0
   0xf6550b39 <+137>:   addss  (%eax),%xmm0
   0xf6550b3d <+141>:   movss  %xmm0,(%eax)
   0xf6550b41 <+145>:   mov    -0x20(%ebp),%eax
   0xf6550b44 <+148>:   mov    (%eax),%edx
   0xf6550b46 <+150>:   mov    %eax,(%esp)
   0xf6550b49 <+153>:   movl   $0x0,0x4(%esp)
   0xf6550b51 <+161>:   call   *0x34(%edx)
   0xf6550b54 <+164>:   mov    0x10(%ebp),%eax
   0xf6550b57 <+167>:   fstps  -0x1c(%ebp)
   0xf6550b5a <+170>:   movss  -0x1c(%ebp),%xmm0
   0xf6550b5f <+175>:   addss  (%eax),%xmm0
   0xf6550b63 <+179>:   movss  %xmm0,(%eax)
   0xf6550b67 <+183>:   cmp    %ebx,0x164(%esi)
   0xf6550b6d <+189>:   jg     0xf6550aef <_ZN11CBaseServer11GetNetStatsERfS0_+63>
   0xf6550b6f <+191>:   nop
   0xf6550b70 <+192>:   add    $0x1c,%esp
   0xf6550b73 <+195>:   pop    %ebx
   0xf6550b74 <+196>:   pop    %esi
   0xf6550b75 <+197>:   pop    %edi
   0xf6550b76 <+198>:   pop    %ebp
   0xf6550b77 <+199>:   ret
End of assembler dump.
Stack level 0, frame at 0xffc111c0:
 eip = 0xf6550ac1 in CBaseServer::GetNetStats(float&, float&); saved eip = 0xeb2c88ee
 called by frame at 0xffc11810
 Arglist at 0xffc111b8, args:
 Locals at 0xffc111b8, Previous frame's sp is 0xffc111c0
 Saved registers:
  ebx at 0xffc111ac, ebp at 0xffc111b8, esi at 0xffc111b0, edi at 0xffc111b4, eip at 0xffc111bc
End of Source crash report
sapphonie commented 3 years ago

Pretty sure this needs a recompile against a newer sdk

garrappachc commented 3 years ago

The issue is related to auto updater. Disabling it makes TFTrue work again. This particular call causes the segmentation fault:

g_pServer->GetNumPlayers() <= 1
garrappachc commented 3 years ago

I've compiled TFTrue.so without the autoupdater, that's what I'm going to use temporarily. It comes from the 4.84 tag. download MD5 sum: daefaa11e5bc87054269ba73859d7df8

Arie commented 3 years ago

Thanks, that got me a little further.

Now the server crashes as soon as tftrue_logs_apikey "api-key-here" is called.

garrappachc commented 3 years ago

Now the server crashes as soon as tftrue_logs_apikey "api-key-here" is called.

Interesting, I don't have this issue...

Arie commented 3 years ago

Executing etf2l.cfg also leads to a crash.

garrappachc commented 3 years ago

Executing etf2l.cfg also leads to a crash.

Oh yeah, this happens to me as well. I was too quick to celebrate, then... My bad.

garrappachc commented 3 years ago

Pretty sure this needs a recompile against a newer sdk

Any lead on this? No officially available newer version of source sdk...

sapphonie commented 3 years ago

Pretty sure this needs a recompile against a newer sdk

Any lead on this? No officially available newer version of source sdk...

https://github.com/alliedmodders/hl2sdk https://github.com/alliedmodders/hl2sdk/tree/tf2

Arie commented 3 years ago

With Anakin's commit I was able to compile a versions that no longer crashes on execing etf2l.cfg and seems to work. Since I don't see this new compiled version in the regular places, you can use my compiled .so file: https://dl.serveme.tf/TFTrue.so (md5: 6a5fc975f0086458ef601e37aaab84b5)