View Issue Details

IDProjectCategoryView StatusLast Update
0005012The Dark ModCodingpublic05.08.2021 15:17
ReporterVanishedOne Assigned Tocabalistic  
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
OSWindowsOS Version8.1 
Product VersionTDM 2.07 
Target VersionTDM 2.10Fixed in VersionTDM 2.10 
Summary0005012: Shader loaded from frontend crashes on AMD (Crash from heathaze GUI overlay)
DescriptionThe heathaze GUI overlay seen in the test map for 0004214 now causes a crash. This doesn't happen in 2.05. (According to SteveL's comments it looked glitched on his system owing to another bug, but it wasn't crashing TDM.)

"r_useglsl" "0" doesn't help.
Steps To ReproduceGet 0004214's test files, dive in the middle pool.
Additional Information  Problem Event Name: APPCRASH
  Application Name: TheDarkMod.exe
  Application Version: 2.0.7.0
  Application Timestamp: 5c4d5f60
  Fault Module Name: atioglxx.dll
  Fault Module Version: 21.19.384.0
  Fault Module Timestamp: 584442f3
  Exception Code: c0000005
  Exception Offset: 01a4715e
  OS Version: 6.3.9600.2.0.0.768.101
  Locale ID: 2057
  Additional Information 1: 5861
  Additional Information 2: 5861822e1919d7c014bbb064c64908b2
  Additional Information 3: fdca
  Additional Information 4: fdca1fbcc5199d38e99bdacef751acf6
TagsNo tags attached.

Relationships

related to 0005068 resolvedduzenko View shrinks while underwater 

Activities

stgatilov

stgatilov

02.01.2020 12:43

administrator   ~0012010

Cannot reproduce it on GeForce, both on 2.07-hotfix and SVN.
But I managed to reproduce it on RX 550 on 2.07-hotfix).

Here is unmangled stack trace:
> atio6axx.dll!00007fff4c3ec1c9() Unknown
     TheDarkModx64.exe!R_LoadARBProgram(int progIndex) Line 576 C++
     TheDarkModx64.exe!R_FindARBProgram(unsigned int target, const char * program) Line 643 C++
     TheDarkModx64.exe!idMaterial::ParseStage(idLexer & src, const textureRepeat_t trpDefault) Line 1516 C++
     TheDarkModx64.exe!idMaterial::ParseMaterial(idLexer & src) Line 2126 C++
     TheDarkModx64.exe!idMaterial::Parse(const char * text, const int textLength) Line 2212 C++
     TheDarkModx64.exe!idDeclLocal::ParseLocal() Line 2176 C++
     TheDarkModx64.exe!idDeclManagerLocal::FindType(declType_t type, const char * name, bool makeDefault) Line 1114 C++
     [Inline Frame] TheDarkModx64.exe!idWindow::SetupBackground() Line 1404 C++
     TheDarkModx64.exe!idWindow::SetupFromState() Line 1422 C++
     TheDarkModx64.exe!idWindow::Parse(idParser * src, bool rebuild) Line 2512 C++
     TheDarkModx64.exe!idUserInterfaceLocal::InitFromFile(const char * qpath, bool rebuild, bool cache) Line 290 C++
     TheDarkModx64.exe!idUserInterfaceManagerLocal::FindGui(const char * qpath, bool autoLoad, bool needUnique, bool forceNOTUnique) Line 189 C++
     [Inline Frame] TheDarkModx64.exe!newGui(const char *) Line 30 C++
     TheDarkModx64.exe!COverlaySys::setGui(int handle, const char * file) Line 321 C++
     TheDarkModx64.exe!idEntity::CreateOverlay(const char * guiFile, int layer) Line 12526 C++
     TheDarkModx64.exe!idPlayer::UpdateUnderWaterEffects() Line 7561 C++
     TheDarkModx64.exe!idPlayer::Think() Line 7805 C++
     TheDarkModx64.exe!idGameLocal::RunFrame(const usercmd_t * clientCmds) Line 3424 C++
     TheDarkModx64.exe!idSessionLocal::RunGameTic() Line 2954 C++
     [Inline Frame] TheDarkModx64.exe!idSessionLocal::RunGameTics() Line 3022 C++
     TheDarkModx64.exe!idSessionLocal::FrontendThreadFunction() Line 3068 C++
It crashes on calling qglBindProgramARB inside R_LoadARBProgram. The call arguments look valid to me. Except for the fact that TDM does not use glGenPrograms, and instead assigns program identifiers sequentally =)

The problem may be caused by the fact that shader is loaded in frontend thread. OpenGL is sensible to such things.
stgatilov

stgatilov

02.01.2020 12:51

administrator   ~0012011

Ok, I took some random brush and changed its material to "textures/water_source/water_overlay". As the result, the crash does NOT happen.

The explanation is simple: if some map brush uses the material, then it gets loaded on start, and such loading works OK. I guess loading materials which are used by statically spawned entities also works fine. The problem happens when some material is loaded during gameplay, and it is the first one to use some new shader program. As the result, the shader program gets loaded from wrong place, causing the crash. I wonder how it works with dynamically spawned entities (e.g. when you spawn water arrow on a clean map, which is the first to use heatHaze shader).
stgatilov

stgatilov

02.01.2020 13:01

administrator   ~0012012

Ok, I get the same crash simply by loading a small test map and executing:
       g_testPostProcess textures/postprocess/rotoedge
This results in loading rotoedge.vfp shader, which was not loaded during map load.
Here is the stack trace:
     atio6axx.dll!00007fff4c3ec1c9() Unknown
> TheDarkModx64.exe!R_LoadARBProgram(int progIndex) Line 576 C++
     TheDarkModx64.exe!R_FindARBProgram(unsigned int target, const char * program) Line 643 C++
     TheDarkModx64.exe!idMaterial::ParseStage(idLexer & src, const textureRepeat_t trpDefault) Line 1516 C++
     TheDarkModx64.exe!idMaterial::ParseMaterial(idLexer & src) Line 2126 C++
     TheDarkModx64.exe!idMaterial::Parse(const char * text, const int textLength) Line 2212 C++
     TheDarkModx64.exe!idDeclLocal::ParseLocal() Line 2176 C++
     TheDarkModx64.exe!idDeclManagerLocal::FindType(declType_t type, const char * name, bool makeDefault) Line 1114 C++
     TheDarkModx64.exe!idPlayerView::SingleView(idUserInterface * hud, const renderView_s * view, bool drawHUD) Line 620 C++
     TheDarkModx64.exe!idPlayerView::RenderPlayerView(idUserInterface * hud) Line 997 C++
     TheDarkModx64.exe!idGameLocal::Draw(int clientNum) Line 3672 C++
     TheDarkModx64.exe!idSessionLocal::Draw() Line 2559 C++
     [Inline Frame] TheDarkModx64.exe!idSessionLocal::DrawFrame() Line 3036 C++
     TheDarkModx64.exe!idSessionLocal::FrontendThreadFunction() Line 3071 C++
stgatilov

stgatilov

02.01.2020 13:18

administrator   ~0012013

Last edited: 02.01.2020 13:23

The problem does NOT happen on SVN, because ARB shaders are no longer used: everything has been migrated to GLSL. For this reason, this issue can be suspended for now, then reevaluated after 2.08 is out.

What I find alarming is that overlay in the middle water does not work properly in terms of window size. This is most likely caused by:
  https://bugs.thedarkmod.com/view.php?id=5068#c11976

duzenko

duzenko

02.01.2020 15:40

developer   ~0012023

What should happen here? This is how it looks to me:
https://ibb.co/wRCDr6D
stgatilov

stgatilov

02.01.2020 15:52

administrator   ~0012024

From above, it looks like crystal clear water. Dive into pools to see GUI overlays in action.

The left/right ones are working, but they don't use shader. The middle one uses a shader, and for me shader does not cover the whole screen on SVN.
VanishedOne

VanishedOne

02.01.2020 15:54

reporter   ~0012025

SteveL mentioned visual glitching with that overlay in his 16:9 monitor at https://bugs.thedarkmod.com/view.php?id=4214#c7821 and I think that's why he linked 0004084 to that bug. I don't know whether it's the same issue you're seeing since it was in the 2,03/2.04 era.
duzenko

duzenko

02.01.2020 16:33

developer   ~0012027

Last edited: 02.01.2020 16:35

It does crash to me with ARB2 shader. Not sure if it needs fixing too. Threads conflict. I suppose it might only crash on AMD though (thumbdown.png)
     atio6axx.dll!00007fff5040c1c9() Unknown
> TheDarkModx64NoTools.exe!R_LoadARBProgram(int progIndex) Line 124 C++
     TheDarkModx64NoTools.exe!R_FindARBProgram(unsigned int target, const char * program) Line 194 C++
     TheDarkModx64NoTools.exe!idMaterial::ParseStage(idLexer & src, const textureRepeat_t trpDefault) Line 1555 C++
     TheDarkModx64NoTools.exe!idMaterial::ParseMaterial(idLexer & src) Line 1850 C++
     TheDarkModx64NoTools.exe!idMaterial::Parse(const char * text, const int textLength) Line 2267 C++
     TheDarkModx64NoTools.exe!idDeclLocal::ParseLocal() Line 2182 C++
     TheDarkModx64NoTools.exe!idDeclManagerLocal::FindType(declType_t type, const char * name, bool makeDefault) Line 1120 C++
     TheDarkModx64NoTools.exe!idWindow::SetupBackground() Line 1405 C++
     TheDarkModx64NoTools.exe!idWindow::SetupFromState() Line 1424 C++
     TheDarkModx64NoTools.exe!idWindow::Parse(idParser * src, bool rebuild) Line 2512 C++
     TheDarkModx64NoTools.exe!idUserInterfaceLocal::InitFromFile(const char * qpath, bool rebuild, bool cache) Line 290 C++
     TheDarkModx64NoTools.exe!idUserInterfaceManagerLocal::FindGui(const char * qpath, bool autoLoad, bool needUnique, bool forceNOTUnique) Line 189 C++
     [Inline Frame] TheDarkModx64NoTools.exe!newGui(const char *) Line 30 C++
     TheDarkModx64NoTools.exe!COverlaySys::setGui(int handle, const char * file) Line 321 C++
     TheDarkModx64NoTools.exe!idEntity::CreateOverlay(const char * guiFile, int layer) Line 12334 C++
     TheDarkModx64NoTools.exe!idPlayer::UpdateUnderWaterEffects() Line 7390 C++
     TheDarkModx64NoTools.exe!idPlayer::Think() Line 7631 C++
     TheDarkModx64NoTools.exe!idGameLocal::RunFrame(const usercmd_t * clientCmds, int timestepMs) Line 3209 C++
     TheDarkModx64NoTools.exe!idSessionLocal::RunGameTic(int timestepMs) Line 3052 C++
     TheDarkModx64NoTools.exe!idSessionLocal::RunGameTics() Line 3127 C++
     TheDarkModx64NoTools.exe!idSessionLocal::FrontendThreadFunction() Line 3173 C++
     [Inline Frame] TheDarkModx64NoTools.exe!idSessionLocal::StartFrontendThread::__l2::<lambda_16de5467341aba11472bb29a736528b0>::operator()(void *) Line 3265 C++
     TheDarkModx64NoTools.exe!<lambda_16de5467341aba11472bb29a736528b0>::<lambda_invoker_cdecl>(void * x) Line 3267 C++
     [External Code]

duzenko

duzenko

02.01.2020 16:39

developer   ~0012028

Do we want to split these two very different bugs?
One is ARB2 shader load from the frontend thread
Another is the GUI shader broken visuals.
stgatilov

stgatilov

02.01.2020 17:03

administrator   ~0012029

I have suspended this issue, since SVN is already on GLSL completely, where the crash does not happen.
As for broken visual, I suggest fixing it in 0005068, where you broke it (since it happened very recently).
stgatilov

stgatilov

31.08.2020 04:19

administrator   ~0012768

Since C++ code for ARB shaders is being removed completely for 2.09, this is no longer a problem.
VanishedOne

VanishedOne

13.03.2021 16:56

reporter   ~0013785

I can still reproduce this on 2.09 (now using Linux, Intel/Nvidia).
duzenko

duzenko

13.03.2021 17:12

developer   ~0013786

Last edited: 13.03.2021 17:17

Does not crash for me on SVN
Although the gui does not work either
Are you actually testing this with that 2015 test map?

EDIT: NM, it did crash after TDM restart
@stgatilov, the underlying issue still persists
the AMD driver crashes on qglCreateProgram from the frontend thread
stgatilov

stgatilov

15.03.2021 15:39

administrator   ~0013790

Yes, it crashes on my RX 550 too, with same repro steps and call stack as in: https://bugs.thedarkmod.com/view.php?id=5012#c12012
duzenko

duzenko

16.03.2021 08:16

developer   ~0013795

Add a shader placeholder to be replaced on first access from the main thread?
cabalistic

cabalistic

01.08.2021 10:32

developer   ~0014225

Should be fixed with 9526.
duzenko

duzenko

01.08.2021 12:52

developer   ~0014227

The "wet" map does not crash for me on current SVN (AMD 6850)

Issue History

Date Modified Username Field Change
14.03.2019 17:23 VanishedOne New Issue
02.01.2020 12:43 stgatilov Note Added: 0012010
02.01.2020 12:51 stgatilov Note Added: 0012011
02.01.2020 13:01 stgatilov Note Added: 0012012
02.01.2020 13:18 stgatilov Note Added: 0012013
02.01.2020 13:23 stgatilov Relationship added related to 0005068
02.01.2020 13:23 stgatilov Note Edited: 0012013
02.01.2020 13:25 stgatilov Assigned To => stgatilov
02.01.2020 13:25 stgatilov Status new => suspended
02.01.2020 15:40 duzenko Note Added: 0012023
02.01.2020 15:52 stgatilov Note Added: 0012024
02.01.2020 15:54 VanishedOne Note Added: 0012025
02.01.2020 16:33 duzenko Note Added: 0012027
02.01.2020 16:35 duzenko Note Edited: 0012027
02.01.2020 16:39 duzenko Note Added: 0012028
02.01.2020 17:03 stgatilov Note Added: 0012029
31.08.2020 04:19 stgatilov Status suspended => closed
31.08.2020 04:19 stgatilov Resolution open => no change required
31.08.2020 04:19 stgatilov Note Added: 0012768
13.03.2021 16:56 VanishedOne Status closed => feedback
13.03.2021 16:56 VanishedOne Resolution no change required => reopened
13.03.2021 16:56 VanishedOne Note Added: 0013785
13.03.2021 17:12 duzenko Note Added: 0013786
13.03.2021 17:14 duzenko Note Edited: 0013786
13.03.2021 17:17 duzenko Note Edited: 0013786
13.03.2021 17:28 stgatilov Target Version => TDM 2.10
15.03.2021 15:39 stgatilov Note Added: 0013790
15.03.2021 15:41 stgatilov Status feedback => confirmed
15.03.2021 15:41 stgatilov Summary Crash from heathaze GUI overlay => Shader loaded from frontend crashes on AMD (Crash from heathaze GUI overlay)
16.03.2021 08:16 duzenko Note Added: 0013795
07.05.2021 07:29 stgatilov Assigned To stgatilov => cabalistic
01.08.2021 10:32 cabalistic Status confirmed => feedback
01.08.2021 10:32 cabalistic Note Added: 0014225
01.08.2021 12:52 duzenko Note Added: 0014227
01.08.2021 12:53 duzenko Status feedback => closed
01.08.2021 12:53 duzenko Fixed in Version => TDM 2.10
05.08.2021 15:17 duzenko Status closed => resolved
05.08.2021 15:17 duzenko Resolution reopened => fixed