crash in SphericalCap::drawFill()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Stellarium |
Fix Released
|
Medium
|
Emmanuel |
Bug Description
The following code
{
}
inserted at the very beginning of the draw() method of the AngleMeasure plugin, compiled statically, causes stellarium to crash
Stellarium versions tested: 0.12.0 and 0.12 on linux, and 0.12.0 on windows.
Console output:
Loaded plugin "AngleMeasure" .
AngleMeasure plugin - press control-A to toggle angle measure mode
Build log after adding a Mat4d transform shader: "Built successfully"
Build log after adding a stereographic projection shader: "Built successfully"
Simple planet shader build log: "Built successfully"
Shadow planet shader build log: "Built successfully"
Using vertex shader for atmosphere rendering.
Atmosphere shader build log: "Built successfully"
ASSERT failure in void appendTriangle(
Abandon
Backtrace from gdb:
Program received signal SIGABRT, Aborted.
0x00007ffff5ad9425 in __GI_raise (sig=<optimized out>)
at ../nptl/
64 ../nptl/
(gdb) bt
#0 0x00007ffff5ad9425 in __GI_raise (sig=<optimized out>)
at ../nptl/
#1 0x00007ffff5adcb8b in __GI_abort () at abort.c:91
#2 0x00007ffff61f04c2 in qt_message_
from /usr/lib/
#3 0x00007ffff61f0838 in ?? () from /usr/lib/
#4 0x00007ffff61f09c4 in qFatal(char const*, ...) ()
from /usr/lib/
#5 0x000000000055c3ec in appendTriangle (buffer=0x2add2c0, vertices=...,
texCoords=
at /home/emmanuel/
#6 0x000000000056b86f in projectSpherica
texCoords=
checkDisc1=
at /home/emmanuel/
#7 0x000000000056bc4a in projectSpherica
texCoords=0x0, buffer=0x2add2c0, maxSqDistortion=5, nbI=0,
checkDisc1=
at /home/emmanuel/
#8 0x000000000055c995 in SphericalRegion
this=
---Type <return> to continue, or q <return> to quit---
handleDisco
at /home/emmanuel/
#9 0x000000000055d6dd in SphericalRegion
renderer=
at /home/emmanuel/
#10 0x000000000071d80e in AngleMeasure::draw (this=0x263fa90, core=0xf8e4e0,
renderer=
at /home/emmanuel/
Code of modified AngleMesure.cpp:
150 //! Draw any parts on the screen which are for our module
151 void AngleMeasure:
152 {
153 {
154 renderer-
155 SphericalCap C(1,0,0);
156 StelProjectorP prj = core->getProjec
157 SphericalRegion
158 C.drawFill(
159 }
160 if (lineVisible.
161 return;
162
Related branches
- Stellarium: Pending requested
-
Diff: 196 lines (+21/-21)2 files modifiedCMakeLists.txt (+2/-2)
src/core/StelSphereGeometry.cpp (+19/-19)
- Stellarium: Pending requested
-
Diff: 35 lines (+4/-3)2 files modifiedCMakeLists.txt (+2/-2)
src/core/StelSphereGeometry.cpp (+2/-1)
Changed in stellarium: | |
milestone: | none → 0.12.2 |
assignee: | nobody → Emmanuel (hacker-emmanuel) |
status: | New → Fix Committed |
Changed in stellarium: | |
importance: | Undecided → Medium |
Changed in stellarium: | |
status: | Fix Committed → Fix Released |
In fact the crash is a failed assertion which appears in debug mode.
By commenting out this assertion, there are then three other failed assertions at StelSphereGeome try.cpp: 373 ASSERT( fabs(vertices- >a.length( )-1.)<0. 00001); ASSERT( fabs(vertices- >b.length( )-1.)<0. 00001); ASSERT( fabs(vertices- >c.length( )-1.)<0. 00001);
Q_
Q_
Q_
By commenting them out, the code does not crash but the spherical cap is not correctly drawn and the program eventually crashes (except in gdb and valgrind)
(nb: there's a mistake in the code sample I gave, the alpha channel should be 1 to see something, and it's better to set a small aperture to the spherical cap)
Under valgrind the spherical cap is correctly drawn and the program does not crash, but there are many "Invalid read" errors from freed memory blocks.
Few weeks ago everything worked with basically the same code. Since then I upgraded graphics card drivers. That's the only thing I can think of but I don't understand how it could explain these new issues.