GL renderer crashes in a map with mirror+portal+skybox

Moderator: GZDoom Developers

Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.

If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

Please make a new topic for every bug. Don't combine multiple bugs into a single topic. Thanks!

GL renderer crashes in a map with mirror+portal+skybox

Postby ZZYZX » Sat Dec 15, 2018 9:24 pm

Stack trace is against Git revision c92e6b03ac461ac16c13412ae414332145e60081.
The "725f3332()" is apparently virtual delete in HWPortal.
Code: Select allExpand view
    725f3332()   Unknown
    [Frames below may be incorrect and/or missing]   
>   gzdoom.exe!FPortalSceneState::EndFrame(HWDrawInfo * di, FRenderState & state) Line 101   C++
    gzdoom.exe!OpenGLRenderer::FGLRenderer::DrawScene(HWDrawInfo * di, int drawmode) Line 141   C++
    [External Code]   
    gzdoom.exe!HWDrawInfo::ProcessScene(bool toscreen, const std::function<void __cdecl(HWDrawInfo *,int)> & drawScene) Line 655   C++
    gzdoom.exe!OpenGLRenderer::FGLRenderer::RenderViewpoint(FRenderViewpoint & mainvp, AActor * camera, IntRect * bounds, float fov, float ratio, float fovratio, bool mainview, bool toscreen) Line 190   C++
    gzdoom.exe!OpenGLRenderer::FGLRenderer::RenderView(player_t * player) Line 276   C++
    gzdoom.exe!D_Display() Line 758   C++
    gzdoom.exe!D_DoomLoop() Line 1008   C++
    gzdoom.exe!D_DoomMain() Line 2681   C++
    gzdoom.exe!DoMain(HINSTANCE__ * hInstance) Line 1077   C++
    gzdoom.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * nothing, char * cmdline, int nCmdShow) Line 1349   C++
    [External Code]   


Steps to reproduce:
1. Make sure you have vid_rendermode=4
2. Use the map attached (IWAD=doom2.wad). The reflective floors are 1.0 reflective on purpose — makes it easier to spot the issue.
3. Position yourself at roughly (-3289, 488, 32)
4. Make sure you see this: https://i.imgur.com/2K8e5sI.png (this is on it's own a problem, but not related and not visible in production map so w/e)
5. Move around for a bit, turn camera around. It will crash at some point



You can try the attached demo. For me it crashes reliably (and differently every time!)
Attachments
crashdemo.zip
(3.71 KiB) Downloaded 1 time
portals.CRASH.zip
(185.21 KiB) Downloaded 2 times
User avatar
ZZYZX
le chat du rabbin
 
 
 
Joined: 14 Oct 2012
Location: Ukraine

Re: GL renderer crashes in a map with mirror+portal+skybox

Postby Graf Zahl » Sun Dec 16, 2018 2:34 am

Hm. You seem to have found the one situation here where the multithreading in the renderer appears to get into synchronization problems. Both the main thread and the worker can modify the scene's portal state and occasionally stomp onto each other's data, and that's the random crash here.

When I switch off the multithreading the crash disappears, but not the glitch. It does look a bit different, though.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: GL renderer crashes in a map with mirror+portal+skybox

Postby Graf Zahl » Sun Dec 16, 2018 2:57 am

Fixed the crash, but to analyze the glitch this map is too complex. Can you try reducing detail a bit while retaining the glitch? With this many linedefs in the game it is very hard to find out which one causes the renderer to think that it cannot see all parts of the portal.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: GL renderer crashes in a map with mirror+portal+skybox

Postby ZZYZX » Sun Dec 16, 2018 10:56 am

Linedefs 1533, 1535, 1538, 1541 (relatively to portals.CRASH.wad)
Highlighted with yellow, if I remove these sectors it stops blocking
Image

Also, partially related: GZDoom ate ~48px of upper portal sector in the reflection: https://i.imgur.com/7JY08hP.png
Might be related to the fact that portal plane's Z is -56px.
User avatar
ZZYZX
le chat du rabbin
 
 
 
Joined: 14 Oct 2012
Location: Ukraine


Return to OpenGL Renderer Bugs

Who is online

Users browsing this forum: No registered users and 1 guest