player.velocity csgo linux crash

Please post any questions about developing your plugin here. Please use the search function before posting!
decompile
Senior Member
Posts: 416
Joined: Sat Oct 10, 2015 10:37 am
Location: Germany
Contact:

player.velocity csgo linux crash

Postby decompile » Wed Aug 17, 2016 2:55 pm

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
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: player.velocity csgo linux crash

Postby L'In20Cible » Wed Aug 17, 2016 3:02 pm

PlayerEntity? Are you sure your Source.Python installation is up-to-date? That class got renamed to Player last year...
decompile
Senior Member
Posts: 416
Joined: Sat Oct 10, 2015 10:37 am
Location: Germany
Contact:

Re: player.velocity csgo linux crash

Postby decompile » Wed Aug 17, 2016 3:04 pm

I changed the player class to PlayerEntity cause my general player class is called Player.

Sorry forgot to mention that.
User avatar
Mahi
Senior Member
Posts: 236
Joined: Wed Aug 29, 2012 8:39 pm
Location: Finland

Re: player.velocity csgo linux crash

Postby Mahi » Wed Aug 17, 2016 3:22 pm

Why do you stick with an outdated version? Updating alone would probably fix this....
User avatar
iPlayer
Developer
Posts: 590
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Re: player.velocity csgo linux crash

Postby iPlayer » Wed Aug 17, 2016 3:40 pm

Well, he said he only has it called PlayerEntity because "Player" was used for his own needs.
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam

Hail, Companion. [...] Hands to yourself, sneak thief. Image
User avatar
Mahi
Senior Member
Posts: 236
Joined: Wed Aug 29, 2012 8:39 pm
Location: Finland

Re: player.velocity csgo linux crash

Postby Mahi » Wed Aug 17, 2016 3:48 pm

Wow sorry I missed that, I'm becoming blind (unless he edited it afterwards)...
User avatar
Ayuto
Project Leader
Posts: 2195
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: player.velocity csgo linux crash

Postby Ayuto » Wed Aug 17, 2016 4:15 pm

Mahi wrote:Wow sorry I missed that, I'm becoming blind (unless he edited it afterwards)...

Nope, you are blind. :grin:
User avatar
Ayuto
Project Leader
Posts: 2195
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: player.velocity csgo linux crash

Postby Ayuto » Wed Aug 17, 2016 4:43 pm

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!
decompile
Senior Member
Posts: 416
Joined: Sat Oct 10, 2015 10:37 am
Location: Germany
Contact:

Re: player.velocity csgo linux crash

Postby decompile » Thu Aug 18, 2016 3:23 pm

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
User avatar
Ayuto
Project Leader
Posts: 2195
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: player.velocity csgo linux crash

Postby Ayuto » Thu Aug 18, 2016 3:53 pm

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:

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 40 guests