shanapu / MyJailbreak

A rewrite of Franugs Special Jailbreak and merge of eccas, ESK0s & zipcores Jailbreak Warden
https://forums.alliedmods.net/showthread.php?t=283212
GNU General Public License v3.0
52 stars 36 forks source link

Warden Zeus Crashes server #319

Open ClydeSheldon opened 5 years ago

ClydeSheldon commented 5 years ago

MyJailbreak Build: MyJB-master-58f4b42 SourceMod Build: 1.9.0.6256

When the warden spams his zeus on a prisoner the server will crash. Basically when he has no cuffs and uses zeus it crashes the server.

How do you reproduce crash?

I also set sm_warden_handcuffs "0" but when you give a zeus to warden. If he uses it on a prisoner then the server will also crash. Which in my opinion is weird since I thought I disabled cuffs. So I was expecting it to just kill the player with the zeus.

I think the problem is with OnPlayerRunCmd in the handcuffs.sp This post might be useful for fixing this crash https://forums.alliedmods.net/showthread.php?p=2557725#post2557725

https://crash.limetech.org/laqatxou5tdt https://crash.limetech.org/q2gma4v5gx46

Hexer10 commented 5 years ago

Thanks for the report! I'll try to reproduce this. Tough I don't think that that errors could be related, however can you see this string before the crash?

CLagCompensationManager::StartLagCompensation with NULL CUserCmd!!!

or any useful log ?

EDIT: I can reproduce this, gonna run some more tests.

Actually the player dies, this is what I could find from the logs:

MultiDamage:  g_MultiDamage.GetDamageForce() == vec3_origin
L 12/05/2018 - 18:21:06: "Hexah #!<2><STEAM_1:0:138675850><CT>" [77 -147 -9920] killed "Tom<3><BOT><TERRORIST>" [16 -128 -9856] with "taser"
Hexer10 commented 5 years ago

Kinda weird... Even removing the whole OnPlayerRunCmd(...) block from warden.sp, the crash still occures

ClydeSheldon commented 5 years ago

Alright idk if this helps but I tried some more debugging and when I remove all lines that use handcuffs.sp from warden.sp and deputy.sp and test. The zeus kills players with no crash. So something is wrong in handcuffs.sp obviously. I'll update if I find something new or something wrong with the handcuffs.sp code.

ClydeSheldon commented 5 years ago

Alright so this will stop the crashes. In handcuffs.sp change the following line:

Line 381: return Plugin_Continue; change to return Plugin_Handled;

The only problem with this solution is that if the warden finds another zeus on the map or you give your self a taser after using all your cuffs. The zeus will not kill the Prisoner it will simply do nothing because of line 381.

shanapu commented 5 years ago

hi, much thanks for the report and all your research guys! 👍 Strange this hasn't occurred before. I'll setup test server tonight and go into this issue.

shanapu commented 5 years ago

So after some tests a update, I cannot reproduce the crash, but I think, I have found the direction to the origin of it.

But first, to be on the safe side:

  1. This crash only happens on excessively spamming Taser.
  2. This crash don't happend when using the zeus on a sane way. 2.5 Handcuffs works fine when using them "normal".
  3. I assume you @ClydeSheldon run your server on a linux machine like @Hexer10? I can only test on a windows machine and I don't get a crash.

When I spam the taser heavily - cuff' an enemy, uncuff' him and kill him - on this action 'it should crash (like on your servers)', but no crash for me (bot died), I just receive 250 Bullets on the taser and can keep spamming . I still can fire the taser decreasing these 250 bullets (an kill more bots). When I stop fire or slow down the spam frequent I drop the taser like as usual and cannot pick it up.

So on linux after the last bullet and the kill you get the crash. And on windows after last bullet and kill I get 250 bullets. ?!?

I think because of the frequency of firing, the event/hook HandCuffs_Event_WeaponFire is lagging behind or can't calculate the right values or something else. So instead of droping the taser after last bullet it crash on linux and give 250 on win !?

I still don't know what the actual problem is, but I#m almost sure it dependent on the weapon fire hook and the high frequency on spam.

a lot of speculations about it. I'm still on it

ClydeSheldon commented 5 years ago

Yes, my server is on a linux machine. After testing again today, I cannot reproduce the crash on my linux machine. If I spam the zeus, it will end up killing the prisoner and drop the zeus. I also tried on a windows server I have. On windows machine I also get 250 bullets on zeus. So what it seems is that the issue likely got fixed with the latest sourcemod build or maybe valves update, i'm not sure. @Hexer10 does your server still crash like it did the other day?

Linux machine: SM build 6267 Windows machine: SM build 6268.

shanapu commented 5 years ago

uh sound good, valve created AND fixed a bug. I'm pretty sure this bug wasn't there in the time of developing this feature. Especially with handcuffs we had very intensive penetration tests.