Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PVS Crash (Overflow?) #3744

Closed
oninoni opened this issue Feb 6, 2019 · 4 comments
Closed

PVS Crash (Overflow?) #3744

oninoni opened this issue Feb 6, 2019 · 4 comments
Labels
Crash The issue is a "random" runtime crash.

Comments

@oninoni
Copy link

oninoni commented Feb 6, 2019

Details

I'm currently working on a "Camera" System using render.RenderView. For this to work i need to add PVS for the places where my cameras are. This seemed to work but when placed on a server with a lot of players it seemed to create crashes:

The end of the console log reads:

[16:31:00] area(1==50462976, 2==18) >= numareas (36):  Check if engine->ResetPVS() was called from ClientSetupVisibility
[16:31:00] Segmentation fault (core dumped)
[16:31:00] cat: hlds.8.pid: No such file or directory
[16:31:00] email debug.log to linux@valvesoftware.com
[16:31:00] Tue Feb  5 16:31:00 UTC 2019: Server Quit

Steps to reproduce

You can probably reproduce it by adding a lot of PVS to a server full of people. (Bots don't work because they don't seem to trigger PVS Calls)

hook.Add("SetupPlayerVisibility", "EGMRPHolocam.PVSVisibility", function(ply, viewEntity)
    local cameras = EGMRPHolocam:GetCamerasInRange(ply:GetPos())
    for _, cameraId in pairs(cameras) do
        local camera = ents.GetByIndex(cameraId)
        if IsValid(camera) then
            local pos = camera:GetPos()
            if not util.IsInWorld(pos) then continue end
            if ply:TestPVS(pos) then continue end

            AddOriginToPVS(pos)
        end
    end
end)

This was the code i used. In our full server enviroment (~80-90 Players) there were about 20 cameras max being returned for the "EGMRPHolocam:GetCamerasInRange" Function. It seemed to work for some time but random crashes did happen a few times until we removed the Addon.

PS: The mentioned debug.log does not contain anything useful. Just:

----------------------------------------------
Start Line: ./srcds_linux -game garrysmod <Rest Of Start Command>
End of Source crash report
----------------------------------------------
@robotboy655
Copy link
Contributor

This may not be fixable considering what you are doing and the error
area(1==50462976, 2==18) >= numareas (36): Check if engine->ResetPVS() was called from ClientSetupVisibility

In the mean time you can try map_noareas 1 but I do not know how that will affect server performance.
Also could just use less AddOriginToPVS calls.

@oninoni
Copy link
Author

oninoni commented Feb 7, 2019

Could you maybe expose more functions from the engine PVS Functionality so we are able to prevent this?

@robotboy655 robotboy655 added the Crash The issue is a "random" runtime crash. label Jun 14, 2019
@oninoni
Copy link
Author

oninoni commented Apr 14, 2021

I've just run into this problem again on a map i'm working on.
I'm using a lua integration for linked_portal_doors (Doors Addon) and it crashes, when i noclip outside the visleafes of the map.
I've added the above validation, to check if a PVS is already loaded. This fixes it, since when you are are outside the visleafs alls PVS Areas are loaded.
My current suspicion is, that TestPVS does not include manually added Areas. This might explain why the above code crashes, since it might have 2 cameras in the same area and the system does not seem to like having the same area added more than once.

@robotboy655
Copy link
Contributor

I think this was recently fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Crash The issue is a "random" runtime crash.
Projects
None yet
Development

No branches or pull requests

3 participants
@robotboy655 @oninoni and others