Mir

Merge lp:~vanvugt/mir/fix-1358210 into lp:mir

Proposed by Daniel van Vugt
Status: Merged
Merged at revision: 1853
Proposed branch: lp:~vanvugt/mir/fix-1358210
Merge into: lp:mir
Diff against target: 26 lines (+10/-2)
1 file modified
examples/demo-shell/demo_renderer.cpp (+10/-2)
To merge this branch: bzr merge lp:~vanvugt/mir/fix-1358210
Reviewer Review Type Date Requested Status
Kevin DuBois (community) Approve
Alan Griffiths Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+231167@code.launchpad.net

Commit message

DemoRenderer: Don't try to create a texture of width zero. libGL might crash
and definitely won't produce anything useful. This simple regression was
caused by accidentally changing float corner_radius = 0.5f into an int in
revision 1845. (LP: #1358210)

Description of the change

Apparently nobody did manual testing of r1845 before approving it. We should watch that...

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Kevin DuBois (kdub) wrote :

The line is under test in the unit tests, and the branch was manually tested, although if its causing this problem, the problem slipped through. This line was changed to avoid the jenkins valgrind problem above:
==31577== valgrind: Unrecognised instruction at address 0xabe15d.
I'll investigate another solution

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

"unhandled instruction: 0xEEBE 0x0ACC" is a valgrind bug. It almost certainly just means Valgrind has't implemented support for all the instruction types gcc is outputting.

So we need to avoid executing such code under Valgrind/tests until Valgrind support for armhf is improved a little.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

P.S. I tried using pragmas. GCC tells me that optimization pragmas are not supported for ARM :(

So that's why we have this workaround instead.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

An ugly necessity I guess

review: Approve
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

[libprotobuf ERROR google/protobuf/descriptor_database.cc:57] File already exists in database: mir_protobuf_wire.proto
[libprotobuf FATAL google/protobuf/descriptor.cc:954] CHECK failed: generated_database_->Add(encoded_file_descriptor, size):
terminate called after throwing an instance of 'google::protobuf::FatalException'
what(): CHECK failed: generated_database_->Add(encoded_file_descriptor, size):
Aborted (core dumped)

lp:1358698

Revision history for this message
Kevin DuBois (kdub) wrote :

lgtm, sorry for the regression when the code was integrated. Hopefully the demo shell server can be tested the same was as the basic server in CI.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'examples/demo-shell/demo_renderer.cpp'
2--- examples/demo-shell/demo_renderer.cpp 2014-08-13 12:20:38 +0000
3+++ examples/demo-shell/demo_renderer.cpp 2014-08-19 07:11:37 +0000
4@@ -77,12 +77,20 @@
5 return corner;
6 }
7
8-GLuint generate_frame_corner_texture(int corner_radius,
9+GLuint generate_frame_corner_texture(float corner_radius,
10 Color const& color,
11 GLubyte highlight)
12 {
13 int const height = 256;
14- int const width = height * corner_radius;
15+/*
16+ * GCC 4.9 with optimizations enabled will generate armhf NEON/VFP instructions
17+ * here that are not understood/implemented by Valgrind (but are by hardware),
18+ * causing Valgrind to crash:
19+ * eebe 0acc vcvt.s32.f32 s0, s0, #8
20+ * So this clumsy expression below tricks the compiler into not using those
21+ * optimized ARM instructions that Valgrind doesn't support yet:
22+ */
23+ int const width = height / (1.0f / corner_radius);
24 Color image[height * height]; // Worst case still much faster than the heap
25
26 int const cx = width;

Subscribers

People subscribed via source and target branches