Raised This Month: $32 Target: $400
 8% 

DHooks (Dynamic Hooks - Dev Preview)


Post New Thread Reply   
 
Thread Tools Display Modes
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 05-23-2014 , 15:07   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #191

...and that would be because AddDependency only makes sure the other extension is loaded when it's called instead of what its documentation says it does.

The linked function is called directly by ShareSys::AddDependency in case you're wondering.

I guess the only way to actually track dependencies in an extension is to implement NotifyInterfaceDrop and make sure your dependencies don't suddenly get pulled out from under you.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 05-23-2014 , 22:45   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #192

Just a heads up: If you use DHooks, don't call DHookRemoveHookID in OnPluginEnd... SourceMod will auto-close those handles for you. If you do try to close them in OnPluginEnd, it can lead to server crashes when the server is shutting down.

Still looking into why SourceMod chokes on freeing DHooks handles if you manually unload the extension, though... (already think I fixed the SDKHooks unloading before DHooks crash on server shutdown)
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 05-23-2014 at 22:45.
Powerlord is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 06-05-2014 , 15:47   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #193

OK, so now that Drifter merged those changes into his repository, I've made one last change before I posted it here... I changed the version number to 1.0.14-alpha.

Source Code is here (except the version number change in smsdk_confg.h)

Changes
  • Fix memory leak where Listener objects were never deleted.
  • Extension will now properly stop when one of its dependencies are unloaded (SDKTools or SDKHooks)
  • The extension will no longer cause the server to crash when it unloads if SDKHooks was unloaded first. This commonly caused the server to crash when the server was shutdown.
Things not fixed:
  • Manually unloading the extension will cause the server to crash. This is a bug in SourceMod's Handle system that is fixed in the SourceMod development versions (1.6.0).
Attached Files
File Type: zip dhooks-1.0.14-alpha.zip (1.72 MB, 402 views)
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 06-05-2014 at 15:49.
Powerlord is offline
Morten
New Member
Join Date: Jun 2014
Old 06-19-2014 , 06:46   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #194

Are there any examples of using the raw hook type in Dhooks? I'm trying to hook several functions in the CCSBOT class. I can find the offset and even signatures of the functions, but I'm not sure how to find the base address of the ccsbot class.

For instance:
Code:
new Address:addr = GameConfGetAddress(temp, "CSSBOT"); <- how do i find this? 
new offset = GameConfGetOffset(temp, "OnUpdate"); 
hUpdate = DHookCreate(offset, HookType_Raw, ReturnType_Void, ThisPointer_Ignore, OnUpdate); 
DHookRaw(hUpdate, true, addr, RemovalCB);
Any help would be appreciated :-)

Best regards
Morten
Morten is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 06-19-2014 , 09:48   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #195

DHooks 1.0.13 (or 1.0.14 as I changed its version to) is crashing Team Fortress 2 on startup since yesterday's update. I haven't compiled a debug copy to find out what's going on with it yet. More information when I have it.

Edit: Ladies and Gentlemen, we have a Heisenbug. It doesn't crash when I recompile it for Debug.

Edit 2: Apparently my copy on my server somehow got corrupted despite working just fine yesterday.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 06-19-2014 at 10:32.
Powerlord is offline
AeroAcrobat
AlliedModders Donor
Join Date: Apr 2011
Location: lives in a circus
Old 07-04-2014 , 17:55   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #196

is it save to use 1.0.14-alpha and upgrade to sm stable 1.6?
Was reading this: https://forums.alliedmods.net/showpo...7&postcount=10
__________________
AeroAcrobat is offline
KyleS
SourceMod Plugin Approver
Join Date: Jul 2009
Location: Segmentation Fault.
Old 07-04-2014 , 18:41   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #197

Quote:
Originally Posted by AeroAcrobat View Post
is it save to use 1.0.14-alpha and upgrade to sm stable 1.6?
Was reading this: https://forums.alliedmods.net/showpo...7&postcount=10
There's a new version that is less tested but was rewritten from scratch. Most of the memory leaks and related issues should be solved.

https://bitbucket.org/Drifter321/dhooks2/overview

As to Powerlord's issue, it's most likely related to the software he's running. There are snapshot builds ~somewhere~.


EDIT: I've been running DHooks1 throughout the development of 1.6 and I'm totally fine (besides the known issues).

Last edited by KyleS; 07-04-2014 at 18:43.
KyleS is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-04-2014 , 20:30   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #198

Quote:
Originally Posted by KyleS View Post
As to Powerlord's issue, it's most likely related to the software he's running. There are snapshot builds ~somewhere~.
And yet, DHooks does have something to do with it as removing DHooks 1.0.14 makes my server stop crashing on shutdown. Having said that, using a debug version of dhooks doesn't give me any additional information as it doesn't appear in the backtrace.

Last I checked, there weren't any compiled versions of dhooks2 around anywhere.

Anyway, there may be issues compiling dhooks2 right now as apparently the include paths are currently missing an include (the AMTL includes?) and am-vector.h is required by sourcemod/public/jit/x86/macro-assembler-x86.h, which in turn is required by extension.cpp

Edit: And other fun Makefile bugs for the Linux version.

*sigh* the dhooks2 repo doesn't have an issue tracker, only the dhooks repo does.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 07-04-2014 at 20:56.
Powerlord is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-05-2014 , 10:29   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #199

Incidentally, even after updating DHooks to 2.0 and fixing the Linux compilation issues it had (and submitting a pull request with said fixes), and compiling it using clang instead of gcc, my server still crashes on shutdown in metamod if DHooks is loaded.

I may go into core.cfg and see if I can get a real stack trace by disabling some of the new 1.6 options.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 07-05-2014 at 10:44.
Powerlord is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-08-2014 , 12:23   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #200

Quote:
Originally Posted by KyleS View Post
There's a new version that is less tested but was rewritten from scratch. Most of the memory leaks and related issues should be solved.

https://bitbucket.org/Drifter321/dhooks2/overview

As to Powerlord's issue, it's most likely related to the software he's running. There are snapshot builds ~somewhere~.


EDIT: I've been running DHooks1 throughout the development of 1.6 and I'm totally fine (besides the known issues).
In that case, can you do me a favor and compile DHooks on Linux for me? Snapshot builds don't seem to exist anywhere... at least not ones that won't already crash on shutdown because SDKHooks tends to unload before DHooks does and then DHooks tries to use an SDKHooks pointer as it shuts down.

Having said that, the only plugins I've tried are ones that use GameRules hooks... PropHunt Redux and Respawn Wave Time Fix. If either are present, MetaMod crashes during shutdown. Perhaps it only happens with DHooks GameRules hooks?
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 07-08-2014 at 12:38.
Powerlord is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:11.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode