[Bug 213785] stable/11 -r307797 on BPi-M3 (cortex-a7): xgcc's cc1 during lang/gcc6 build gets SIGSYS failures (/usr/ports -r424540)

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Oct 25 21:37:35 UTC 2016


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

            Bug ID: 213785
           Summary: stable/11 -r307797 on BPi-M3 (cortex-a7): xgcc's cc1
                    during lang/gcc6 build gets SIGSYS failures
                    (/usr/ports -r424540)
           Product: Base System
           Version: 11.0-STABLE
          Hardware: arm
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: arm
          Assignee: freebsd-arm at FreeBSD.org
          Reporter: markmi at dsl-only.net

[See
https://lists.freebsd.org/pipermail/freebsd-stable/2016-October/086125.html for
more supporting details.]

While trying to build lang/gcc6 on a BPI-M3 (Cortex-A7, ALLWINNER) I got "xgcc:
internal compiler error: Bad system call (program cc1)", which means a SIGSYS
(signal 12) resulted.

[I will note that I'v never seen this issue (so far) on the rpi2: This may be
KERNCONF=ALLWINNER specific. But I've not yet updated to -r307797 on the rpi2.
The BPI-M3 context is new for me; the rpi2 I've been using for a long time.]

This was under/on:

root at bananapi-m3:/usr/ports # uname -apKU
FreeBSD bananapi-m3 11.0-STABLE FreeBSD 11.0-STABLE #0 r307797M: Mon Oct 24
00:41:16 PDT 2016    
markmi at FreeBSDx64:/usr/local/src/crochet/work/obj/arm.armv6/usr/src/sys/ALLWINNER
 arm armv6 1100505 1100505

[Note this was cross-built and then a matching svnlite co was done on the
BPi-M3. So the source timestamps on the BPi-M3 are newer than the times from
the cross build.]

root at bananapi-m3:/usr/ports # svnlite info /usr/ports/ | grep "Re[lv]"
Relative URL: ^/head
Revision: 424540
Last Changed Rev: 424540

dmesg | tail shows:

pid 29581 (cc1), uid 0: exited on signal 12 (core dumped)
pid 29613 (cc1), uid 0: exited on signal 12 (core dumped)
pid 29622 (cc1), uid 0: exited on signal 12 (core dumped)
pid 29651 (cc1), uid 0: exited on signal 12 (core dumped)
pid 29660 (cc1), uid 0: exited on signal 12 (core dumped)
pid 29798 (cc1), uid 0: exited on signal 12 (core dumped)
pid 30422 (cc1), uid 0: exited on signal 12 (core dumped)
pid 30426 (cc1), uid 0: exited on signal 12 (core dumped)
pid 30428 (cc1), uid 0: exited on signal 12 (core dumped)
pid 30431 (cc1), uid 0: exited on signal 12 (core dumped)

(All the lang/gcc6 prerequisites built okay on the BPi-M3.)

Unfortunately direct execution of the cc1 command on the libgcc2.i from a use
of -save-temps does not fail. For some reason the failure is only when xgcc
causes the cc1 command execution.

Also unfortunately truss gets a segmentation fault of its own trying the handle
watching the SIGSYS related activity. (A truss bugzilla report has been made.)
Thus the following tail of the truss output for leading up to the SIGSYS does
not cover the SIGSYS related activity itself:

root at bananapi-m3:/usr/obj/portswork/usr/ports/lang/gcc6/work/.build/armv6-portbld-freebsd11.0/libgcc
# tail truss.log
31183 100086: close(3)                           = 0 (0x0)
31183 100086:
openat(AT_FDCWD,"/usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/longlong.h",O_NOCTTY,00)
ERR#2 'No such file or directory'
31183 100086: openat(AT_FDCWD,"./longlong.h",O_NOCTTY,00) ERR#2 'No such file
or directory'
31183 100086: openat(AT_FDCWD,"../.././gcc/longlong.h",O_NOCTTY,00) ERR#2 'No
such file or directory'
31183 100086:
openat(AT_FDCWD,"/usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/../gcc/longlong.h",O_NOCTTY,00)
ERR#2 'No such file or directory'
31183 100086:
openat(AT_FDCWD,"/usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/../include/longlong.h",O_NOCTTY,00)
= 3 (0x3)
31183 100086: fstat(3,{ mode=-rw-r--r-- ,inode=573594,size=61185,blksize=32768
}) = 0 (0x0)
31183 100086: read(3,"/* longlong.h -- definitions for"...,61185) = 61185
(0xef01)
31183 100086: close(3)                           = 0 (0x0)
31183 100086:
mmap(0x0,16384,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,16384,0x100000000)

Via using gdb on truss [with truss running xgcc and xgcc in turn running its
cc1 instance]:

root at bananapi-m3:/usr/obj/portswork/usr/ports/lang/gcc6/work/.build/armv6-portbld-freebsd11.0/libgcc
# gdb truss
. . . [the below is in enter_syscall] . . .
380             t->cs.name = sysdecode_syscallname(t->proc->abi->abi,
t->cs.number);
381             if (t->cs.name == NULL)
(gdb) 
382                     fprintf(info->outfile, "-- UNKNOWN %s SYSCALL %d --\n",
383                         t->proc->abi->type, t->cs.number);
384     
385             sc = get_syscall(t->cs.name, narg);
386             t->cs.nargs = sc->nargs;
387             assert(sc->nargs <= nitems(t->cs.s_args));
388     
389             t->cs.sc = sc;

(t->cs.name == NULL after line 380). . .

Looking at the two things that the fprintf on lines 382 and 383 would report:

(gdb) print t->proc->abi->type
$4 = 0x10166 "FreeBSD ELF32"

(gdb) print t->cs.number
$5 = 580828064

FYI: 580828064 = 0x229EBBA0

(sc == NULL results from line 385 so sc->nargs on line 386 gets a SIGSEGV.)

Just for completness:

(gdb) print *t
$2 = {entries = {le_next = 0x0, le_prev = 0x20617070}, proc = 0x20617060, tid =
100150, in_syscall = 1, cs = {sc = 0x0, name = 0x0, number = 580828064, args =
0x2061b0c0, nargs = 0, 
  s_args = 0x2061b0ec}, before = {tv_sec = 1477418265, tv_nsec = 492342263},
after = {tv_sec = 1477418265, tv_nsec = 492496630}}

(gdb) print sc
$3 = (struct syscall *) 0x0

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


More information about the freebsd-arm mailing list