komashchenko / PTaH

Additional CS:GO Hooks and Natives
GNU General Public License v3.0
78 stars 42 forks source link

PTaH segfault building from source on Ubuntu #34

Closed kus closed 4 years ago

kus commented 4 years ago

Hi,

I come across your module from trying to get https://github.com/kgns/weapons working on my server.

I followed installation instructions and have tried linux versions from https://ptah.zizt.ru/, https://github.com/komashchenko/PTaH/issues/15 and built from source following these instructions https://wiki.alliedmods.net/Building_SourceMod (then cloning your repo to /alliedmodders/sourcemod/extensions/ and building) and for each version the server will load the weapons plugin [SM] Loaded plugin weapons.smx successfully. but as soon as a player joins the server or the map changes the server crashes.

Metamod:Source version 1.10.7-dev
Built from: https://github.com/alliedmodders/metamod-source/commit/6c8495f
Build ID: 971:6c8495f
Loaded As: Valve Server Plugin
Compiled on: Sep  2 2019
Plugin interface version: 15:14
SourceHook version: 5:5
http://www.metamodsource.net/

Listing 3 plugins:
  [01] SourceMod (1.10.0.6488) by AlliedModders LLC
  [02] CS Tools (1.10.0.6488) by AlliedModders LLC
  [03] SDK Tools (1.10.0.6488) by AlliedModders LLC
SourceMod Version Information:
SourceMod Version: 1.10.0.6488
SourcePawn Engine: 1.10.0.6488, jit-x86 (build 1.10.0.6488)
SourcePawn API: v1 = 5, v2 = 12
Compiled on: Apr 30 2020 16:34:07
Built from: https://github.com/alliedmodders/sourcemod/commit/afb40f1
Build ID: 6488:afb40f1
http://www.sourcemod.net/

[SM] Listing 20 plugins:
  01 "Client Preferences" (1.10.0.6478) by AlliedModders LLC
  02 "Player Commands" (1.10.0.6478) by AlliedModders LLC
  03 "Admin Menu" (1.10.0.6478) by AlliedModders LLC
  04 "Basic Ban Commands" (1.10.0.6478) by AlliedModders LLC
  05 "Fun Votes" (1.10.0.6478) by AlliedModders LLC
  06 "Sound Commands" (1.10.0.6478) by AlliedModders LLC
  07 "Command Time-Traveler" (1.2.0) by DarthNinja
  08 "Anti-Flood" (1.10.0.6478) by AlliedModders LLC
  09 "Nextmap" (1.10.0.6478) by AlliedModders LLC
  10 "Fun Commands" (1.10.0.6478) by AlliedModders LLC
  11 "Fix Hint Color Messages" (1.2.2 Franc1sco franug github version) by Phoenix (˙·٠●Феникс●٠·˙)
  12 "Reserved Slots" (1.10.0.6478) by AlliedModders LLC
  13 "Basic Comm Control" (1.10.0.6478) by AlliedModders LLC
  14 "Map configs" (1.3) by Berni
  15 "Basic Votes" (1.10.0.6478) by AlliedModders LLC
  16 "Basic Commands" (1.10.0.6478) by AlliedModders LLC
  17 "Basic Info Triggers" (1.10.0.6478) by AlliedModders LLC
  18 "Admin File Reader" (1.10.0.6478) by AlliedModders LLC
  19 "Basic Chat" (1.10.0.6478) by AlliedModders LLC
  20 "Admin Help" (1.10.0.6478) by AlliedModders LLC
  21 "Weapons & Knives" (1.6.0) by kgns | oyunhost.net

Crash in console:

May 13 04:05:01: PreMinidumpCallback: updating dump comment
May 13 04:05:02: crash_20200513040404_1.dmp[2555]: Uploading dump (out-of-process)
May 13 04:05:02: /tmp/dumps/crash_20200513040404_1.dmp
May 13 04:05:02: crash_20200513040404_1.dmp[2555]: Finished uploading minidump (out-of-process): success = no
May 13 04:05:02: crash_20200513040404_1.dmp[2555]: error: libcurl.so: cannot open shared object file: No such file or directory
May 13 04:05:02: crash_20200513040404_1.dmp[2555]: file ''/tmp/dumps/crash_20200513040404_1.dmp'', upload no: ''libcurl.so: cannot open shared object file: No such file or directory''
May 13 04:05:02: show_signal_msg: 4 callbacks suppressed
May 13 04:05:02: srcds_linux[2515]: segfault at ff287ffc ip 00000000dda58f73 sp 00000000ff288000 error 6 in PTaH.ext.2.csgo.so[dda54000+1a6000]
May 13 04:05:02: Segmentation fault (core dumped)

Any idea what is going wrong?

kus commented 4 years ago

This is the commit where I added it to my server https://github.com/kus/csgo-modded-server/commit/2f0911de3e42a6500886ff28efa4f2f71247dd58

komashchenko commented 4 years ago

@kus Hello, install V1.1.1-build17 from https://ptah.zizt.ru/ and give me crash id Accelerator

kus commented 4 years ago

@komashchenko hi, I reinstalled the plugins from scratch and used PTaH V1.1.1-build17 from https://ptah.zizt.ru/ see commit here https://github.com/kus/csgo-modded-server/commit/852281c6b9abb3fccfc4b48950f350c6bf44cbf8

If the weapons plugin was NOT loaded, the server behaved normally, it could change map etc.

If I loaded the weapons plugin, I could use !knife to open the Knife menu, but the skin wouldn't change if I selected one, and when I changed the map the server crashed.

Accelerator crash log https://crash.limetech.org/dstjcrkct4xl

komashchenko commented 4 years ago

@kus I still could not reproduce your error on the server, try this version, it should give more information, it is strange that no one else had the same error as yours PTaH.ext.2.csgo.zip

kus commented 4 years ago

Hi @komashchenko I uploaded that to my server https://github.com/kus/csgo-modded-server/commit/b7530a4853bdc60af28a058c7f1b6c170c70d2b4

Change map with no weapons plugin - works

Load weapons plugin - it loads, no crash yet

Change map with weapons plugin loaded - crash

https://crash.limetech.org/4rqttccpzgan

Metamod:Source version 1.10.7-dev
Built from: https://github.com/alliedmodders/metamod-source/commit/6c8495f
Build ID: 971:6c8495f
Loaded As: Valve Server Plugin
Compiled on: Sep  2 2019
Plugin interface version: 15:14
SourceHook version: 5:5
http://www.metamodsource.net/

Listing 3 plugins:
  [01] SourceMod (1.10.0.6488) by AlliedModders LLC
  [02] CS Tools (1.10.0.6488) by AlliedModders LLC
  [03] SDK Tools (1.10.0.6488) by AlliedModders LLC
 SourceMod Version Information:
    SourceMod Version: 1.10.0.6488
    SourcePawn Engine: 1.10.0.6488, jit-x86 (build 1.10.0.6488)
    SourcePawn API: v1 = 5, v2 = 12
    Compiled on: Apr 30 2020 16:34:07
    Built from: https://github.com/alliedmodders/sourcemod/commit/afb40f1
    Build ID: 6488:afb40f1
    http://www.sourcemod.net/

[SM] Listing 20 plugins:
  01 "Client Preferences" (1.10.0.6478) by AlliedModders LLC
  02 "Player Commands" (1.10.0.6478) by AlliedModders LLC
  03 "Admin Menu" (1.10.0.6478) by AlliedModders LLC
  04 "Basic Ban Commands" (1.10.0.6478) by AlliedModders LLC
  05 "Fun Votes" (1.10.0.6478) by AlliedModders LLC
  06 "Sound Commands" (1.10.0.6478) by AlliedModders LLC
  07 "Command Time-Traveler" (1.2.0) by DarthNinja
  08 "Anti-Flood" (1.10.0.6478) by AlliedModders LLC
  09 "Nextmap" (1.10.0.6478) by AlliedModders LLC
  10 "Fun Commands" (1.10.0.6478) by AlliedModders LLC
  11 "Fix Hint Color Messages" (1.2.2 Franc1sco franug github version) by Phoenix (˙·٠●Феникс●٠·˙)
  12 "Reserved Slots" (1.10.0.6478) by AlliedModders LLC
  13 "Basic Comm Control" (1.10.0.6478) by AlliedModders LLC
  14 "Map configs" (1.3) by Berni
  15 "Basic Votes" (1.10.0.6478) by AlliedModders LLC
  16 "Basic Commands" (1.10.0.6478) by AlliedModders LLC
  17 "Basic Info Triggers" (1.10.0.6478) by AlliedModders LLC
  18 "Admin File Reader" (1.10.0.6478) by AlliedModders LLC
  19 "Basic Chat" (1.10.0.6478) by AlliedModders LLC
  20 "Admin Help" (1.10.0.6478) by AlliedModders LLC
komashchenko commented 4 years ago

Give me access full dump https://crash.limetech.org/settings/share 76561198067395130

kus commented 4 years ago

Hi @komashchenko done

kus commented 4 years ago

Hi @komashchenko if you want to replicate exactly my setup, if you have a Ubuntu server, download my repo https://github.com/kus/csgo-modded-server rename your cfg and addons folder on your server and put mine from the csgo folder in. Start the server ./srcds_linux -console -usercon -autoupdate -game csgo -tickrate 128 -port 27015 -maxplayers_override 32 +game_type 0 +game_mode 0 +mapgroup mg_active +map de_dust2 +ip 0.0.0.0 -steam and once the server is loaded, load the weapons plugin sm plugins load disabled/weapons.smx and change the map to de_inferno and it will crash.

komashchenko commented 4 years ago

@kus Twice call SDK_OnAllLoaded creates an extra hook, which takes it to a recursive call, you need to wait for corrections from SM https://github.com/komashchenko/PTaH/blob/5438020d39e83614c8dea23cac17ca0510665683/extension.cpp#L98 https://github.com/komashchenko/PTaH/blob/5438020d39e83614c8dea23cac17ca0510665683/forwards.cpp#L58 https://github.com/komashchenko/PTaH/blob/5438020d39e83614c8dea23cac17ca0510665683/forwards.cpp#L412

kus commented 4 years ago

@komashchenko thank you so much for the level of effort you have gone into getting to the bottom of this and reporting it to SM. Much appreciated

kus commented 4 years ago

@komashchenko would it also happen if I loaded it like this?

Start server (it loads with base plugins)

Execute comp.cfg which has:

sm plugins unload_all
sm plugins refresh
sm plugins load disabled/mapchooser.smx
sm plugins load disabled/kento_rankme.smx
sm plugins load disabled/warmod.smx
sm plugins load disabled/weapons.smx

My server is setup so when it boots it loads the base metamod and sourcemod then you can execute a config and change the active mod and then it changes the map. I.e. change from Soccer to WarMod competitive or GunGame.

Or is there a better way to unload/reload sourcemod/metamod that wouldn't break going between mods?

kus commented 4 years ago

@komashchenko I've just moved the weapons plugin from disabled to the plugins folder so it loads for every mod and that has fixed the issue for me. So happy to close this. Thanks for your help and your great work!

komashchenko commented 4 years ago

@kus Fixed https://github.com/alliedmodders/sourcemod/pull/1293