Raised This Month: $ Target: $400
 0% 

Plugin "crashing" the server when unloading


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Chrisber
AlliedModders Donor
Join Date: Jul 2007
Location: localhost
Old 06-27-2010 , 00:10   Plugin "crashing" the server when unloading
Reply With Quote #1

Hi.
Currently I've a problem when unloading as an VSP plugin (MM:S works perfectly).
This happens both times, unloading via plugin_unload or just quitting the server.

Scenario #1: quitting the server
Code:
quit
# nothing happens for 5 seconds
<error messagebox>
Scenario #2: plugin_unload
Code:
plugin_unload 0
# nothing happens now, seems to work fine
# typing anything to console and pressing enter
# wait 5 seconds
<error messagebox>
Does anybody know why this happens? I can't believe that my plugin causes this because the MM:S binary works fine.
For debugging, I've put a message in the Unload()-function. It is printed out.

Thanks for any help!
Chrisber is offline
BAILOPAN
Join Date: Jan 2004
Old 06-27-2010 , 02:08   Re: Plugin "crashing" the server when unloading
Reply With Quote #2

AFAIK vsps are not designed to be unloaded. Last time I used one (though that was 2005) the server didn't even close the library.
__________________
egg
BAILOPAN is offline
Keeper
Senior Member
Join Date: Nov 2006
Old 06-27-2010 , 07:36   Re: Plugin "crashing" the server when unloading
Reply With Quote #3

They can be unloaded, but for some reason it's not clean like MMS. I've never been able to do it either, but I've never really tried.

Have you tried to remove your CVARs before unloading? Look at the way MMS unloads and try to do some of the same things to see what happens.
Keeper is offline
Chrisber
AlliedModders Donor
Join Date: Jul 2007
Location: localhost
Old 06-27-2010 , 07:50   Re: Plugin "crashing" the server when unloading
Reply With Quote #4

Hi.
@ BAIL: On EP1 it worked without any problems, OB and higher doesn't seem to work.
@ Keeper: Tried. Also tried to completly remove the BaseAccessor for ConCommands and ConVars, didn't change anything.

Maybe I need to add "extra" code calls for SourceHook to say it that my plugin (and so ofcourse the instance of SH) will shut down?
But currently I've no hooks active in the VSP version.

Thanks!

Last edited by Chrisber; 06-27-2010 at 07:52.
Chrisber is offline
J3Di
New Member
Join Date: Apr 2008
Old 07-10-2010 , 18:51   Re: Plugin "crashing" the server when unloading
Reply With Quote #5

Sounds a bit like an interesting problem I've just come up against.

I hook ConCommand::Dispatch using SourceHook and when Unload() is called it appears to remove the hook successfully but it has actually crashed. A little while later you get the old message:
"File: .\workthreadpool.cpp
Line: 296
Assertion: Assertion Failed: CWorkThreadPool::StopWorkThreads: Some threads required forcible termination."

I've tested this from a basic shell plugin, just the VALVe plugin sample + SourceHook - Add Hook to ConCommand::Dispatch on Load() then use the console command "plugin_unload 0" to remove the plugin and it happens every time the ConCommand is hooked. Watching the ConCommand interface ptr in the debugger and that's fine.

I understand since the Orange Box update they call delete on your plugin's interface, which unless I hook a ConCommand's Dispatch method occurs cleanly but are VALVe forcibly ejecting your entire module or something and therefore SourceHook?
I haven't had a lot of time to look into this... :(

Never really had any problems unloading a VSP plugin before :|

-Oh you can remove the hook then at a later time unload the the plugin and it doesn't crash, but if you don't remove the hook (or remove the hook in the Unload() method) it crashes. wtf.


Update: My problem is because the module itself is now being unloaded. It appears some remnants of SourceHook remain active even if you remove all hooks in the Unload() method and then when the module is removed it can no longer access its data.

Last edited by J3Di; 07-10-2010 at 19:30.
J3Di 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 13:04.


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