Bug 15693 - libpixman (from git) segfaults with xulrunner
Summary: libpixman (from git) segfaults with xulrunner
Status: RESOLVED FIXED
Alias: None
Product: pixman
Classification: Unclassified
Component: pixman (show other bugs)
Version: 0.1.3
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Søren Sandmann Pedersen
QA Contact: Søren Sandmann Pedersen
URL:
Whiteboard:
Keywords:
: 15688 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-04-24 09:36 UTC by Giacomo Perale
Modified: 2008-05-15 15:22 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
gdb backtrace (33.84 KB, text/plain)
2008-04-24 09:36 UTC, Giacomo Perale
Details

Description Giacomo Perale 2008-04-24 09:36:43 UTC
Created attachment 16161 [details]
gdb backtrace

I'm using mozilla-firefox 3.0 beta5 as provided by gentoo (that is, using xulrunner and system cairo, 1.6.4 in my case).
With libpixman from git (as of commit 92ef26dfed3337831dd5156bfe0d20b132a26a29, "
Add SSE2 implementations of many compositing operations.") xulrunner segfaults in pixman:

Program received signal SIGSEGV, Segmentation fault.
0xa72b529f in fbCompositeSolidMask_nx8x8888sse2 (op=PIXMAN_OP_OVER, 
    pSrc=0x94beca0, pMask=0x94bed40, pDst=0x94bec00, xSrc=3, ySrc=2, xMask=0, 
    yMask=0, xDst=3, yDst=2, width=42, height=42)
    at /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/emmintrin.h:568
568	  return __extension__ (__m128i)(__v4si){ __q0, __q1, __q2, __q3 };

Full backtrace (with debug symbols for pixman and cairo) attached.
Comment 1 Søren Sandmann Pedersen 2008-04-25 19:11:10 UTC
This is because Mozilla component system creates an unaligned stack, and gcc assumes the stack is always 16 byte aligned.

It's a gcc bug - if it wants to generate the movdqa instruction it should make sure the location is correctly aligned. But we need to work around it in pixman.

There are various things that could be done, including requiring gcc 4.2 and make  use of the function attribute that makes it emit prologues that align the stack.

Comment 3 Søren Sandmann Pedersen 2008-05-14 22:09:56 UTC
Should be fixed by this commit, which I'll push when freedesktop logins are reenabled.

commit d71bfc7777a48edfeb0aee0e3da97ac700a3dc90
Author: Søren Sandmann <sandmann@redhat.com>
Date:   Thu May 15 01:00:28 2008 -0400

    Work around GCC bug causing crashes in Mozilla with SSE2
    
    When using SSE2 intrinsics, gcc assumes that the stack is 16 byte
    aligned. Unfortunately some code, such as Mozilla and Mono contain
    code that aligns the stack to 4 bytes.
    
    The __force_align_arg_pointer__ makes gcc generate a prologue that
    realigns the stack pointer to 16 bytes.  Fix bug 15693.
Comment 4 Søren Sandmann Pedersen 2008-05-15 15:22:40 UTC
*** Bug 15688 has been marked as a duplicate of this bug. ***


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.