[Bug 216563] lang/gcc5: lang/gcc: stack alignment insufficient on i386 for SSE2 code.

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Jan 29 01:57:20 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216563

            Bug ID: 216563
           Summary: lang/gcc5: lang/gcc: stack alignment insufficient on
                    i386 for SSE2 code.
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: gerald at FreeBSD.org
          Reporter: mandree at FreeBSD.org
          Assignee: gerald at FreeBSD.org
             Flags: maintainer-feedback?(gerald at FreeBSD.org)

GCC 5.4.0 and also 4.9.0 from ports fail to generate working code for
rawtherapee, a C++11 application, and cause it to drop core with a SIGBUS on
i386. This is with -O3 -msse2.  

amd64 is unaffected. Other architectures are untested. GCC 6 and 7-devel are
untested.

To reproduce, compile ports/heads/graphics/rawtherapee-devel as of r432608
(exactly this version!), add "CFLAGS+=-g" and "STRIP=" to the Makefile and see
that it is hit by a SIGBUS in post-install when it tries to check if the
program is able to start. DO NOT USE WITH_DEBUG=yes, that will change compiler
flags and mask the bug!

Debugging this reveals that the generated code crashes when initalizing an auto
double[8] = { ... } vector upon entry to the function, when it tries to copy it
around with SSE instructions that require 16-byte alignment, but the source
address has some 0x...8 address. This affects i386 on 10.3-RELEASE and
11.0-RELEASE (both fully patched).

I am reporting this against GCC because this does NOT happen when the code is
recompiled with base clang (3.4.0 for FreeBSD 10.3, or 3.8.0 for FreeBSD 11.0.)
without changing anything else on the system (in particular, gdk, gtk, ... are
NOT touched when switching compilers).

Workaround: add -mstackrealign.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list