Raised This Month: $51 Target: $400
 12% 

Upgrading to OB and MMS 1.8.3 causing Linux only crash on FireEvent


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 09-09-2010 , 15:22   Upgrading to OB and MMS 1.8.3 causing Linux only crash on FireEvent
Reply With Quote #1

Howdy,

I was just starting to smile today when everything seemed to be getting to where it should be and no sooner had I fired up the linux binary as soon as a client/bot connects it crashes on a pre call to IGameEventsManager2::FireEvent.

The stack is wildly corrupt and I can't figure out how as this function is a well known function and not a vfunc or sig so I'm stumped - did CS:S OB change the structure of their IGameEventsManager2 since releasing the OB SDK? Windows will run for hours without crashing - stack track here: http://pastebin.com/hJ550xWy

I'm halfway through implementing a FIFO buffer for the events as I was told of a mishap lately where two events cannot fire in the same GameFrame or the crash happens, is this correct or have I got something very very wrong?

(Windows works fine so I am indeed using the correct directory structure.)

Thanks,

J
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 09-09-2010 , 18:59   Re: Upgrading to OB and MMS 1.8.3 causing Linux only crash on FireEvent
Reply With Quote #2

I figured it out myself looking over the latest CSSDM snapshot, fair play BAIL always one step ahead ;)

I'm not entirely sure of exactly why but for some reason or another CSSDM uses some definitions to create a new class for each event usually passed to AddListener, if it works it works

If someone would be so kind as shed some light on the subject I'd be very happy!
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
BAILOPAN
Join Date: Jan 2004
Old 09-10-2010 , 04:03   Re: Upgrading to OB and MMS 1.8.3 causing Linux only crash on FireEvent
Reply With Quote #3

CS:S DM uses separate classes for encapsulation. DISCLAIMER: I made that up, I completely forget that code.

Without the code it's hard to tell you anything. I have to imagine multiple event fires per frame is fine.
__________________
egg
BAILOPAN is offline
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 09-10-2010 , 08:08   Re: Upgrading to OB and MMS 1.8.3 causing Linux only crash on FireEvent
Reply With Quote #4

It always was sure of the same before but it was mentioned to me when I mentioned about it in irc that another plugin had a similar problem and when I looked CS:S DM had something of a workaround implemented. Maybe my crashes had something to do with the hook being called on the same listen class as the hook was being called from?

I hate debugging linux - time to install a VM me thinks!
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 09-11-2010 , 22:37   Re: Upgrading to OB and MMS 1.8.3 causing Linux only crash on FireEvent
Reply With Quote #5

This is really starting to get on my nerves now... For testing purposes I'm only listening to one event in my main class due to the info in my previous comments just to be sure to be sure. Now my stack trace is cleaner but it's still throwing a big phat error in the pre hook and no log is being created so I'm not sure what's happening exactly.

This is only happening on linux and not windows o.O

PHP Code:
SH_DECL_HOOK2IGameEventManager2FireEventSH_NOATTRIB0boolIGameEvent *, bool );

/* ... */

bool Load(...)
{
    
SH_ADD_HOOK(IGameEventManager2FireEventm_GameEventManagerSH_MEMBER( &g_ZombiePlugin, &ZombiePlugin::FireEvent ), false );
}

/* ... */

bool ZombiePlugin::FireEventIGameEvent *eventbool bDontBroadcast )
{    
    if ( 
event && event->GetName() && zombie_teams.GetBool() && FStrEqevent->GetName(), "player_team" ) )
    {
        
int newTeam event->GetInt"team" );
        
bool bDisconnecting event->GetBool"disconnect" );
        
META_LOGg_PLAPI"Team: [%i] Disconnect: [%s]"newTeam, ( bDisconnecting "Yes" "No" )  );
        if ( !
bDisconnecting && ( newTeam == COUNTERTERRORISTS || newTeam == TERRORISTS ) )
        {
            
RETURN_META_VALUEMRES_SUPERCEDEtrue );
        }
    }
    
    
RETURN_META_VALUEMRES_IGNOREDtrue );
}


/* ... */


bool Unload (...)
{
    
SH_REMOVE_HOOK(IGameEventManager2FireEventm_GameEventManagerSH_MEMBER( &g_ZombiePlugin, &ZombiePlugin::FireEvent ), false );

The stack trace shows it calling my function and then entering the unknown without any reference, any help or guidance at all would be very appreciated as I'm going out of my mind at this stage!

Code:
#0  0x0889abec in ?? ()
#1  0x0338975c in ZombiePlugin::FireEvent (this=0x341b8a0, event=0xa68f550,
    bDontBroadcast=false) at ZombiePlugin.cpp:421
#2  0x033b2908 in fastdelegate::FastDelegate2<IGameEvent*, bool, bool>::operator() (this=0x868a7f4, p1=0xa68f550, p2=false)
    at /cygdrive/c/code/c/mmsource-1-8-9c2b1e877e16/core/sourcehook/FastDelegate.h:1079
#3  0x033b286f in __SourceHook_FHCls_IGameEventManager2FireEvent0::CMyDelegateImpl::Call (this=0x868a7f0, p1=0xa68f550, p2=false) at meta_hooks.h:29
#4  0x035d7e54 in __SourceHook_FHCls_IGameEventManager2FireEvent0::Func(IGameEvent*, bool) ()
   from /WazzGame/27015/orangebox/cstrike/addons/sourcemod/bin/sourcemod.2.ep2v.so
#5  0x0111ae95 in CGameClient::Connect(char const*, int, INetChannel*, bool) ()
   from /WazzGame/27015/orangebox/bin/engine.so
#6  0x01027b50 in CBaseServer::CreateFakeClient(char const*) ()
   from /WazzGame/27015/orangebox/bin/engine.so
#7  0x0115f9cf in CVEngineServer::CreateFakeClient(char const*) ()
   from /WazzGame/27015/orangebox/bin/engine.so
#8  0x027552de in CCSBot* CreateBot<CCSBot>(BotProfile const*, int) ()
   from /WazzGame/27015/orangebox/cstrike/bin/server.so
#9  0x0274d569 in CCSBotManager::BotAddCommand(int, bool, char const*, CSWeaponType, BotDifficultyType) () from /WazzGame/27015/orangebox/cstrike/bin/server.so
#10 0x0275075c in CCSBotManager::MaintainBotQuota() ()
   from /WazzGame/27015/orangebox/cstrike/bin/server.so
#11 0x02750cc9 in CCSBotManager::StartFrame() ()
   from /WazzGame/27015/orangebox/cstrike/bin/server.so
#12 0x0242c00c in CCSGameRules::EndGameFrame() ()
   from /WazzGame/27015/orangebox/cstrike/bin/server.so
#13 0x0285c8e2 in CServerGameDLL::GameFrame(bool) ()
   from /WazzGame/27015/orangebox/cstrike/bin/server.so
#14 0x0357b90f in __SourceHook_FHCls_IServerGameDLLGameFramefalse::Func(bool)
    ()
   from /WazzGame/27015/orangebox/cstrike/addons/sourcemod/bin/sourcemod.2.ep2v.so
#15 0x01141c59 in CServerPlugin::GameFrame(bool) ()
   from /WazzGame/27015/orangebox/bin/engine.so
#16 0x01131976 in SV_Think(bool) ()
   from /WazzGame/27015/orangebox/bin/engine.so
#17 0x0113362a in SV_Frame(bool) ()
   from /WazzGame/27015/orangebox/bin/engine.so
#18 0x0109bf8a in _Host_RunFrame_Server(bool) ()
   from /WazzGame/27015/orangebox/bin/engine.so
#19 0x0109cc90 in _Host_RunFrame(float) ()
   from /WazzGame/27015/orangebox/bin/engine.so
#20 0x010a588c in CHostState::State_Run(float) ()
   from /WazzGame/27015/orangebox/bin/engine.so
#21 0x010a6337 in CHostState::FrameUpdate(float) ()
   from /WazzGame/27015/orangebox/bin/engine.so
#22 0x010a648d in HostState_Frame(float) ()
   from /WazzGame/27015/orangebox/bin/engine.so
#23 0x01157956 in CEngine::Frame() ()
   from /WazzGame/27015/orangebox/bin/engine.so
#24 0x0115454b in CDedicatedServerAPI::RunFrame() ()
   from /WazzGame/27015/orangebox/bin/engine.so
#25 0x00b75e20 in RunServer() () from ./bin/dedicated.so
#26 0x00b75bb9 in CDedicatedExports::RunServer() () from ./bin/dedicated.so
#27 0x01154ffb in CModAppSystemGroup::Main() ()
   from /WazzGame/27015/orangebox/bin/engine.so
#28 0x0116d9e5 in CAppSystemGroup::Run() ()
   from /WazzGame/27015/orangebox/bin/engine.so
#29 0x01155389 in CDedicatedServerAPI::ModInit(ModInfo_t&) ()
   from /WazzGame/27015/orangebox/bin/engine.so
#30 0x00b760ce in CDedicatedAppSystemGroup::Main() () from ./bin/dedicated.so
#31 0x00b79675 in CAppSystemGroup::Run() () from ./bin/dedicated.so
#32 0x00b7b0b7 in CSteamApplication::Main() () from ./bin/dedicated.so
#33 0x00b79675 in CAppSystemGroup::Run() () from ./bin/dedicated.so
#34 0x00b76449 in main () from ./bin/dedicated.so
#35 0x00b773ae in DedicatedMain () from ./bin/dedicated.so
I'm just about ready to allow the changeteam log go ahead or write a hack at this stage.
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 09-13-2010 , 14:38   Re: Upgrading to OB and MMS 1.8.3 causing Linux only crash on FireEvent
Reply With Quote #6

In my long absence I seem to have forgotten the trials and tribulations of SourceMM plugins and how 99 times out of 100 the problem is rarely where you think it is due to the nature of what the plugins need to do to work, it's good to be back =)
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 09-13-2010 , 15:09   Re: Upgrading to OB and MMS 1.8.3 causing Linux only crash on FireEvent
Reply With Quote #7

Actually, there is one question I have that isn't just me throwing random crap at the forums in frustration :p

Would hooking OnTakeDamage while also implementing your cssdm patch make it screwy? I'm certain the issue is being caused by my 'borrowing' of the patch - but I haven't figured out why only the linux patch is screwy yet.

My gut feeling is no as there's gotta be plugins hooking it with cssdm loaded too
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
wazzgod
Member
Join Date: Oct 2005
Location: Home
Old 09-14-2010 , 10:41   Re: Upgrading to OB and MMS 1.8.3 causing Linux only crash on FireEvent
Reply With Quote #8

I can help you pull out your hair

Ya some days are just plain crap.
While others we fly though
__________________
People Who Think They Know Everything
Are Very Irritating To Those Of Us Who Do.
wazzgod is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 09-15-2010 , 19:14   Re: Upgrading to OB and MMS 1.8.3 causing Linux only crash on FireEvent
Reply With Quote #9

Hello,

out of interest: which line is
Code:
#1  0x0338975c in ZombiePlugin::FireEvent (this=0x341b8a0, event=0xa68f550,
    bDontBroadcast=false) at ZombiePlugin.cpp:421
?
__________________
hello, i am pm
PM is offline
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 09-16-2010 , 14:26   Re: Upgrading to OB and MMS 1.8.3 causing Linux only crash on FireEvent
Reply With Quote #10

Long time no see PM, keeping up the good work as always I see =)

const char *sName = pEvent->GetName();

Just before that I check if (pEvent) and the error goes away without the ffa patch >.<

Edit: It doesn't look exactly as above as I tried to weed out the problem, the line crashing is the line I've quoted here though.
__________________

Last edited by c0ldfyr3; 09-16-2010 at 14:56.
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
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 22:13.


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