[Pixman] GCC_VECTOR_EXTENSIONS_SUPPORTED on 32 bits system

Olivier Langlois olivier at trillion01.com
Sun Nov 17 10:55:20 PST 2013


On 11/17/2013 09:36 AM, Olivier Langlois wrote:
> Hi,
>
> This is probably more a gcc issue and maybe I am not the first one 
> reporting you the issue but a bunch of tests are segfaulting when 
> building pixman 0.32.2. If I comment out the 4-5 lines of code in 
> test/utils-prng.h defining GCC_VECTOR_EXTENSIONS_SUPPORTED, the 
> segfaults goes away.
>
Hi,

I have kept looking on this problem. While removing gcc vector extension 
code did help a lot, I was still having 2-3 segfaults.

from region-contains-test, matrix-test and stress-test.

I think that I have nailed the real problem. It comes from an 
incompatibility between the assembly code in:

static uint32_t
call_test_function (uint32_t    (*test_function)(int testnum, int verbose),
                     int         testnum,
                     int         verbose)
{
     uint32_t retval;

#if defined (__GNUC__) && (defined (__i386) || defined (__i386__))
     __asm__ (
         /* Deliberately avoid aligning the stack to 16 bytes */
         "pushl  %1\n\t"
         "pushl  %2\n\t"
         "call   *%3\n\t"
         "addl   $8, %%esp\n\t"
         : "=a" (retval)
         : "r" (verbose),
           "r" (testnum),
           "r" (test_function)
         : "edx", "ecx"); /* caller save registers */
#else
     retval = test_function (testnum, verbose);
#endif

     return retval;
}

and gcc switch -fstack-protector.

I had these CFLAGS: -D_FORTIFY_SOURCE=2 -fstack-protector 
--param=ssp-buffer-size=4

by removing them, the crashes went away.



More information about the Pixman mailing list