GAMMACASE/MomSurfFix

Crashes since #5

sneak-it opened this issue · 20 comments

The plugin causes crashes with #5 on Windows servers. Linux appears to do just fine, but Windows does not like the change. No error logs.

SM Version: 1.10.0.6492
CS:GO Version: 1.37.7.0
Dhooks Detours Versions tested: detours9, detours15

No error logs are produced, however I do have several accelerator links that are fairly unhelpful as far as I can tell:
https://crash.limetech.org/m4ncxggmmvzz
https://crash.limetech.org/7k5qdsudjj72
https://crash.limetech.org/zmvqcz3frecl
https://crash.limetech.org/247c7a7e3h7m

Issue seems to be pretty widely confirmed within the KZ community after the recent adoption of this plugin. Rolling back to 4037f73 stops the crashes.

That's interesting, I'll do some checks, thanks for the report. Sadly accelerator reports seems to be not that useful as they all unique for some reason, which doesn't make any sense really.

Also is it crashing absolutely randomly, or is there some way to reproduce this behavior?

Also did you compiled all versions yourself? Or for the older one you used release binaries? And some raw views of accelerator reports will also help to track this bug down.

So I've reversed one call stack from one of yours accelerator reports (https://crash.limetech.org/zmvqcz3frecl), and it doesn't seems to be related to this plugin:

CBitRead::ReadVarInt32()
CNetMessagePB<15,CCLCMsg_LoadingProgress,0,1>::ReadFromBuffer()
CNetMessageBinder::BindParams<CNetMessagePB<15,CCLCMsg_LoadingProgress,0,1>>::CreateFromBuffer()
CUserMessageBinder::Bind<CCLCMsg_CmdKeyValues_t>()
CBaseClient::ConnectionStart()
CNetChan::Setup()
NET_CreateNetChannel()
CBaseServer::ConnectClient()
CBaseServer::ProcessConnectionlessPacket()
0x37727584 - NET_ProcessSocket()???
CBaseServer::RunFrame()
SV_Frame()

And these two reports (https://crash.limetech.org/7k5qdsudjj72 and https://crash.limetech.org/m4ncxggmmvzz) seems to be pointing to some thread related functions, so don't think there's anything useful in there. So, do you use any plugins that are somehow related to player connection or something like this, maybe some session\lobby fix, or my server_redirect plugin, etc.?

All versions tested were self-compiled against provided includes, SM 1.10 includes, and latest detours15 includes. Seems to crash "randomly", however fairly consistently with a populated server. No known way of reproducing besides tossing on a server with some players and waiting.

I do run your server redirect plugin, however the crash is very reproducible by running commit 38f34e8 . The crashing stops entirely reverting back to 4037f73 - Tested this on multiple servers, multiple times, with unrelated plugins. The crashing happens to other server owners as well with entirely different plugin stacks.

Are you 100% sure that reverting back fixes it? As I'm not see a connection really, as that change in the latest commit is minor and shouldn't really produce some memory corruption (cuz that's what I can think of rn).

100% certain, the folks developing GOKZ will also be reverting to StoreToAddress shortly and we'll have some more confirmations on that fix.

Well alright, toss some other accelerator logs if you'll get any later, as currently I'm not sure what is the cause of this.

Can you also provide raw view of the reports you sent in main message? (Just a screenshot of webpage when it'll load raw view would be enough)

Since I'm not really able to reproduce these crashes and test changes, can you test changes I pushed to here https://github.com/GAMMACASE/MomSurfFix/tree/storetoadressfast_fix ? There were also include file update, so don't forget to update it too.

I'll go ahead and throw it on a server right now, thank you!

Hmm, still crashes with that branch.

https://crash.limetech.org/n2k6apzzldol

Hmmm, would you be able go one by one in here https://github.com/GAMMACASE/MomSurfFix/blob/storetoadressfast_fix/addons/sourcemod/scripting/momsurffix/gametrace.sp#L223-L235 and change StoreToAddressCustom to StoreToAddress (You might get tag mismatch warning, you can safely ignore them) and see when it stops crashing? These crashes just don't make any sense to me rn lol.

Any update here?

Sorry have been away and very busy (new job), but I will get to this soon!

Or actually, I think I have a clue, change these two https://github.com/GAMMACASE/MomSurfFix/blob/storetoadressfast_fix/addons/sourcemod/scripting/momsurffix/gametrace.sp#L229 and https://github.com/GAMMACASE/MomSurfFix/blob/storetoadressfast_fix/addons/sourcemod/scripting/momsurffix/gametrace.sp#L235 to StoreToAddress and see if it stops these crashes.

that fixed the problem for me. haven't crashed since.

Alright good to hear, then that could be the cause, as it tries to write 4 byte value to 1 byte and thus causing it to corrupt some other memory that's beyond its structure as these two are the last members in the structure. That also explains absolutely random crash reports.

And yeah, now I remember why I haven't put StoreToAddressCustom in there, cuz that was the reason. Should've left a comment in there...