ValveSoftware / Source-1-Games

Source 1 based games such as TF2 and Counter-Strike: Source
635 stars 74 forks source link

[L4D2] CMoveableCamera::FollowTarget crash #3388

Closed accelerator74 closed 2 years ago

accelerator74 commented 3 years ago

Another very old crash.

Stack trace

server_srv.so!CMoveableCamera::FollowTarget() + 0x3b server_srv.so!CBaseEntity::PhysicsDispatchThink(void (CBaseEntity::)()) + 0xae server_srv.so!CBaseEntity::PhysicsRunSpecificThink(int, void (CBaseEntity::)()) + 0xb9 server_srv.so!CBaseEntity::PhysicsRunThink(CBaseEntity::thinkmethods_t) + 0x42 server_srv.so!CBaseEntity::PhysicsNoclip() + 0xcd server_srv.so!CBaseEntity::PhysicsSimulate() + 0xa9c server_srv.so!Physics_SimulateEntity(CBaseEntity) + 0x15a server_srv.so!Physics_RunThinkFunctions(bool) + 0x2aa server_srv.so!CParallelProcessor<QueryCacheUpdateRecord_t, CFuncJobItemProcessor, 1>::Run(QueryCacheUpdateRecord_t, unsigned int, int, IThreadPool*) + 0x716 server_srv.so!CGlobalEntityList::CleanupDeleteList() + 0xc4 server_srv.so!Physics_RunThinkFunctions(bool) + 0x253 server_srv.so + 0x479780

Coredump: https://drive.google.com/file/d/1zKCzSeO2rvbqmwB1J8MTKlOHqIKtgWCR/view?usp=sharing Minidump: https://drive.google.com/file/d/1WGuMdGOR8MfJYx-LJ3PsZ9PMCQCQZo6U/view?usp=sharing

ProjectSky commented 3 years ago
server_srv.so!CMoveableCamera::FollowTarget() + 0x3b
server_srv.so!CBaseEntity::PhysicsDispatchThink(void (CBaseEntity::*)()) + 0xae
server_srv.so!CBaseEntity::PhysicsRunSpecificThink(int, void (CBaseEntity::*)()) + 0xb9
server_srv.so!CBaseEntity::PhysicsRunThink(CBaseEntity::thinkmethods_t) + 0x42
server_srv.so!CBaseEntity::PhysicsNoclip() + 0xcd
server_srv.so!CBaseEntity::PhysicsSimulate() + 0xa9c
server_srv.so!Physics_SimulateEntity(CBaseEntity*) + 0x15a
server_srv.so!Physics_RunThinkFunctions(bool) + 0x2aa
dragokas commented 3 years ago

Accelerator74, can you please explain, how correctly collect core and mini-dump (Linux) ?

Same crash happen to me: https://crash.limetech.org/sjm727nci6ej

accelerator74 commented 3 years ago

@dragokas coredump can be found in /var/lib/systemd/coredump minidump can download after logging into crash.limetech.org (Download Minidump).

ProjectSky commented 3 years ago

is there any solve? after update my server keep crashing, i no idea about this, i can't solve it

dragokas commented 3 years ago

If somebody still suffering from this crash, I've made a detour fixing that. Welcome to the thread: https://forums.alliedmods.net/showpost.php?p=2725811&postcount=19

ProjectSky commented 3 years ago

If somebody still suffering from this crash, I've made a detour fixing that. Welcome to the thread: https://forums.alliedmods.net/showpost.php?p=2725811&postcount=19

shqke commented 3 years ago

Can anyone confirm whether this fixes an issue? I've always had my own test case which I've used to "restart" some servers. Probability of which is quite low unless some custom plugins were involved (notably ones that messing with cameras).

#include <sourcemod>
#include <sdktools_functions>
#include <sdktools_entinput>

public void OnClientDisconnect(int client)
{
    if (!IsClientInGame(client)) {
        return;
    }

    int viewEntity = GetEntPropEnt(client, Prop_Send, "m_hViewEntity");
    if (!IsValidEdict(viewEntity)) {
        return;
    }

    char cls[64];
    GetEdictClassname(viewEntity, cls, sizeof(cls));
    if (strncmp(cls, "point_viewcontrol", 17) != 0) {
        return;
    }

    // Identify a CSurvivorCamera, CTriggerCamera
    if (strcmp(cls[17], "_survivor") == 0 || cls[17] == '\0') {
        // Disable entity to prevent CMoveableCamera::FollowTarget to cause a crash
        // m_hTargetEnt EHANDLE is not checked for existence and can be NULL
        // CBaseEntity::GetAbsAngles being called on causing a crash
        AcceptEntityInput(viewEntity, "Disable");
    }

    // Identify a CTriggerCameraMultiplayer
    if (strcmp(cls[17], "_multiplayer") == 0) {
        AcceptEntityInput(viewEntity, "RemovePlayer", client);
    }
}
dragokas commented 3 years ago

DHook fix is updated with Windows signatures. See: https://forums.alliedmods.net/showpost.php?p=2725811&postcount=19

A1mDev commented 3 years ago

if you don't use custom maps, just delete the plugin l4d_skip_intro.smx (https://forums.alliedmods.net/showthread.php?p=2686527). This plugin creates a random crash on the server. if you still need to remove intro scenes use this, but it doesn't work on all custom maps (you need to add this to the stripper): ; ===================================================== ; ================= INTRO REMOVAL =================== ; ===================================================== filter: { "targetname" "relay_intro_setup" } modify: { match: { "targetname" "relay_intro_start" } insert: { "OnTrigger" "camera_introDisable0-1" "OnTrigger" "relay_intro_finishedTrigger1-1" } }

A1mDev commented 3 years ago

Plugin from @shqke does not fix this crash. Some collection reports, and the code that made those reports. Maybe someone needs it. Code: (https://pastebin.com/wLetQ5MC), logs: (https://pastebin.com/aP6m01qu).