Segmentation fault on failed shader compilation/linking

Bug #1385888 reported by Tomasz Buchert
28
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Stellarium
Fix Released
Medium
Unassigned

Bug Description

Hi,
this report is an offshot of https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=766717. The problem is that Stellarium crashes when compilation or linking of shaders fails in the code. This is simply because the code does not check and stop when link() or compileSourceCode() are executed with error. Often the log is tested, but only warning is issued, for example:

if (!vshader.log().isEmpty()) { qWarning() << "Planet: Warnings while compiling vshader: " << vshader.log(); }

It would be great if Stellarium could try to compile its shaders at the beginning and show a nice window saying that it cannot run. It would be even greater if in this case some fallback shaders could be tried so that Stellarium can run on older hardware that cannot compile/link the standard ones.

Cheers,
Tomasz

Tags: opengl

Related branches

description: updated
Changed in stellarium:
importance: Undecided → High
tags: added: opengl
Changed in stellarium:
milestone: none → 0.13.2
Revision history for this message
gzotti (georg-zotti) wrote :

The problem is known since May/June or so.

All I can see is that OP has some outdated GeForce 7300 GPU from around 2006 with GLSL1.2, which is simpy not supported by 0.13+. We demand more modern hardware.

There are no fallback shaders, although yes it would be nice to have some minimal GLSL1.2 shaders with less functionality. On the other hand, a new minimal-level desktop graphics card that works nowadays costs €50 or less. Alternatively, Alexander is working on backports to keep 0.12.x alive for such outdated hardware.

Some shader compilers emit zero output if all is fine, others (Intel? ) say "no errors" or similar. If all "false positive" warnings can be excluded, a "fail" panel and graceful exit could be added. However, a simple look into the logfile and reading the FAQ is all you need to resolve this.

Changed in stellarium:
importance: High → Medium
Revision history for this message
Tomasz Buchert (tomasz-buchert) wrote :

Hi,
I'm ok for the deprecation of old GPUs, especially since Alexander decided to step in to prepare a new 0.12.x release. However, the main thing about this bug is that stellarium crashes when old hardware is present.

Aren't the return values of the methods http://qt-project.org/doc/qt-5/qglshader.html#compileSourceCode and http://qt-project.org/doc/qt-5/qopenglshaderprogram.html#link a reliable way to check if the compilation/linking failed? My fast inspection of the source code told me that the results of these functions are ignored.

Revision history for this message
gzotti (georg-zotti) wrote :

Inspect again, less fast. At least link() is thoroughly checked. StelPainter line 78: bool ret = prog->link();
Then there are tests of this ret value and return messages. If there is something suspicious, a warning is written into the logfile. For compileSourceCode(), ret is not tested (yes, we should add this!), but log entries are checked. Depending on how critical the problem is, the program may crash, show funny graphics artifacts, or continue to run and only have a cosmetic problem in night mode or so. In the crash case you see immediately that it does not work for you, you can read the logfile and know why. In the latter case, a fail panel and exit would be too harsh if you never even use night mode. Maybe a panel should be shown on first run, with option to exit or ignore warnings (and save a flag to not again show the warning) and continue?

gzotti (georg-zotti)
Changed in stellarium:
assignee: nobody → gzotti (georg-zotti)
status: New → In Progress
gzotti (georg-zotti)
Changed in stellarium:
assignee: gzotti (georg-zotti) → nobody
Changed in stellarium:
milestone: 0.13.2 → none
Revision history for this message
gzotti (georg-zotti) wrote :

There is no further progress on this.
- immediate popup boxes after failed shader compilation were rejected by Fabien
- we test principal conformance with required OpenGL/GLSL level at program start now

So this should be either "Won't fix" or "Fix released" (with 0.13.2 or so).

gzotti (georg-zotti)
Changed in stellarium:
milestone: none → 0.15.0
Changed in stellarium:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.