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

From: Mark Millard <markmi_at_dsl-only.net>
Date: Wed, 26 Oct 2016 15:24:34 -0700
[A top post noting that user "ast" CSW's are involved and other details in the sequence leading up to the failure.]

Using "ktrace -i -t +fw" it looks like every repeat of the problem ends up with the following sort of sequence (a variation is shown later):

 34629 cc1      CALL  mmap(0,0x4000,0x3<PROT_READ|PROT_WRITE>,0x1002<MAP_PRIVATE|MAP_ANON>,0xffffffff,0x1c,0,0)
 34629 cc1      RET   mmap 568225792/0x21de7000
 34629 cc1      PFLT  0x21de7000 VM_PROT_WRITE
 34629 cc1      PRET  KERN_SUCCESS
 34629 cc1      PFLT  0x21de8000 VM_PROT_WRITE
 34629 cc1      PRET  KERN_SUCCESS
 34629 cc1      PFLT  0x21de9000 VM_PROT_WRITE
 34629 cc1      PRET  KERN_SUCCESS
 34629 cc1      PFLT  0x21dea000 VM_PROT_WRITE
 34629 cc1      PRET  KERN_SUCCESS
 34629 cc1      PFLT  0x229e8000 VM_PROT_WRITE
 34629 cc1      PRET  KERN_SUCCESS
 34629 cc1      PFLT  0x229e9000 VM_PROT_WRITE
 34629 cc1      PRET  KERN_SUCCESS
 34629 cc1      PFLT  0x229ea000 VM_PROT_WRITE
 34629 cc1      PRET  KERN_SUCCESS
 34629 cc1      CSW   stop user "ast"
 34629 cc1      CSW   resume user "ast"
 34629 cc1      PFLT  0x229eb000 VM_PROT_WRITE
 34629 cc1      PRET  KERN_SUCCESS
 34629 cc1      PFLT  0x229ec000 VM_PROT_WRITE
 34629 cc1      PRET  KERN_SUCCESS
 34629 cc1      CALL  [-17504]
 34629 cc1      RET   [-17504] -1 errno 78 Function not implemented
 34629 cc1      PSIG  SIGSYS SIG_DFL code=SI_KERNEL
 34629 cc1      NAMI  "cc1.core"
 34630 as       CSW   stop kernel "piperd"
 34630 as       Events dropped.
 34630 as       RET   read 0
 34630 as       CALL  close(0)
 34630 as       RET   close 0
. . .

I'll note that for the source this was compiling I used gdb truss with run -feH -o truss.log and it reported:

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

FYI: 580828064 = 0x229EBBA0

where the truss segmentation fault was at line 385 of the following (sc==NULL in the context):

> 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;

The 229E matched the upper part of local PFLT activity around the user "ast" CSW's, including just before the bad call.

But the details do vary some based on the source file being compiled. For example here the user "ast" CSW's are just before the mmap but are still just after the 0x229ea000 PFLT:

 34698 cc1      PRET  KERN_SUCCESS
 34698 cc1      PFLT  0xbfbf2000 VM_PROT_WRITE
 34698 cc1      PRET  KERN_SUCCESS
 34698 cc1      PFLT  0x229e7000 VM_PROT_WRITE
 34698 cc1      PRET  KERN_SUCCESS
 34698 cc1      PFLT  0x229e8000 VM_PROT_WRITE
 34698 cc1      PRET  KERN_SUCCESS
 34698 cc1      PFLT  0x229e9000 VM_PROT_WRITE
 34698 cc1      PRET  KERN_SUCCESS
 34698 cc1      PFLT  0x229ea000 VM_PROT_WRITE
 34698 cc1      PRET  KERN_SUCCESS
 34698 cc1      CSW   stop user "ast"
 34698 cc1      CSW   resume user "ast"
 34698 cc1      CALL  mmap(0,0x4000,0x3<PROT_READ|PROT_WRITE>,0x1002<MAP_PRIVATE|MAP_ANON>,0xffffffff,0,0,0)
 34698 cc1      RET   mmap 568225792/0x21de7000
 34698 cc1      PFLT  0x21de7000 VM_PROT_WRITE
 34698 cc1      PRET  KERN_SUCCESS
 34698 cc1      PFLT  0x21de8000 VM_PROT_WRITE
 34698 cc1      PRET  KERN_SUCCESS
 34698 cc1      PFLT  0x21de9000 VM_PROT_WRITE
 34698 cc1      PRET  KERN_SUCCESS
 34698 cc1      PFLT  0x21dea000 VM_PROT_WRITE
 34698 cc1      PRET  KERN_SUCCESS
 34698 cc1      PFLT  0x229eb000 VM_PROT_WRITE
 34698 cc1      PRET  KERN_SUCCESS
 34698 cc1      CALL  [-25840]
 34698 cc1      RET   [-25840] -1 errno 78 Function not implemented
 34698 cc1      PSIG  SIGSYS SIG_DFL code=SI_KERNEL
 34698 cc1      NAMI  "cc1.core"
 34699 as       CSW   stop kernel "piperd"
 34699 as       Events dropped.
 34699 as       RET   read 0
 34699 as       CALL  close(0)
 34699 as       RET   close 0

-25840 in 2's complement is: 0xF...F9B10

Here doing the gdb truss instead reports:

(gdb) print t->cs.number
$1 = 580819728

and 580819728 = 0x229E9B10

and the 229E part matches several PFLT's in the area, including just before the bad call as well as just before the user "ast"s. Between them are some PFLT's that do not match.

I would guess that the 229E in t->cs.number in truss is from the PFLT just before the failing syscall in each case.

===
Mark Millard
markmi at dsl-only.net

On 2016-Oct-25, at 2:32 PM, Mark Millard <markmi at dsl-only.net> wrote:

> [I'll be submitting some of the below information to bugzilla.]
> 
> 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
> 
> 
> 
> Supporting details follow. . .
> 
> The specific error reports are:
> 
> xgcc: internal compiler error: Bad system call (program cc1)
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <http://gcc.gnu.org/bugs.html> for instructions.
> gmake[5]: *** [Makefile:467: _muldi3.o] Error 4
> gmake[5]: *** Waiting for unfinished jobs....
> 
> xgcc: internal compiler error: Bad system call (program cc1)
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <http://gcc.gnu.org/bugs.html> for instructions.
> gmake[5]: *** [Makefile:467: _negdi2.o] Error 4
> 
> xgcc: internal compiler error: Bad system call (program cc1)
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <http://gcc.gnu.org/bugs.html> for instructions.
> gmake[5]: *** [Makefile:467: _cmpdi2.o] Error 4
> 
> xgcc: internal compiler error: Bad system call (program cc1)
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <http://gcc.gnu.org/bugs.html> for instructions.
> gmake[5]: *** [Makefile:467: _ucmpdi2.o] Error 4
> 
> gmake[5]: Leaving directory '/usr/obj/portswork/usr/ports/lang/gcc6/work/.build/armv6-portbld-freebsd11.0/libgcc'
> gmake[4]: *** [Makefile:14874: all-stage1-target-libgcc] Error 2
> 
> The specific xgcc commands were:
> 
> /usr/obj/portswork/usr/ports/lang/gcc6/work/.build/./gcc/xgcc -B/usr/obj/portswork/usr/ports/lang/gcc6/work/.build/./gcc/ -B/usr/local/armv6-portbld-freebsd11.0/bin/ -B/usr/local/armv6-portbld-freebsd11.0/lib/ -isystem /usr/local/armv6-portbld-freebsd11.0/include -isystem /usr/local/armv6-portbld-freebsd11.0/sys-include    -O2 -pipe -mcpu=cortex-a7 -DLIBICONV_PLUG -g -fno-strict-aliasing -O2  -O2 -pipe -mcpu=cortex-a7  -DLIBICONV_PLUG -g -fno-strict-aliasing -DIN_GCC    -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fPIC -pthread -fno-inline -fomit-frame-pointer -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector   -fPIC -pthread -fno-inline -fomit-frame-pointer -I. -I. -I../.././gcc -I/usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc -I/usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/. -I/usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/../gcc 
> -I/usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/../include  -DHAVE_CC_TLS  -o _muldi3.o -MT _muldi3.o -MD -MP -MF _muldi3.dep -DL_muldi3 -c /usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS
> 
> /usr/obj/portswork/usr/ports/lang/gcc6/work/.build/./gcc/xgcc -B/usr/obj/portswork/usr/ports/lang/gcc6/work/.build/./gcc/ -B/usr/local/armv6-portbld-freebsd11.0/bin/ -B/usr/local/armv6-portbld-freebsd11.0/lib/ -isystem /usr/local/armv6-portbld-freebsd11.0/include -isystem /usr/local/armv6-portbld-freebsd11.0/sys-include    -O2 -pipe -mcpu=cortex-a7 -DLIBICONV_PLUG -g -fno-strict-aliasing -O2  -O2 -pipe -mcpu=cortex-a7  -DLIBICONV_PLUG -g -fno-strict-aliasing -DIN_GCC    -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fPIC -pthread -fno-inline -fomit-frame-pointer -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector   -fPIC -pthread -fno-inline -fomit-frame-pointer -I. -I. -I../.././gcc -I/usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc -I/usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/. -I/usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/../gcc 
> -I/usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/../include  -DHAVE_CC_TLS  -o _negdi2.o -MT _negdi2.o -MD -MP -MF _negdi2.dep -DL_negdi2 -c /usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS
> 
> /usr/obj/portswork/usr/ports/lang/gcc6/work/.build/./gcc/xgcc -B/usr/obj/portswork/usr/ports/lang/gcc6/work/.build/./gcc/ -B/usr/local/armv6-portbld-freebsd11.0/bin/ -B/usr/local/armv6-portbld-freebsd11.0/lib/ -isystem /usr/local/armv6-portbld-freebsd11.0/include -isystem /usr/local/armv6-portbld-freebsd11.0/sys-include    -O2 -pipe -mcpu=cortex-a7 -DLIBICONV_PLUG -g -fno-strict-aliasing -O2  -O2 -pipe -mcpu=cortex-a7  -DLIBICONV_PLUG -g -fno-strict-aliasing -DIN_GCC    -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fPIC -pthread -fno-inline -fomit-frame-pointer -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector   -fPIC -pthread -fno-inline -fomit-frame-pointer -I. -I. -I../.././gcc -I/usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc -I/usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/. -I/usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/../gcc 
> -I/usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/../include  -DHAVE_CC_TLS  -o _cmpdi2.o -MT _cmpdi2.o -MD -MP -MF _cmpdi2.dep -DL_cmpdi2 -c /usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS
> 
> /usr/obj/portswork/usr/ports/lang/gcc6/work/.build/./gcc/xgcc -B/usr/obj/portswork/usr/ports/lang/gcc6/work/.build/./gcc/ -B/usr/local/armv6-portbld-freebsd11.0/bin/ -B/usr/local/armv6-portbld-freebsd11.0/lib/ -isystem /usr/local/armv6-portbld-freebsd11.0/include -isystem /usr/local/armv6-portbld-freebsd11.0/sys-include    -O2 -pipe -mcpu=cortex-a7 -DLIBICONV_PLUG -g -fno-strict-aliasing -O2  -O2 -pipe -mcpu=cortex-a7  -DLIBICONV_PLUG -g -fno-strict-aliasing -DIN_GCC    -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fPIC -pthread -fno-inline -fomit-frame-pointer -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector   -fPIC -pthread -fno-inline -fomit-frame-pointer -I. -I. -I../.././gcc -I/usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc -I/usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/. -I/usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/../gcc 
> -I/usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/../include  -DHAVE_CC_TLS  -o _ucmpdi2.o -MT _ucmpdi2.o -MD -MP -MF _ucmpdi2.dep -DL_ucmpdi2 -c /usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS
> 
> 
> Unfortunately gdb does not report much directly. . .
> 
> root_at_bananapi-m3:/usr/ports # gdb /usr/obj/portswork/usr/ports/lang/gcc6/work/.build/gcc/cc1 /usr/obj/portswork/usr/ports/lang/gcc6/work/.build/armv6-portbld-freebsd11.0/libgcc/cc1.core
> GNU gdb 6.1.1 [FreeBSD]
> Copyright 2004 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for details.
> This GDB was configured as "armv6-marcel-freebsd"...
> Core was generated by `/usr/obj/portswork/usr/ports/lang/gcc6/work/.build/./gcc/cc1 -quiet -I . -I . -I'.
> Program terminated with signal 12, Bad system call.
> Reading symbols from /usr/local/lib/libmpc.so.3...done.
> Loaded symbols for /usr/local/lib/libmpc.so.3
> Reading symbols from /usr/local/lib/libmpfr.so.4...done.
> Loaded symbols for /usr/local/lib/libmpfr.so.4
> Reading symbols from /usr/local/lib/libgmp.so.10...done.
> Loaded symbols for /usr/local/lib/libgmp.so.10
> Reading symbols from /lib/libz.so.6...Reading symbols from /usr/lib/debug//lib/libz.so.6.debug...done.
> done.
> Loaded symbols for /lib/libz.so.6
> Reading symbols from /usr/lib/libc++.so.1...Reading symbols from /usr/lib/debug//usr/lib/libc++.so.1.debug...done.
> done.
> Loaded symbols for /usr/lib/libc++.so.1
> Reading symbols from /lib/libcxxrt.so.1...Reading symbols from /usr/lib/debug//lib/libcxxrt.so.1.debug...done.
> done.
> Loaded symbols for /lib/libcxxrt.so.1
> Reading symbols from /lib/libm.so.5...Reading symbols from /usr/lib/debug//lib/libm.so.5.debug...done.
> done.
> Loaded symbols for /lib/libm.so.5
> Reading symbols from /lib/libgcc_s.so.1...Reading symbols from /usr/lib/debug//lib/libgcc_s.so.1.debug...done.
> done.
> Loaded symbols for /lib/libgcc_s.so.1
> Reading symbols from /lib/libc.so.7...Reading symbols from /usr/lib/debug//lib/libc.so.7.debug...done.
> done.
> Loaded symbols for /lib/libc.so.7
> Reading symbols from /libexec/ld-elf.so.1...Reading symbols from /usr/lib/debug//libexec/ld-elf.so.1.debug...done.
> done.
> Loaded symbols for /libexec/ld-elf.so.1
> #0  0xbfbf732c in ?? ()
> (gdb) bt
> #0  0xbfbf732c in ?? ()
> Cannot access memory at address 0x0
> (gdb) info reg
> r0             0x4e	78
> r1             0x0	0
> r2             0x17c8506	24937734
> r3             0x65	101
> r4             0xbfbf7488	-1077971832
> r5             0xbfbf7484	-1077971836
> r6             0xbfbf7488	-1077971832
> r7             0x229eab40	580823872
> r8             0x0	0
> r9             0xbfbfa23c	-1077960132
> r10            0xbfbf7484	-1077971836
> r11            0x0	0
> r12            0x17ef3b1	25097137
> sp             0xbfbf7180	-1077972608
> lr             0x65	101
> pc             0xbfbf732c	-1077972180
> fps            0x0	0
> cpsr           0xa0000010	-1610612720
> 
> 
> Using -v -save-temps on one of the failing xgcc command lines gives:
> 
> root_at_bananapi-m3:/usr/obj/portswork/usr/ports/lang/gcc6/work/.build/armv6-portbld-freebsd11.0/libgcc # /usr/obj/portswork/usr/ports/lang/gcc6/work/.build/./gcc/xgcc -B/usr/obj/portswork/usr/ports/lang/gcc6/work/.build/./gcc/ -B/usr/local/armv6-portbld-freebsd11.0/bin/ -B/usr/local/armv6-portbld-freebsd11.0/lib/ -isystem /usr/local/armv6-portbld-freebsd11.0/include -isystem /usr/local/armv6-portbld-freebsd11.0/sys-include    -O2 -pipe -mcpu=cortex-a7 -DLIBICONV_PLUG -g -fno-strict-aliasing -O2  -O2 -pipe -mcpu=cortex-a7  -DLIBICONV_PLUG -g -fno-strict-aliasing -DIN_GCC    -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fPIC -pthread -fno-inline -fomit-frame-pointer -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector   -fPIC -pthread -fno-inline -fomit-frame-pointer -I. -I. -I../.././gcc -I/usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc -I/usr/obj/portswork/usr/ports/l
> ang/gcc6/work/gcc-6.2.0/libgcc/. -I/usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/../gcc -I/usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/../include  -DHAVE_CC_TLS  -o _muldi3.o -MT _muldi3.o -MD -MP -MF _muldi3.dep -DL_muldi3 -c /usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS -v -save-temps
> xgcc: warning: -pipe ignored because -save-temps specified
> Reading specs from /usr/obj/portswork/usr/ports/lang/gcc6/work/.build/./gcc/specs
> COLLECT_GCC=/usr/obj/portswork/usr/ports/lang/gcc6/work/.build/./gcc/xgcc
> Target: armv6-portbld-freebsd11.0
> Configured with: /usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/configure --disable-multilib --with-build-config=bootstrap-debug --disable-nls --enable-gnu-indirect-function --libdir=/usr/local/lib/gcc6 --libexecdir=/usr/local/libexec/gcc6 --program-suffix=6 --with-as=/usr/local/bin/as --with-gmp=/usr/local --with-gxx-include-dir=/usr/local/lib/gcc6/include/c++/ --with-ld=/usr/local/bin/ld --with-pkgversion='FreeBSD Ports Collection' --with-system-zlib --disable-libgcj --enable-languages=c,c++,objc,fortran --prefix=/usr/local --localstatedir=/var --mandir=/usr/local/man --infodir=/usr/local/info/gcc6 --build=armv6-portbld-freebsd11.0
> Thread model: posix
> gcc version 6.2.0 (FreeBSD Ports Collection) 
> COLLECT_GCC_OPTIONS='-B' '/usr/obj/portswork/usr/ports/lang/gcc6/work/.build/./gcc/' '-B' '/usr/local/armv6-portbld-freebsd11.0/bin/' '-B' '/usr/local/armv6-portbld-freebsd11.0/lib/' '-isystem' '/usr/local/armv6-portbld-freebsd11.0/include' '-isystem' '/usr/local/armv6-portbld-freebsd11.0/sys-include' '-O2' '-pipe' '-mcpu=cortex-a7' '-D' 'LIBICONV_PLUG' '-g' '-O2' '-O2' '-pipe' '-mcpu=cortex-a7' '-D' 'LIBICONV_PLUG' '-g' '-fno-strict-aliasing' '-D' 'IN_GCC' '-Wextra' '-Wall' '-Wno-narrowing' '-Wwrite-strings' '-Wcast-qual' '-Wformat=0' '-Wstrict-prototypes' '-Wmissing-prototypes' '-Wold-style-definition' '-isystem' './include' '-pthread' '-g' '-D' 'IN_LIBGCC2' '-fbuilding-libgcc' '-fno-stack-protector' '-fPIC' '-pthread' '-fno-inline' '-fomit-frame-pointer' '-I' '.' '-I' '.' '-I' '../.././gcc' '-I' '/usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc' '-I' '/usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/.' '-I' '/usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6
> .2.0/libgcc/../gcc' '-I' '/usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/../include' '-D' 'HAVE_CC_TLS' '-o' '_muldi3.o' '-MT' '_muldi3.o' '-MD' '-MP' '-MF' '_muldi3.dep' '-D' 'L_muldi3' '-c' '-fvisibility=hidden' '-D' 'HIDE_EXPORTS' '-v' '-save-temps' '-mtls-dialect=gnu'
> /usr/obj/portswork/usr/ports/lang/gcc6/work/.build/./gcc/cc1 -E -quiet -v -I . -I . -I ../.././gcc -I /usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc -I /usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/. -I /usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/../gcc -I /usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/../include -iprefix /usr/obj/portswork/usr/ports/lang/gcc6/work/.build/gcc/../lib/gcc6/gcc/armv6-portbld-freebsd11.0/6.2.0/ -isystem /usr/obj/portswork/usr/ports/lang/gcc6/work/.build/./gcc/include -isystem /usr/obj/portswork/usr/ports/lang/gcc6/work/.build/./gcc/include-fixed -MD _muldi3.d -MF _muldi3.dep -MP -MT _muldi3.o -D LIBICONV_PLUG -D LIBICONV_PLUG -D IN_GCC -D IN_LIBGCC2 -D HAVE_CC_TLS -D L_muldi3 -D HIDE_EXPORTS -isystem /usr/local/armv6-portbld-freebsd11.0/include -isystem /usr/local/armv6-portbld-freebsd11.0/sys-include -isystem ./include /usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/libgcc2.c -mcp
> u=cortex-a7 -mcpu=cortex-a7 -mtls-dialect=gnu -Wextra -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wformat=0 -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -fno-strict-aliasing -fbuilding-libgcc -fno-stack-protector -fPIC -fno-inline -fomit-frame-pointer -fvisibility=hidden -g -g -g -fworking-directory -O2 -O2 -O2 -fpch-preprocess -o libgcc2.i
> ignoring nonexistent directory "/usr/local/armv6-portbld-freebsd11.0/include"
> ignoring nonexistent directory "/usr/local/armv6-portbld-freebsd11.0/sys-include"
> ignoring nonexistent directory "./include"
> ignoring nonexistent directory "/usr/obj/portswork/usr/ports/lang/gcc6/work/.build/gcc/../lib/gcc6/gcc/armv6-portbld-freebsd11.0/6.2.0/include"
> ignoring nonexistent directory "/usr/obj/portswork/usr/ports/lang/gcc6/work/.build/gcc/../lib/gcc6/gcc/armv6-portbld-freebsd11.0/6.2.0/include-fixed"
> ignoring nonexistent directory "/usr/obj/portswork/usr/ports/lang/gcc6/work/.build/gcc/../lib/gcc6/gcc/armv6-portbld-freebsd11.0/6.2.0/../../../../../armv6-portbld-freebsd11.0/include"
> ignoring nonexistent directory "/usr/obj/portswork/usr/ports/lang/gcc6/work/.build/gcc/../lib/gcc6/gcc/../../../lib/gcc6/gcc/armv6-portbld-freebsd11.0/6.2.0/include"
> ignoring nonexistent directory "/usr/obj/portswork/usr/ports/lang/gcc6/work/.build/gcc/../lib/gcc6/gcc/../../../lib/gcc6/gcc/armv6-portbld-freebsd11.0/6.2.0/include-fixed"
> ignoring nonexistent directory "/usr/obj/portswork/usr/ports/lang/gcc6/work/.build/gcc/../lib/gcc6/gcc/../../../lib/gcc6/gcc/armv6-portbld-freebsd11.0/6.2.0/../../../../../armv6-portbld-freebsd11.0/include"
> ignoring duplicate directory "."
> ignoring duplicate directory "/usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/."
> #include "..." search starts here:
> #include <...> search starts here:
> .
> ../.././gcc
> /usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc
> /usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/../gcc
> /usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/../include
> /usr/obj/portswork/usr/ports/lang/gcc6/work/.build/./gcc/include
> /usr/obj/portswork/usr/ports/lang/gcc6/work/.build/./gcc/include-fixed
> /usr/local/include
> /usr/include
> End of search list.
> COLLECT_GCC_OPTIONS='-B' '/usr/obj/portswork/usr/ports/lang/gcc6/work/.build/./gcc/' '-B' '/usr/local/armv6-portbld-freebsd11.0/bin/' '-B' '/usr/local/armv6-portbld-freebsd11.0/lib/' '-isystem' '/usr/local/armv6-portbld-freebsd11.0/include' '-isystem' '/usr/local/armv6-portbld-freebsd11.0/sys-include' '-O2' '-pipe' '-mcpu=cortex-a7' '-D' 'LIBICONV_PLUG' '-g' '-O2' '-O2' '-pipe' '-mcpu=cortex-a7' '-D' 'LIBICONV_PLUG' '-g' '-fno-strict-aliasing' '-D' 'IN_GCC' '-Wextra' '-Wall' '-Wno-narrowing' '-Wwrite-strings' '-Wcast-qual' '-Wformat=0' '-Wstrict-prototypes' '-Wmissing-prototypes' '-Wold-style-definition' '-isystem' './include' '-pthread' '-g' '-D' 'IN_LIBGCC2' '-fbuilding-libgcc' '-fno-stack-protector' '-fPIC' '-pthread' '-fno-inline' '-fomit-frame-pointer' '-I' '.' '-I' '.' '-I' '../.././gcc' '-I' '/usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc' '-I' '/usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/.' '-I' '/usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6
> .2.0/libgcc/../gcc' '-I' '/usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/../include' '-D' 'HAVE_CC_TLS' '-o' '_muldi3.o' '-MT' '_muldi3.o' '-MD' '-MP' '-MF' '_muldi3.dep' '-D' 'L_muldi3' '-c' '-fvisibility=hidden' '-D' 'HIDE_EXPORTS' '-v' '-save-temps' '-mtls-dialect=gnu'
> /usr/obj/portswork/usr/ports/lang/gcc6/work/.build/./gcc/cc1 -fpreprocessed libgcc2.i -quiet -dumpbase libgcc2.c -mcpu=cortex-a7 -mcpu=cortex-a7 -mtls-dialect=gnu -auxbase-strip _muldi3.o -g -g -g -O2 -O2 -O2 -Wextra -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wformat=0 -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -version -fno-strict-aliasing -fbuilding-libgcc -fno-stack-protector -fPIC -fno-inline -fomit-frame-pointer -fvisibility=hidden -o libgcc2.s
> GNU C11 (FreeBSD Ports Collection) version 6.2.0 (armv6-portbld-freebsd11.0)
> 	compiled by GNU C version 4.2.1 Compatible FreeBSD Clang 3.8.0 (tags/RELEASE_380/final 262564), GMP version 5.1.3, MPFR version 3.1.5, MPC version 1.0.3, isl version none
> GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
> GNU C11 (FreeBSD Ports Collection) version 6.2.0 (armv6-portbld-freebsd11.0)
> 	compiled by GNU C version 4.2.1 Compatible FreeBSD Clang 3.8.0 (tags/RELEASE_380/final 262564), GMP version 5.1.3, MPFR version 3.1.5, MPC version 1.0.3, isl version none
> GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
> Compiler executable checksum: 8858bcab14af90339532fc36ec745f79
> xgcc: internal compiler error: Bad system call (program cc1)
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <http://gcc.gnu.org/bugs.html> for instructions.
> 
> root_at_bananapi-m3:/usr/obj/portswork/usr/ports/lang/gcc6/work/.build/armv6-portbld-freebsd11.0/libgcc # ls -lt | head
> total 12712
> -rw-------  1 root  wheel  12181504 Oct 25 16:57 cc1.core
> -rw-r--r--  1 root  wheel         0 Oct 25 16:57 libgcc2.s
> -rw-r--r--  1 root  wheel    108880 Oct 25 16:57 libgcc2.i
> -rw-r--r--  1 root  wheel      7636 Oct 25 16:57 _muldi3.dep
> -rw-r--r--  1 root  wheel       560 Oct 25 10:16 _ucmpdi2.o
> -rw-r--r--  1 root  wheel       560 Oct 25 10:16 _cmpdi2.o
> -rw-r--r--  1 root  wheel       560 Oct 25 10:16 _negdi2.o
> -rw-r--r--  1 root  wheel       560 Oct 25 10:16 _muldi3.o
> -rw-r--r--  1 root  wheel      1784 Oct 25 10:16 _dvmd_lnx_s.o
> 
> Unfortunately direct execution of the reported cc1 command on the libgcc2.i in question does not fail.
> 
> Attempting to run the xgcc command under truss got a segmentation fault in truss itself:
> 
> root_at_bananapi-m3:/usr/obj/portswork/usr/ports/lang/gcc6/work/.build/armv6-portbld-freebsd11.0/libgcc # truss -faeH -o truss.log /usr/obj/portswork/usr/ports/lang/gcc6/work/.build/./gcc/xgcc -B/usr/obj/portswork/usr/ports/lang/gcc6/work/.build/./gcc/ -B/usr/local/armv6-portbld-freebsd11.0/bin/ -B/usr/local/armv6-portbld-freebsd11.0/lib/ -isystem /usr/local/armv6-portbld-freebsd11.0/include -isystem /usr/local/armv6-portbld-freebsd11.0/sys-include -O2 -pipe -mcpu=cortex-a7 -DLIBICONV_PLUG -g -fno-strict-aliasing -O2 -O2 -pipe -mcpu=cortex-a7 -DLIBICONV_PLUG -g -fno-strict-aliasing -DIN_GCC -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -pthread -fno-inline -fomit-frame-pointer -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -fPIC -pthread -fno-inline -fomit-frame-pointer -I. -I. -I../.././gcc -I/usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc -I/usr/obj/portswork
> /usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/. -I/usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/../gcc -I/usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/../include -DHAVE_CC_TLS -o _muldi3.o -MT _muldi3.o -MD -MP -MF _muldi3.dep -DL_muldi3 -c /usr/obj/portswork/usr/ports/lang/gcc6/work/gcc-6.2.0/libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS
> Segmentation fault (core dumped)
> 
> [There is a separate buzilla report about this truss failure.]
> 
> ===
> Mark Millard
> markmi at dsl-only.net
Received on Wed Oct 26 2016 - 20:24:43 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:08 UTC