New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server crash with Player.get_view_coordinates() and @EntityPreHook #233

ThaPwned opened this Issue Dec 17, 2017 · 2 comments


None yet
3 participants

ThaPwned commented Dec 17, 2017


Date          : 2017-12-17 20:33:10.774142
OS            : Linux-4.9.13eorfix-x86_64-with-debian-8.9
Game          : csgo
SP version    : 622
Server plugins:
   00: Source.Python, (C) 2012-2016, Source.Python Team.
SP plugins:
   00: crash_test

Code to reproduce the crash:

from entities.hooks import EntityCondition
from entities.hooks import EntityPreHook
from memory import make_object
from players import UserCmd
from players.constants import PlayerButtons
from players.entity import Player

@EntityPreHook(EntityCondition.is_player, 'run_command')
def run_command(stack):
    player = make_object(Player, stack[0])

    if not player.dead and player.steamid != 'BOT':
        usercmd = make_object(UserCmd, stack[1])

        if usercmd.buttons & PlayerButtons.FORWARD and not player.buttons & PlayerButtons.FORWARD:

@Ayuto Ayuto added the bug label Dec 19, 2017


This comment has been minimized.


Ayuto commented Dec 19, 2017

Thanks! I'm able to reproduce the crash with CS:GO. Here is a crash dump:

CRASH: Tue Dec 19 10:46:11 PST 2017
Start Line: ./srcds_linux -game csgo -console +game_type 0 +game_mode 0 +map de_dust2 -condebug -debug +developer 1 -timeout 999999
[New LWP 4003]
[New LWP 4005]
[New LWP 4011]
[New LWP 4022]
[New LWP 4021]
[New LWP 4023]
[New LWP 4015]
[New LWP 4017]
[New LWP 4012]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/".
Core was generated by `./srcds_linux -game csgo -console +game_type 0 +game_mode 0 +map de_dust2 -cond'.
Program terminated with signal SIGABRT, Aborted.
#0  0xb7787d4c in __kernel_vsyscall ()
#0  0xb7787d4c in __kernel_vsyscall ()
#1  0xb7587687 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#2  0xb758aab3 in __GI_abort () at abort.c:89
#3  0xb751ee8b in Plat_SetBenchmarkMode () from /home/ayuto/Desktop/Server/csgo/bin/
#4  0xb753524c in ?? () from /home/ayuto/Desktop/Server/csgo/bin/
#5  <signal handler called>
#6  0xac93c438 in AsmJit::AssemblerCore::_emitInstruction(unsigned int, AsmJit::Operand const*, AsmJit::Operand const*, AsmJit::Operand const*) () from /home/ayuto/Desktop/Server/csgo/csgo/addons/source-python/bin/
#7  0xac93bd94 in AsmJit::AssemblerCore::_emitInstruction(unsigned int, AsmJit::Operand const*, AsmJit::Operand const*, AsmJit::Operand const*) () from /home/ayuto/Desktop/Server/csgo/csgo/addons/source-python/bin/
#8  0xac939023 in copy_bytes () from /home/ayuto/Desktop/Server/csgo/csgo/addons/source-python/bin/
#9  0xab925a1b in ?? ()
#10 0xb1f38bde in ?? () from /home/ayuto/Desktop/Server/csgo/csgo/bin/
#11 0xb1f3982b in ?? () from /home/ayuto/Desktop/Server/csgo/csgo/bin/
#12 0xb1ebc453 in ?? () from /home/ayuto/Desktop/Server/csgo/csgo/bin/
#13 0xb5fe7d21 in ?? () from /home/ayuto/Desktop/Server/csgo/bin/
#14 0xb1e0a4d5 in ?? () from /home/ayuto/Desktop/Server/csgo/csgo/bin/
#15 0xb1f05422 in ?? () from /home/ayuto/Desktop/Server/csgo/csgo/bin/
#16 0xb1f7d29f in ?? () from /home/ayuto/Desktop/Server/csgo/csgo/bin/
#17 0xb1f6045c in ?? () from /home/ayuto/Desktop/Server/csgo/csgo/bin/
#18 0xb2306daf in ?? () from /home/ayuto/Desktop/Server/csgo/csgo/bin/
#19 0xab925500 in ?? ()
#20 0xb1f35eb4 in ?? () from /home/ayuto/Desktop/Server/csgo/csgo/bin/
#21 0xb1f36153 in ?? () from /home/ayuto/Desktop/Server/csgo/csgo/bin/
#22 0xb1ebe866 in ?? () from /home/ayuto/Desktop/Server/csgo/csgo/bin/
#23 0xb5eba8ae in ?? () from /home/ayuto/Desktop/Server/csgo/bin/
#24 0xb5ebb9c7 in ?? () from /home/ayuto/Desktop/Server/csgo/bin/
#25 0xb5f6ddbe in ?? () from /home/ayuto/Desktop/Server/csgo/bin/
#26 0xb5f6ea5c in ?? () from /home/ayuto/Desktop/Server/csgo/bin/
#27 0xb5f6f1c8 in ?? () from /home/ayuto/Desktop/Server/csgo/bin/
#28 0xb5f78414 in ?? () from /home/ayuto/Desktop/Server/csgo/bin/
#29 0xb5f786e6 in ?? () from /home/ayuto/Desktop/Server/csgo/bin/
#30 0xb5f787f9 in ?? () from /home/ayuto/Desktop/Server/csgo/bin/
#31 0xb5fdabba in ?? () from /home/ayuto/Desktop/Server/csgo/bin/
#32 0xb5fd7b06 in ?? () from /home/ayuto/Desktop/Server/csgo/bin/
#33 0xb6fc64ed in ?? () from /home/ayuto/Desktop/Server/csgo/bin/
#34 0xb6fc6578 in ?? () from /home/ayuto/Desktop/Server/csgo/bin/
#35 0xb5fd7bfd in ?? () from /home/ayuto/Desktop/Server/csgo/bin/
#36 0xb610c090 in ?? () from /home/ayuto/Desktop/Server/csgo/bin/
#37 0xb5fd8def in ?? () from /home/ayuto/Desktop/Server/csgo/bin/
#38 0xb6fc6654 in ?? () from /home/ayuto/Desktop/Server/csgo/bin/
#39 0xb7023890 in ?? () from /home/ayuto/Desktop/Server/csgo/bin/
#40 0xb7024abe in ?? () from /home/ayuto/Desktop/Server/csgo/bin/
#41 0xb7023890 in ?? () from /home/ayuto/Desktop/Server/csgo/bin/
#42 0xb6fbf8f3 in ?? () from /home/ayuto/Desktop/Server/csgo/bin/
#43 0x080486f9 in main ()
No symbol table info available.
eax            0x0	0
ecx            0xfa3	4003
edx            0x6	6
ebx            0xfa3	4003
esp            0xbfe93944	0xbfe93944
ebp            0xbfe93aa8	0xbfe93aa8
esi            0x1	1
edi            0xb7705000	-1217376256
eip            0xb7787d4c	0xb7787d4c <__kernel_vsyscall+16>
eflags         0x200206	[ PF IF ID ]
cs             0x73	115
ss             0x7b	123
ds             0x7b	123
es             0x7b	123
fs             0x0	0
gs             0x33	51
From        To          Syms Read   Shared Object Library
0xb772f600  0xb775d33b  Yes         /lib/i386-linux-gnu/
0xb7726ad0  0xb772796c  Yes         /lib/i386-linux-gnu/
0xb770d840  0xb771a467  Yes         /lib/i386-linux-gnu/
0xb7570490  0xb76a3cee  Yes         /lib/i386-linux-gnu/
0xb778a860  0xb77a276c  Yes         /lib/
0xb7518190  0xb75348ec  Yes (*)     /home/ayuto/Desktop/Server/csgo/bin/
0xb74b9ad0  0xb74e9eec  Yes (*)     /home/ayuto/Desktop/Server/csgo/bin/
0xb6fbf4a0  0xb704c6c8  Yes (*)     /home/ayuto/Desktop/Server/csgo/bin/
0xb6f80d60  0xb6f961b4  Yes (*)     /home/ayuto/Desktop/Server/csgo/bin/
0xb6ee4914  0xb6f2ac78  Yes         /home/ayuto/Desktop/Server/csgo/bin/
0xb6e8ae04  0xb6e9a4b8  Yes         /home/ayuto/Desktop/Server/csgo/bin/
0xb5e39060  0xb62692f0  Yes (*)     /home/ayuto/Desktop/Server/csgo/bin/
0xb56ccc70  0xb57b2a5c  Yes (*)     /home/ayuto/Desktop/Server/csgo/bin/
0xb515d0d0  0xb5217c6c  Yes (*)     /home/ayuto/Desktop/Server/csgo/bin/
0xb4f61b80  0xb50bf99c  Yes (*)     /home/ayuto/Desktop/Server/csgo/bin/
0xb4e4cd80  0xb4ecf704  Yes (*)     /home/ayuto/Desktop/Server/csgo/bin/
0xb4d724b0  0xb4dee054  Yes (*)     /home/ayuto/Desktop/Server/csgo/bin/
0xb4d2a330  0xb4d47050  Yes (*)     /home/ayuto/Desktop/Server/csgo/bin/
0xb339c4c0  0xb4012b04  Yes (*)     /home/ayuto/Desktop/Server/csgo/bin/
0xb777c9b0  0xb77800ba  Yes         /lib/i386-linux-gnu/
0xb32aff60  0xb32d51c0  Yes (*)     /home/ayuto/Desktop/Server/csgo/bin/
0xb2df1b00  0xb2e4ef88  Yes (*)     /home/ayuto/Desktop/Server/csgo/csgo/bin/
0xb1c29850  0xb270071c  Yes (*)     /home/ayuto/Desktop/Server/csgo/csgo/bin/
0xb1884ad0  0xb18b67e4  Yes (*)     /home/ayuto/Desktop/Server/csgo/bin/
0xb184a6a0  0xb186611c  Yes (*)     /home/ayuto/Desktop/Server/csgo/bin/
0xb1627a10  0xb1637ffd  Yes (*)     /home/ayuto/Desktop/Server/csgo/csgo/addons/
0xb660da90  0xb660e437  Yes         /lib/i386-linux-gnu/
0xaccdd040  0xacf78fa4  Yes         /home/ayuto/Desktop/Server/csgo/csgo/addons/source-python/Python3/plat-linux/
0xac3eb010  0xac9436b4  Yes         /home/ayuto/Desktop/Server/csgo/csgo/addons/source-python/bin/
0xb6600750  0xb66015ce  Yes         /home/ayuto/Desktop/Server/csgo/csgo/addons/source-python/Python3/lib-dynload/
0xb1611970  0xb1619e04  Yes         /home/ayuto/Desktop/Server/csgo/csgo/addons/source-python/Python3/lib-dynload/
0xabef6350  0xabf04434  Yes         /home/ayuto/Desktop/Server/csgo/csgo/addons/source-python/Python3/lib-dynload/
0xb1609190  0xb160bfb8  Yes         /home/ayuto/Desktop/Server/csgo/csgo/addons/source-python/Python3/lib-dynload/
0xabe47670  0xabe57d34  Yes (*)     /lib/i386-linux-gnu/
0xb1603ea0  0xb1605392  Yes         /home/ayuto/Desktop/Server/csgo/csgo/addons/source-python/Python3/lib-dynload/
0xabe34e30  0xabe41d34  Yes (*)     /lib/i386-linux-gnu/
0xabe6c660  0xabe6fbc1  Yes         /home/ayuto/Desktop/Server/csgo/csgo/addons/source-python/Python3/lib-dynload/
0xabdfb850  0xabe130f4  Yes (*)     /lib/i386-linux-gnu/
0xabe67b10  0xabe681c2  Yes         /home/ayuto/Desktop/Server/csgo/csgo/addons/source-python/Python3/lib-dynload/
0xabe62390  0xabe64254  Yes         /home/ayuto/Desktop/Server/csgo/csgo/addons/source-python/Python3/lib-dynload/
0xabc84bc0  0xabd7e034  Yes (*)     /lib/i386-linux-gnu/
0xabe26270  0xabe30d24  Yes         /home/ayuto/Desktop/Server/csgo/csgo/addons/source-python/Python3/lib-dynload/
0xabc44760  0xabc4a104  Yes         /home/ayuto/Desktop/Server/csgo/csgo/addons/source-python/Python3/lib-dynload/
0xabe217d0  0xabe2200a  Yes         /home/ayuto/Desktop/Server/csgo/csgo/addons/source-python/Python3/lib-dynload/
0xabc3fc30  0xabc408b1  Yes         /home/ayuto/Desktop/Server/csgo/csgo/addons/source-python/Python3/lib-dynload/
0xb1600610  0xb160085a  Yes         /home/ayuto/Desktop/Server/csgo/csgo/addons/source-python/Python3/lib-dynload/
0xabb7ae40  0xabb7bf34  Yes         /home/ayuto/Desktop/Server/csgo/csgo/addons/source-python/Python3/lib-dynload/
0xabb74420  0xabb764ed  Yes         /home/ayuto/Desktop/Server/csgo/csgo/addons/source-python/Python3/lib-dynload/
0xabb699e0  0xabb6ded2  Yes         /home/ayuto/Desktop/Server/csgo/csgo/addons/source-python/Python3/lib-dynload/
0xabb61de0  0xabb641e4  Yes         /home/ayuto/Desktop/Server/csgo/csgo/addons/source-python/Python3/lib-dynload/
0xabb088b0  0xabb16804  Yes         /home/ayuto/Desktop/Server/csgo/csgo/addons/source-python/Python3/lib-dynload/
0xab8cebc0  0xab8dd3a4  Yes         /home/ayuto/Desktop/Server/csgo/csgo/addons/source-python/Python3/lib-dynload/
0xab7c13c0  0xab7f7b54  Yes         /home/ayuto/Desktop/Server/csgo/csgo/addons/source-python/Python3/lib-dynload/
0xab473440  0xab47991e  Yes         /home/ayuto/Desktop/Server/csgo/csgo/addons/source-python/Python3/lib-dynload/
0xab3593a0  0xab35c114  Yes         /home/ayuto/Desktop/Server/csgo/csgo/addons/source-python/Python3/lib-dynload/
0xab339ad0  0xab33f9ab  Yes         /lib/i386-linux-gnu/
0xab334890  0xab3355e4  Yes (*)     /lib/i386-linux-gnu/
0xab32dc40  0xab330ce1  Yes         /lib/i386-linux-gnu/
0xab317750  0xab3241c4  Yes         /lib/i386-linux-gnu/
0xab34fd20  0xab354c6c  Yes         /home/ayuto/Desktop/Server/csgo/csgo/addons/source-python/Python3/lib-dynload/
0xab349210  0xab34b274  Yes         /home/ayuto/Desktop/Server/csgo/csgo/addons/source-python/Python3/lib-dynload/
0xab0fd2e0  0xab10c294  Yes         /home/ayuto/Desktop/Server/csgo/csgo/addons/source-python/Python3/lib-dynload/
0xab0def50  0xab0e2554  Yes (*)     /usr/lib/i386-linux-gnu/
0xaafe6400  0xab079814  Yes (*)     /home/ayuto/Desktop/Server/csgo/csgo/addons/source-python/Python3/plat-linux/
(*): Shared library is missing debugging information.
Dump of assembler code for function __kernel_vsyscall:
   0xb7787d3c <+0>:	push   %ecx
   0xb7787d3d <+1>:	push   %edx
   0xb7787d3e <+2>:	push   %ebp
   0xb7787d3f <+3>:	mov    %esp,%ebp
   0xb7787d41 <+5>:	sysenter 
   0xb7787d43 <+7>:	nop
   0xb7787d44 <+8>:	nop
   0xb7787d45 <+9>:	nop
   0xb7787d46 <+10>:	nop
   0xb7787d47 <+11>:	nop
   0xb7787d48 <+12>:	nop
   0xb7787d49 <+13>:	nop
   0xb7787d4a <+14>:	int    $0x80
=> 0xb7787d4c <+16>:	pop    %ebp
   0xb7787d4d <+17>:	pop    %edx
   0xb7787d4e <+18>:	pop    %ecx
   0xb7787d4f <+19>:	ret    
End of assembler dump.
Stack level 0, frame at 0xbfe93954:
 eip = 0xb7787d4c in __kernel_vsyscall; saved eip = 0xb7587687
 called by frame at 0xbfe93960
 Arglist at 0xbfe9394c, args: 
 Locals at 0xbfe9394c, Previous frame's sp is 0xbfe93954
 Saved registers:
  ebp at 0xbfe93944, eip at 0xbfe93950
End of Source crash report

The funny thing is that it seems like it's crashing while a hook is being created. I will investigate this.


This comment has been minimized.

KhaimovMR commented Sep 30, 2018

I think I've got related problem on linux.

from players.entity import Player
from events.hooks import PreEvent

def on_weapon_fire(event):
	player = Player.from_userid(event['userid'])

	if player.view_player:
		player.view_coordinates = player.view_player.eye_location

The problem only comes out when this code executes on PreEvent. Everything works fine If we change PreEvent to Event. If not - dedicaded linux server is crashing.

The crash is occurred on the line:

	if player.view_player:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment