Bug 99992

Summary: test/test-bezier.c dumps core on arm64/ppc/ppc64el
Product: xorg Reporter: Timo Aaltonen <tjaalton>
Component: Input/libinputAssignee: Peter Hutterer <peter.hutterer>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: peter.hutterer, rohini9889
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
build log on ppc none

Description Timo Aaltonen 2017-02-27 21:57:15 UTC
Created attachment 129969 [details]
build log on ppc

Hi, 0.24.0 added a new test for wacom, but running it fails on (at least) these archs. Build log attached.
Comment 1 Peter Hutterer 2017-02-28 02:47:10 UTC
This appears to be a result of optimization. 

With -O0

Breakpoint 1, test_nonzero_x_linear () at test-bezier.c:157
157			assert(bezier[x] > bezier[x-1]);
(gdb) p bezier
$6 = {0 <repeats 409 times>, 1, 2, 4, 5, 7, 9, 10, 12, 14, 15, 17, 19, 21, 22, 

With -O2:
(gdb) p bezier
$1 = {0 <repeats 410 times>, 1, 3, 5, 7, 9, 10, 12, 14, 15, 17, 19, 20, 22,

That extra 0 at -O2 triggers the bug. There are other entries that don't match either, but only this one would trigger the bug.
Comment 2 Peter Hutterer 2017-02-28 05:31:53 UTC
https://patchwork.freedesktop.org/patch/141130/
Comment 3 Timo Aaltonen 2017-02-28 06:18:18 UTC
yep, that works, thanks
Comment 4 Peter Hutterer 2017-03-09 02:21:45 UTC
commit 72fb6d304eec6eeeac6b42963c2729134d56de57
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Feb 28 14:45:29 2017 +1000

    test: fix a test failure on ppc64(le) and aarch64

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.