-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detours-related crashes #22
Comments
That crash is interesting. It tries to execute the detour trampoline on the heap, but that part of the heap isn't executable. It should be though, so maybe it's some flaw with setting the memory permission flags on Centos. DHooks2/DynamicHooks/utilities.cpp Lines 52 to 60 in a323ffc
The first thing to try is using the SourceHook does |
Interesting. Here's a few more dumps with different IDs and different fault addresses while I was experimenting with enabling/disabling different combos of detours. I'm guessing it's the same underlying issue? VHIS-MTG5-OIN2 The extra weird thing is the systems that work fine have not (to my knowledge) been configured differently from those that do not. Just applying the provider's Centos image (same provider for all hosts), install required libraries for SRCDS, and then deploy the server instance. |
Do you have ssh access to the Centos instance? What does |
Yes, I have full control.
(both for working and non-working instances) |
I've added a fail check to the mprotect call. Can you try this build and monitor the server console during boot? It's compiled against SM1.10. |
Sure thing, I will do that after I finish work. |
After looking at the logic again, there is no good reason to use the heap at all in this code. It's left over from the original DynamicHooks library, but since we use SourcePawn's allocator for all other code chunks already, we can use it for the trampoline as well. This should avoid your issue all together. Please have a try with this version, it contains the previous mprotect+perror check as well. |
It might still be interesting to see if the first build prints any errors of mprotect failing on heap addresses, so would be great if you could test both builds even though I'm pretty sure the last one fixes the issue. |
🔔 🔔 🔔 WE HAVE A WINNER
followed by the expected crash on player connect. Second plugin -
I would previously see the primary detour get called. Post detours were never getting called and I would see one, maybe two before the crash occurred. With the fixed version, the Post detour is firing correctly and I had a few pages of log lines entering/exiting the function go by without any issues. I'll leave it running with some bots for a bit to see if anything else crops up. Thanks for getting this turned around so quickly! |
Great! 🎉 |
We no longer have the "working" VPS to verify if it was indeed allowed or disabled there though. That's probably it. Very strange that by default it would be enabled on one VPS deploy and not another from the same provider though. Ah well shrug |
Not sure if this is related to #11 but I too am seeing segfaults both on Centos 7 and 8 relating to Detours. Some systems will do it consistently, others (with the same set of srcds server files copied via rsync -a) will have no issues whatsoever.
This is on TF2Classic (SDK2013) with the TF2C.smx plugin. (Additional discussion here: Scags/TF2Classic-Tools#6 )
Disabling all DHookEnableDetour calls in the plugin stops the crashes from happening, and changing which ones I leave enabled or comment out changes the crash address consistently.
There's a linked crash ID there and I can provide more if they would be helpful.
Any thoughts? Observed with SM1.10 and 11, 2.2.0 detours 14a thru 16.
The text was updated successfully, but these errors were encountered: