Has anyone had this problem? Every once in a while executing one of my plugin's concommands causes this to happen:
Code:
pure virtual method called
terminate called without an active exception
Program received signal SIGABRT, Aborted.
[Switching to Thread -1218523008 (LWP 9561)]
0x005a1cef in raise () from /lib/tls/libc.so.6
(gdb) bt
#0 0x005a1cef in raise () from /lib/tls/libc.so.6
#1 0x005a34f5 in abort () from /lib/tls/libc.so.6
#2 0x0804b392 in __gnu_cxx::__verbose_terminate_handler ()
at ../../.././libstdc++-v3/libsupc++/vterminate.cc:96
#3 0x00180a35 in __cxxabiv1::__terminate (
handler=0x804b350 <__gnu_cxx::__verbose_terminate_handler()>)
at ../../.././libstdc++-v3/libsupc++/eh_terminate.cc:43
#4 0x00180a72 in std::terminate ()
at ../../.././libstdc++-v3/libsupc++/eh_terminate.cc:53
#5 0x001c39c6 in __cxa_pure_virtual ()
at ../../.././libstdc++-v3/libsupc++/pure.cc:50
#6 0x0108aba7 in Cmd_ExecuteString ()
from ./bin/engine_i686.so
#7 0x0108ae04 in Cbuf_Execute () from ./bin/engine_i686.so
#8 0x010c90de in _Host_RunFrame ()
from ./bin/engine_i686.so
#9 0x010c983d in Host_RunFrame ()
from ./bin/engine_i686.so
#10 0x010d1cfc in CHostState::State_Run ()
from ./bin/engine_i686.so
#11 0x010d1f90 in CHostState::FrameUpdate ()
from ./bin/engine_i686.so
#12 0x010d20d7 in HostState_Frame ()
---Type <return> to continue, or q <return> to quit---
from ./bin/engine_i686.so
#13 0x01121bb8 in CEngine::Frame ()
from ./bin/engine_i686.so
#14 0x0112120e in CDedicatedServerAPI::RunFrame ()
from ./bin/engine_i686.so
#15 0x0013f692 in RunServer () from bin/dedicated_i686.so
#16 0x0013f915 in CDedicatedAppSystemGroup::Main () from bin/dedicated_i686.so
#17 0x0017c3a2 in CAppSystemGroup::Run () from bin/dedicated_i686.so
#18 0x0017c3a2 in CAppSystemGroup::Run () from bin/dedicated_i686.so
#19 0x0013fd0f in main () from bin/dedicated_i686.so
#20 0x0804903d in main ()
I can't really reproduce it all the time, and my commands work 99% of the time just fine. My plugin's a sourcemm plugin and it uses the CON_COMMAND_F() macro for declaring commands.
This is my cvars.h:
Code:
#ifndef _INCLUDE_CVARS_H
#define _INCLUDE_CVARS_H
#include <convar.h>
class AdminAccessor: public IConCommandBaseAccessor
{
public:
virtual bool RegisterConCommandBase(ConCommandBase *pVar);
};
extern AdminAccessor g_Accessor;
#endif //_INCLUDE_CVARS_H
And here's snippets from cvars.cpp:
Code:
#include "CServerPluginAdmin.h"
#include "cvars.h"
AdminAccessor g_Accessor;
bool AdminAccessor::RegisterConCommandBase(ConCommandBase *pVar)
{
return META_REGCVAR(pVar);
}
CON_COMMAND_F(admin_slay, "<name> - Slays specified player(s)", FCVAR_PLUGIN)
{
int argc = g_Engine->Cmd_Argc();
if (argc != 2)
{
META_CONPRINT("Usage: <name>\n");
return;
}
CUtlVector<edict_t *> matches;
g_AdminTools.findPlayers(&matches, g_Engine->Cmd_Argv(1), false);
int length = matches.Count();
if (length < 1)
{
META_CONPRINT("No matching players\n");
return;
}
META_CONPRINT("Affected:\n");
for (int i = 0; i < length; ++i)
{
edict_t *match = matches.Element(i);
if (g_AdminTools.slay(match))
META_CONPRINTF("%s\n", g_Engine->GetClientConVarValue(g_Engine->IndexOfEdict(match), "name"));
else
META_CONPRINTF("%s (failed)\n", g_Engine->GetClientConVarValue(g_Engine->IndexOfEdict(match), "name"));
}
}
And in CServerPluginAdmin.cpp:
Code:
bool CServerPluginAdmin::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late)
{
PLUGIN_SAVEVARS();
[IVEngineServer finding code]
ConCommandBaseMgr::OneTimeInit(&g_Accessor);
[other interfaces]
return true;
}
What am I doing wrong?