Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Feb 2018 10:34:23 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 226059] Clang produces vmovaps with unaligned operand
Message-ID:  <bug-226059-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help

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

            Bug ID: 226059
           Summary: Clang produces vmovaps with unaligned operand
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: 6yearold@gmail.com

I am compiling lang/ghc with CPUTYPE?=native set. The ghc-pkg executable
produced during build gets broken. During staging step, the following command
is run

/wrkdirs/usr/ports/lang/ghc/work/stage/usr/local/lib/ghc-8.0.2/bin/ghc-pkg
--force --global-package-db
"/wrkdirs/usr/ports/lang/ghc/work/stage/usr/local/lib/ghc-8.0.2/package.conf.d"
update rts/dist/package.conf.install

but it fails with SIGBUS. Debugging under LLDB gives

(lldb) run
Process 29833 stopped
* thread #1, name = 'ghc-pkg', stop reason = signal SIGBUS: hardware error
    frame #0: 0x0000000804e476c6 libHSrts-ghc8.0.2.so`initGcThreads [inlined]
new_gc_thread(n=0) at GC.c:818
   815          ws->todo_q = newWSDeque(128);
   816          ws->todo_overflow = NULL;
   817          ws->n_todo_overflow = 0;
-> 818          ws->todo_large_objects = NULL;
   819 
   820          ws->part_list = NULL;
   821          ws->n_part_blocks = 0;
(lldb) disas -F intel
->  0x804e476c6 <+326>: vmovaps ymmword ptr [rbx + 0x40], ymm0

The value of rbx + 0x40 mod 16 = 0, but rbx + 0x40 mod 32 = 16, which is a
source of the error, I suspect.

Steps to reproduce:

# echo CPUTYPE?=native >>
/usr/local/etc/poudriere.d/<yourjail>-<yourports>-make.conf
# poudriere testport -j yourjail -p yourports -I lang/ghc

Once that fails, enter the jail and

# cd /wrkdirs/usr/ports/lang/ghc/work/ghc-8.0.2
# lldb --
/wrkdirs/usr/ports/lang/ghc/work/stage/usr/local/lib/ghc-8.0.2/bin/ghc-pkg
--force --global-package-db
"/wrkdirs/usr/ports/lang/ghc/work/stage/usr/local/lib/ghc-8.0.2/package.conf.d"
update rts/dist/package.conf.install

The same bug is present on 11.1-RELEASE too.

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


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-226059-8>