[cairo] [PATCH][pixman] Test program for stressing the use of different formats and operators

Siarhei Siamashka siarhei.siamashka at gmail.com
Sun Jul 12 04:54:29 PDT 2009


On Sunday 12 July 2009, Siarhei Siamashka wrote:

I think some more comments may be useful.

[...]
> The general overview of this testing method can be found here:
> http://en.wikipedia.org/wiki/Fuzz_testing
>
>
> The following optimized pixman functions have been found to produce
> results, at least different from C variant:
>
> ARM NEON: neon_composite_over_n_8_0565, neon_composite_over_n_0565,
> neon_composite_over_8888_0565

ARM SIMD functions are all OK.

NEON ones are real crashers which make X server totally unusable (at least in
my system). That's why it is very important to address them ASAP.

> MMX: mmx_composite_over_n_8_0565, mmx_composite_over_n_8_8888,
> mmx_composite_over_n_8888, mmx_composite_over_n_0565,
> mmx_composite_src_n_8_8888, mmx_composite_in_n_8_8

Also forgot to list mmx_combine_atop_u, mmx_combine_atop_reverse_u, 
mmx_combine_xor_u

I did not test SSE2 yet, but suspect that it may have quite a number of
problems too (just because it implements so many functions).

> VMX: vmx_combine_atop_u, vmx_combine_atop_reverse_u, vmx_combine_xor_u

Here is how this stuff can be used, taking PPC as an example:

$ make distclean
$ ./autogen.sh
$ ./configure --disable-shared --disable-vmx
$ make
$ mv test/blitters-test test/blitters-test.ref
$ make distclean
$ ./autogen.sh
$ ./configure --disable-shared
$ make
$ ruby test/blitters-test-bisect.rb test/blitters-test.ref test/blitters-test

Running all this, we get the following output:
http://pastebin.ca/1492583

It means that the problem has been detected at test 76 already.

To find out additional details, it is possible to run:
$ gdb test/blitters-test
(gdb) set arg -76
(gdb) b pixman_image_composite
(gdb) r

Breakpoint 1, pixman_image_composite (op=PIXMAN_OP_XOR, src=0x1005c030, 
mask=0x0, dest=0x1005c1f0, src_x=1,
    src_y=0, mask_x=1, mask_y=0, dest_x=6, dest_y=3, width=6, height=4) at 
pixman.c:120

(gdb) b walk_region_internal
(gdb) c

Breakpoint 2, walk_region_internal (imp=0x1005c320, op=PIXMAN_OP_XOR, 
src_image=0x1005c030, mask_image=0x0,
    dst_image=0x1005c1f0, src_x=1, src_y=0, mask_x=1, mask_y=0, dest_x=6, 
dest_y=3, width=6, height=4,
    src_repeat=0, mask_repeat=0, region=0xffffff95620,
    composite_rect=@0x10059dd0: 0x1002a820 <general_composite_rect>) at 
pixman-utils.c:417

(gdb) step
...
(gdb) step

vmx_combine_xor_u (imp=0x1005d340, op=PIXMAN_OP_XOR, dest=0xffffff8f3a0, 
src=0xffffff8f370, mask=0x0, width=6)
    at pixman-vmx.c:988

So we know that it is 'vmx_combine_xor_u' causing the problems. It is possible 
to disable this function in 'pixman-vmx.c' and repeat the test. Eventually
all the problematic functions will be disabled and the test will be able to
run for a long time (ideally infinitely) without spotting any other bugs.

The next step is to look at these functions one at a time, fix problems,
enable them again and make sure that the test passes successfully.

-- 
Best regards,
Siarhei Siamashka


More information about the cairo mailing list