Page 1 of 1

player.velocity csgo linux crash

Posted: Wed Aug 17, 2016 2:55 pm
by decompile
Hey,

After I copied my cs:go plugin to a linux server, I noticed that my server crashes when I try to use player.velocity.length.


Syntax: Select all

@property
def velocity_3d(self):
velocity = PlayerEntity(self.index).velocity
return velocity

def something(self):
print(self.velocity_3d)
print(self.velocity_3d.length)


Console:

Code: Select all

Vector(3.461555004119873, 260.0, -216.75662231445312)
PreMinidumpCallback: updating dump comment
crash_20160817164415_1.dmp[18837]: Uploading dump (out-of-process)
/tmp/dumps/crash_20160817164415_1.dmp
Segmentation fault (core dumped)
BFD: Warning: /home/kd10095/server/csgo_1636/core is truncated: expected core file size >= 429355008, found: 1126400.
Cannot access memory at address 0xb77d091c
Cannot access memory at address 0xb77d0918
debug.cmds:1: Error in sourced command file:
Cannot access memory at address 0xbf936bc4
email debug.log to linux@valvesoftware.com
Wed Aug 17 16:46:44 CEST 2016: Server restart in 10 seconds


This code works well on CS:S Win&Linux and CS:GO win, but seems like it crashes on CS:GO Linux

Re: player.velocity csgo linux crash

Posted: Wed Aug 17, 2016 3:02 pm
by L'In20Cible
PlayerEntity? Are you sure your Source.Python installation is up-to-date? That class got renamed to Player last year...

Re: player.velocity csgo linux crash

Posted: Wed Aug 17, 2016 3:04 pm
by decompile
I changed the player class to PlayerEntity cause my general player class is called Player.

Sorry forgot to mention that.

Re: player.velocity csgo linux crash

Posted: Wed Aug 17, 2016 3:22 pm
by Mahi
Why do you stick with an outdated version? Updating alone would probably fix this....

Re: player.velocity csgo linux crash

Posted: Wed Aug 17, 2016 3:40 pm
by iPlayer
Well, he said he only has it called PlayerEntity because "Player" was used for his own needs.

Re: player.velocity csgo linux crash

Posted: Wed Aug 17, 2016 3:48 pm
by Mahi
Wow sorry I missed that, I'm becoming blind (unless he edited it afterwards)...

Re: player.velocity csgo linux crash

Posted: Wed Aug 17, 2016 4:15 pm
by Ayuto
Mahi wrote:Wow sorry I missed that, I'm becoming blind (unless he edited it afterwards)...

Nope, you are blind. :grin:

Re: player.velocity csgo linux crash

Posted: Wed Aug 17, 2016 4:43 pm
by Ayuto
It's working fine on my machine. Could you please delete your debug.log, cause a crash and post the new debug.log here? Also, please post a tested snippet that reproduces the issue!

Re: player.velocity csgo linux crash

Posted: Thu Aug 18, 2016 3:23 pm
by decompile

Code: Select all

----------------------------------------------
CRASH: Thu Aug 18 17:21:18 CEST 2016
Start Line: ./srcds_linux -game csgo -lan 0 -console -usercon -maxplayers 16 -port XXXXX -tickrate 66 +login anonymous +net_public_adr XX.XXX.XX.XX -ip XX.XXX.XX.XX  +game_type 3 +game_mode 0 +map surf_beginner -authkey XXXXXXXXXXXXXXXXXXXXX -debug
[New LWP 18912]
[New LWP 18917]
[New LWP 18929]
[New LWP 18913]
[New LWP 18933]
[New LWP 18920]
[New LWP 18921]
[New LWP 18927]
[New LWP 19020]
[New LWP 19134]
[New LWP 18923]
#0  0xacae5787 in ?? ()
End of Source crash report
----------------------------------------------


and

Syntax: Select all

from listeners import OnEntityOutput
from players.entity import Player

@OnEntityOutput
def endTouch(output_name, activator, caller, value, delay):
if output_name == 'OnEndTouch' and caller.classname == 'trigger_multiple':
if activator.classname == "player":
leaveZone(activator.index)

def velocity_3d(index):
velocity = Player(index).velocity
return velocity

def leaveZone(index):
print(velocity_3d(index))
print(velocity_3d(index).length)
leaveZoneVelocity = velocity_3d

Re: player.velocity csgo linux crash

Posted: Thu Aug 18, 2016 3:53 pm
by Ayuto
I would have expected more after this line:

Code: Select all

#0  0xacae5787 in ?? ()

However, please also do this:
Ayuto wrote:Also, please post a tested snippet that reproduces the issue!

Edit: Okay, you just added it. :grin: