Bug 100039 - GLAMOR crashes when drawing dashed lines
Summary: GLAMOR crashes when drawing dashed lines
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/Acceleration/glamor (show other bugs)
Version: git
Hardware: All All
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-02 18:40 UTC by Max Staudt
Modified: 2017-03-15 16:20 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
TGif drawing triggering the X server crash (12.01 KB, application/x-tgif)
2017-03-02 18:40 UTC, Max Staudt
no flags Details

Description Max Staudt 2017-03-02 18:40:27 UTC
Created attachment 130037 [details]
TGif drawing triggering the X server crash

Xorg using GLAMOR acceleration crashes when drawing some specific dashed lines.

To reproduce, load the file 'crashx11.obj' into TGif (just run "tgif crashx11.obj").

I've bisected this down to bd3b2c48f69a5169aefb261c041462271c69a07a which is just one commit after GLAMOR acceleration for dashed 0-width lines was introduced.

The attached file is taken from a different bug:
  https://bugzilla.opensuse.org/show_bug.cgi?id=1025985
Comment 1 Max Staudt 2017-03-02 18:48:26 UTC
This is how it crashes in the commit that introduced it, bd3b2c48f69a5169aefb261c041462271c69a07a :


Failed to compile VS: 0:13(43): error: `pos' undeclared
0:13(14): error: operands to arithmetic operators must be numeric
0:13(13): error: operands to arithmetic operators must be numeric

Program source:
#version 130
attribute vec3 primitive;
varying float dash_offset;
uniform vec2 fill_offset;
uniform vec2 fill_size;
varying vec2 fill_pos;
uniform float dash_length;
uniform vec4 v_matrix;
void main() {
       dash_offset = primitive.z / dash_length;
       gl_Position.xy = primitive.xy.xy * v_matrix.xz + v_matrix.yw;
       gl_Position.zw = vec2(0.0,1.0);
       fill_pos = (fill_offset + primitive.xy + pos) / fill_size;
}
Comment 2 Max Staudt 2017-03-02 18:53:59 UTC
Some commit has since changed fill_size to fill_size_inv.

Since the recent d8161aeb50891ae10c5656487ce8f982deed5f9f we now also have vec2_pos undeclared:


Failed to compile VS: 0:11(2): error: `vec2_pos' undeclared
0:11(2): error: value of type vec2 cannot be assigned to variable of type error
0:14(43): error: `pos' undeclared
0:14(14): error: operands to arithmetic operators must be numeric
0:14(13): error: operands to arithmetic operators must be numeric

Program source:
#version 130
attribute vec3 primitive;
varying float dash_offset;
uniform vec2 fill_offset;
uniform vec2 fill_size_inv;
varying vec2 fill_pos;
uniform float dash_length;
uniform vec4 v_matrix;
void main() {
       dash_offset = primitive.z / dash_length;
       vec2_pos = vec2(0,0);
       gl_Position.xy = primitive.xy.xy * v_matrix.xz + v_matrix.yw;
       gl_Position.zw = vec2(0.0,1.0);
       fill_pos = (fill_offset + primitive.xy + pos) * fill_size_inv;
}
(EE) 
Fatal server error:
(EE) GLSL compile failure
(EE)
Comment 3 Michel Dänzer 2017-03-03 02:04:23 UTC

*** This bug has been marked as a duplicate of bug 99943 ***
Comment 4 Max Staudt 2017-03-03 12:20:33 UTC
Aaah, thanks for pointing out the other bug!

However, I'm afraid this is not a dupe.

To put things in perspective: The patch that introduced bug 99943 has been written in an attempt to solve the bug I described here, and which was originally filed at:

https://bugzilla.opensuse.org/show_bug.cgi?id=1025985

It's similar to bug 97300, but not the same.
Comment 5 Michel Dänzer 2017-03-09 09:23:05 UTC
Fixed in Git master.
Comment 6 Max Staudt 2017-03-15 16:19:47 UTC
Thanks for fixing this crash!

For the record, the dashes drawn by GLAMOR are wrong, which is already noted as a different bug 99708.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.