Bots-United / jk_botti

Bot (Computer AI) for Half-Life 1 Deathmatch
http://forums.bots-united.com/forumdisplay.php?f=83
Other
43 stars 21 forks source link

Segfault when bots try to chat #2

Closed Des-Nerger closed 7 years ago

Des-Nerger commented 7 years ago

I get a segfault everytime bots try to chat. I'm running a 64-bit Linux and the Steam version of Half-Life.

Here's a backtrace:

#0  0x00000000 in ?? ()
#1  0xc197bff0 in UTIL_HostSay (pEntity=0xeef006a8, teamonly=0, 
    message=0xc19a3098 <bots+4824> "Did you get that new STEAM update today?") at util.cpp:720
#2  0xc195a69c in BotThink (pBot=...) at bot.cpp:2570
#3  0xc1977df2 in StartFrame () at dll.cpp:581
#4  0xf158c85a in mm_StartFrame () at dllapi.cpp:209
#5  0xf6887a18 in SV_Physics () at ../engine/sv_phys.c:1985
#6  0xf687f736 in SV_Frame () at ../engine/sv_main.c:9228
#7  0xf683fc86 in _Host_Frame (time=0.0167479198) at ../engine/host.c:1404
#8  0xf6840112 in Host_Frame (time=0.0167479198, iState=1, stateInfo=0xffffd46c) at ../engine/host.c:1522
#9  0xf686c624 in CEngine::Frame (this=0xf6a83a00 <g_Engine>) at ../engine/sys_engine.cpp:245
#10 0xf686a103 in RunListenServer (instance=0x0, 
    basedir=0x804b220 <szBaseDir> "/home/ixuta/.local/share/Steam/SteamApps/common/Half-Life", 
    cmdline=0x8053348 "/home/ixuta/.local/share/Steam/SteamApps/common/Half-Life/hl_linux", 
    postRestartCmdLineArgs=0x804d360 <main::szNewCommandParams> "", 
    launcherFactory=0x8049350 <CreateInterfaceLocal(char const*, int*)>, 
    filesystemFactory=0xf7ec6ad0 <CreateInterface(char const*, int*)>) at ../engine/sys_dll2.cpp:946
#11 0x08048d67 in main (argc=1, argv=0xffffd6a4) at ../launcher/launcher.cpp:439

Here's the lines where this occurs:

714       UTIL_LogPrintf( "\"%s<%i><%s><%s>\" %s \"%s\"\n", 
715          STRING( pEntity->v.netname ), 
716          GETPLAYERUSERID( pEntity ),
717          (*g_engfuncs.pfnGetPlayerAuthId)( pEntity ),
718          sender_teamstr,
719          teamonly ? "say_team" : "say",
720          message );

And here's the contents of g_engfuncs right before the segfault:

{pfnPrecacheModel = 0xedab22c0 <stub_PrecacheModel(char*)>, 
  pfnPrecacheSound = 0xedab22d0 <stub_PrecacheSound(char*)>, 
  pfnSetModel = 0xedab2300 <stub_SetModel(edict_s*, char const*)>, pfnModelIndex = 0x0, pfnModelFrames = 0x0, 
  pfnSetSize = 0x0, pfnChangeLevel = 0x0, pfnGetSpawnParms = 0x0, pfnSaveSpawnParms = 0x0, pfnVecToYaw = 0x0, 
  pfnVecToAngles = 0x0, pfnMoveToOrigin = 0x0, pfnChangeYaw = 0x0, pfnChangePitch = 0x0, 
  pfnFindEntityByString = 0x0, pfnGetEntityIllum = 0x0, pfnFindEntityInSphere = 0x0, pfnFindClientInPVS = 0x0, 
  pfnEntitiesInPVS = 0x0, pfnMakeVectors = 0x0, pfnAngleVectors = 0x0, pfnCreateEntity = 0x0, 
  pfnRemoveEntity = 0x0, pfnCreateNamedEntity = 0x0, pfnMakeStatic = 0x0, pfnEntIsOnFloor = 0x0, 
  pfnDropToFloor = 0x0, pfnWalkMove = 0x0, pfnSetOrigin = 0x0, pfnEmitSound = 0x0, pfnEmitAmbientSound = 0x0, 
  pfnTraceLine = 0x0, pfnTraceToss = 0x0, pfnTraceMonsterHull = 0x0, pfnTraceHull = 0x0, pfnTraceModel = 0x0, 
  pfnTraceTexture = 0x0, pfnTraceSphere = 0x0, pfnGetAimVector = 0x0, pfnServerCommand = 0x0, 
  pfnServerExecute = 0x0, pfnClientCommand = 0x0, pfnParticleEffect = 0x0, pfnLightStyle = 0x0, 
  pfnDecalIndex = 0x0, pfnPointContents = 0x0, pfnMessageBegin = 0x0, pfnMessageEnd = 0x0, pfnWriteByte = 0x0, 
  pfnWriteChar = 0x0, pfnWriteShort = 0x0, pfnWriteLong = 0x0, pfnWriteAngle = 0x0, pfnWriteCoord = 0x0, 
  pfnWriteString = 0x0, pfnWriteEntity = 0x0, pfnCVarRegister = 0x0, pfnCVarGetFloat = 0x0, 
  pfnCVarGetString = 0x0, pfnCVarSetFloat = 0x0, pfnCVarSetString = 0x0, pfnAlertMessage = 0xedaa5990
     <AlertMessage(ALERT_TYPE, char*, ...)>, pfnEngineFprintf = 0x0, pfnPvAllocEntPrivateData = 0x0, 
  pfnPvEntPrivateData = 0x0, pfnFreeEntPrivateData = 0x0, pfnSzFromIndex = 0x0, pfnAllocString = 0x0, 
  pfnGetVarsOfEnt = 0x0, pfnPEntityOfEntOffset = 0x0, pfnEntOffsetOfPEntity = 0x0, pfnIndexOfEdict = 0x0, 
  pfnPEntityOfEntIndex = 0x0, pfnFindEntityByVars = 0x0, pfnGetModelPtr = 0x0, pfnRegUserMsg = 0x0, 
  pfnAnimationAutomove = 0x0, pfnGetBonePosition = 0x0, pfnFunctionFromName = 0x0, 
  pfnNameForFunction = 0xedab22f0 <stub_NameForFunction(unsigned int)>, pfnClientPrintf = 0x0, 
  pfnServerPrint = 0x0, pfnCmd_Args = 0x0, pfnCmd_Argv = 0x0, pfnCmd_Argc = 0x0, pfnGetAttachment = 0x0, 
  pfnCRC32_Init = 0x0, pfnCRC32_ProcessBuffer = 0x0, pfnCRC32_ProcessByte = 0x0, pfnCRC32_Final = 0x0, 
  pfnRandomLong = 0xf68577d0 <RandomLong>, pfnRandomFloat = 0xf6857770 <RandomFloat>, pfnSetView = 0x0, 
  pfnTime = 0x0, pfnCrosshairAngle = 0x0, pfnLoadFileForMe = 0x0, pfnFreeFile = 0x0, pfnEndSection = 0x0, 
  pfnCompareFileTime = 0x0, pfnGetGameDir = 0x0, pfnCvar_RegisterVariable = 0x0, pfnFadeClientVolume = 0x0, 
  pfnSetClientMaxspeed = 0xedab2120 <HUD_SetMaxSpeed(edict_s const*, float)>, pfnCreateFakeClient = 0x0, 
  pfnRunPlayerMove = 0x0, pfnNumberOfEntities = 0x0, pfnGetInfoKeyBuffer = 0x0, pfnInfoKeyValue = 0x0, 
  pfnSetKeyValue = 0x0, pfnSetClientKeyValue = 0x0, pfnIsMapValid = 0x0, pfnStaticDecal = 0x0, 
  pfnPrecacheGeneric = 0x0, pfnGetPlayerUserId = 0x0, pfnBuildSoundMsg = 0x0, pfnIsDedicatedServer = 0x0, 
  pfnCVarGetPointer = 0x0, pfnGetPlayerWONId = 0x0, pfnInfo_RemoveKey = 0x0, pfnGetPhysicsKeyValue = 0x0, 
  pfnSetPhysicsKeyValue = 0x0, pfnGetPhysicsInfoString = 0x0, 
  pfnPrecacheEvent = 0xf68dd8a0 <hudPrecacheEvent>, 
  pfnPlaybackEvent = 0xedab2050 <HUD_PlaybackEvent(int, edict_s const*, unsigned short, float, float*, float*, float, float, int, int, int, int)>, pfnSetFatPVS = 0x0, pfnSetFatPAS = 0x0, pfnCheckVisibility = 0x0, 
  pfnDeltaSetField = 0x0, pfnDeltaUnsetField = 0x0, pfnDeltaAddEncoder = 0x0, pfnGetCurrentPlayer = 0x0, 
  pfnCanSkipPlayer = 0x0, pfnDeltaFindField = 0x0, pfnDeltaSetFieldByIndex = 0x0, 
  pfnDeltaUnsetFieldByIndex = 0x0, pfnSetGroupMask = 0x0, pfnCreateInstancedBaseline = 0x0, 
  pfnCvar_DirectSet = 0x0, pfnForceUnmodified = 0x0, pfnGetPlayerStats = 0x0, pfnAddServerCommand = 0x0, 
  pfnVoice_GetClientListening = 0x0, pfnVoice_SetClientListening = 0x0, pfnGetPlayerAuthId = 0x0, 
  pfnSequenceGet = 0x0, pfnSequencePickSentence = 0x0, pfnGetFileSize = 0x0, pfnGetApproxWavePlayLen = 0x0, 
  pfnIsCareerMatch = 0x0, pfnGetLocalizedStringLength = 0x0, pfnRegisterTutorMessageShown = 0x0, 
  pfnGetTimesTutorMessageShown = 0x0, ProcessTutorMessageDecayBuffer = 0x0, 
  ConstructTutorMessageDecayBuffer = 0x0, ResetTutorMessageDecayData = 0x0, pfnQueryClientCvarValue = 0x0, 
  pfnQueryClientCvarValue2 = 0x0, pfnCheckParm = 0x0}

What can be the source of the problem? I'm using metamod 1.20 and the last jk_botti, both are 32-bit and compiled by me

jkivilin commented 7 years ago

Have you tried with metamod 1.21.1-am? .. http://www.amxmodx.org/release/metamod-1.21.1-am.zip

Des-Nerger commented 7 years ago

Yeah, thanks. With alliedmodders's metamod version the issue is now gone.

Just in case it'd be helpful to smn else: I was able to build their metamod version from there: https://github.com/alliedmodders/metamod-hl1 using their sdk version: https://github.com/alliedmodders/hlsdk and running make linux32_opt