View Issue Details

IDProjectCategoryView StatusLast Update
0006351DarkRadiantModelspublic13.01.2024 06:41
Reporterorbweaver Assigned Toorbweaver  
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
PlatformLinuxOSUbuntu OS Version22.04
Product Version3.9.0 
Target Version3.9.0Fixed in Version3.9.0 
Summary0006351: Crash on activating lighting mode in the Model Chooser
DescriptionBy default the Model Chooser shows in fullbright preview mode. Attempting to activate the lighting mode causes an immediate crash with an OpenGL-related exception:

darkradiant: ./radiantcore/rendersystem/backend/glprogram/GLSLProgramBase.cpp:20: virtual void render::GLSLProgramBase::enable(): Assertion `glIsProgram(_programObj)' failed.
Steps To Reproduce1. Start a new project.
2. Right click and choose Create Model...
3. Activate the lighting mode button at the bottom of the preview widget.

The behaviour is the same regardless of whether a model is selected.
TagsNo tags attached.

Activities

orbweaver

orbweaver

08.12.2023 17:10

developer   ~0016232

Fixed in 9c5e880e6d010021e45cbe916aa19a873fdb80b1
greebo

greebo

13.01.2024 06:20

administrator   ~0016354

With two of the commits here (or maybe even just commit 98b70589), I'm getting GL errors problems now in Windows, when opening e.g. the "Create Entity" dialog. It appears the the GL widget used to preview the entities is immediately trying to create the GLSL programs, which fails (glCreateShader returns 0). I haven't seen the reason for this yet, but I've noticed that before these changes, the OpenGLRenderSystem attached to the preview widget has not created any GLSL programs on construction - now with these changes the render system immediately tries to create the programs and fails.
greebo

greebo

13.01.2024 06:27

administrator   ~0016355

Yes, it's just commit 98b70589 - this somehow affects the way the GLProgramFactory is realising its shaders

Related Changesets

DarkRadiant: master 98b70589

07.12.2023 14:39

orbweaver


Details Diff
0006351: remove RenderSystem::setShaderProgramsAvailable()

The availability of shader programs is determined internally by
OpenGLRenderSystem based on GL version/extensions; this method is never
called virtually from other modules.
Affected Issues
0006351
mod - include/irender.h Diff File
mod - radiantcore/rendersystem/OpenGLRenderSystem.cpp Diff File
mod - radiantcore/rendersystem/OpenGLRenderSystem.h Diff File

DarkRadiant: master 36a99d21

07.12.2023 14:51

orbweaver


Details Diff
0006351: reduce console message spam

Remove "Auto-saving registry to user settings path" which happens every
few seconds, and reduce GLSL program construction messages to a single
line unless there are any validation warnings to report.
Affected Issues
0006351
mod - radiantcore/rendersystem/backend/GLProgramFactory.cpp Diff File
mod - radiantcore/xmlregistry/XMLRegistry.cpp Diff File

DarkRadiant: master c1534a5f

08.12.2023 13:10

orbweaver


Details Diff
0006351: remove two-stage initialisation of GLProgram

Although this is not the cause of 0006351, two-stage initialisation is
inherently error-prone, and entirely unnecessary in this case since only
the GLProgramFactory is responsible for constructing and destructing
shaders and can simply ensure that it happens at the appropriate time
(during realise/unrealise, rather than construction/destruction).
Affected Issues
0006351
mod - include/iglprogram.h Diff File
mod - libs/command/ExecutionNotPossible.h Diff File
mod - radiantcore/rendersystem/backend/GLProgramFactory.cpp Diff File
mod - radiantcore/rendersystem/backend/GLProgramFactory.h Diff File
mod - radiantcore/rendersystem/backend/glprogram/BlendLightProgram.cpp Diff File
mod - radiantcore/rendersystem/backend/glprogram/BlendLightProgram.h Diff File
mod - radiantcore/rendersystem/backend/glprogram/CubeMapProgram.cpp Diff File
mod - radiantcore/rendersystem/backend/glprogram/CubeMapProgram.h Diff File
mod - radiantcore/rendersystem/backend/glprogram/DepthFillAlphaProgram.cpp Diff File
mod - radiantcore/rendersystem/backend/glprogram/DepthFillAlphaProgram.h Diff File
mod - radiantcore/rendersystem/backend/glprogram/GLSLProgramBase.cpp Diff File
mod - radiantcore/rendersystem/backend/glprogram/GLSLProgramBase.h Diff File
mod - radiantcore/rendersystem/backend/glprogram/GenericVFPProgram.cpp Diff File
mod - radiantcore/rendersystem/backend/glprogram/GenericVFPProgram.h Diff File
mod - radiantcore/rendersystem/backend/glprogram/InteractionProgram.cpp Diff File
mod - radiantcore/rendersystem/backend/glprogram/InteractionProgram.h Diff File
mod - radiantcore/rendersystem/backend/glprogram/RegularStageProgram.cpp Diff File
mod - radiantcore/rendersystem/backend/glprogram/RegularStageProgram.h Diff File
mod - radiantcore/rendersystem/backend/glprogram/ShadowMapProgram.cpp Diff File
mod - radiantcore/rendersystem/backend/glprogram/ShadowMapProgram.h Diff File

DarkRadiant: master 715b6180

08.12.2023 13:26

orbweaver


Details Diff
0006351: use abort() for unexpected exception on Linux

For a reason which is unclear but probably has something to do with
wxWidgets event handling, the popup-based OnExceptionInMainLoop() is
entering an infinite loop of error popups which cannot be interacted
with or dismissed, which makes debugging impossible on Linux.

Instead we just dump the error message to std::cerr and then abort(),
which creates a console message and then terminates the program. This
code is protected by an __linux__ #ifdef to avoid changing the behaviour
on Windows.
Affected Issues
0006351
mod - radiant/RadiantApp.cpp Diff File
mod - radiant/RadiantApp.h Diff File

DarkRadiant: master 9c5e880e

08.12.2023 14:18

orbweaver


Details Diff
0006351: fix crash on activating lighting mode in Model Selector

The issue was almost certainly introduced in a99bd537c293fc6eba6, when
(in order to solve an issue with wxWidgets parenting) intialisation of
the ModelSelector was connected to the MainFrameConstructed signal.

This resulted in the ModelSelector and its component preview widget
being constructed before the shared OpenGL context, which in turn meant
that the preview widget's contained OpenGLRenderSystem did not properly
realise the GLPrograms, resulting in the crash when lighting mode was
activated and the non-existent interaction shader was requested.

Rather than make further changes to ModelSelector initialisation timing,
which would be a fragile solution that could easily allow the issue to
recur in future, the OpenGLRenderSystem initialisation has been made
more robust. If there is no shared context at the time of construction,
we now connect to the appropriate signal to ensure construction happens
when the shared context is created, rather than leaving the render
system without any shaders available.
Affected Issues
0006351
mod - radiantcore/rendersystem/OpenGLRenderSystem.cpp Diff File

DarkRadiant: master 539891c6

13.01.2024 06:41

greebo


Details Diff
Revert "0006351: remove RenderSystem::setShaderProgramsAvailable()". The removal of the check getCurrentShaderProgram() != SHADER_PROGRAM_NONE caused the GLSL programs to be created at the wrong point in time (in Windows at least).

This reverts commit 98b7058922e6bd814111598cd671e33358c43def.
Affected Issues
0006351
mod - radiantcore/rendersystem/OpenGLRenderSystem.cpp Diff File

Issue History

Date Modified Username Field Change
07.12.2023 14:12 orbweaver New Issue
07.12.2023 14:12 orbweaver Status new => assigned
07.12.2023 14:12 orbweaver Assigned To => orbweaver
07.12.2023 14:13 orbweaver Description Updated
08.12.2023 17:10 orbweaver Status assigned => resolved
08.12.2023 17:10 orbweaver Resolution open => fixed
08.12.2023 17:10 orbweaver Fixed in Version => 3.9.0
08.12.2023 17:10 orbweaver Note Added: 0016232
07.01.2024 06:10 orbweaver Changeset attached => DarkRadiant master 98b70589
07.01.2024 06:10 orbweaver Changeset attached => DarkRadiant master 36a99d21
07.01.2024 06:10 orbweaver Changeset attached => DarkRadiant master c1534a5f
07.01.2024 06:10 orbweaver Changeset attached => DarkRadiant master 715b6180
07.01.2024 06:10 orbweaver Changeset attached => DarkRadiant master 9c5e880e
13.01.2024 06:20 greebo Note Added: 0016354
13.01.2024 06:27 greebo Note Added: 0016355
13.01.2024 06:41 greebo Changeset attached => DarkRadiant master 539891c6