NetBSD Problem Report #51586
From www@NetBSD.org Mon Oct 31 03:40:25 2016
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
by mollari.NetBSD.org (Postfix) with ESMTPS id BA08D7A2B6
for <gnats-bugs@gnats.NetBSD.org>; Mon, 31 Oct 2016 03:40:25 +0000 (UTC)
Message-Id: <20161031034024.9F7A17A2C8@mollari.NetBSD.org>
Date: Mon, 31 Oct 2016 03:40:24 +0000 (UTC)
From: sdhoya@z-planet.co.jp
Reply-To: sdhoya@z-planet.co.jp
To: gnats-bugs@NetBSD.org
Subject: internal compiler error
X-Send-Pr-Version: www-1.0
>Number: 51586
>Category: bin
>Synopsis: internal compiler error
>Confidential: no
>Severity: critical
>Priority: low
>Responsible: bin-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Oct 31 03:45:00 +0000 2016
>Closed-Date: Wed Jan 17 00:27:50 +0000 2018
>Last-Modified: Wed Jan 17 00:27:50 +0000 2018
>Originator: DOYASHIKI Shinichi
>Release: NetBSD 7.99.40
>Organization:
Zenken Corporation
>Environment:
NetBSD smsdc0.hq.z-planet.co.jp 7.99.40 NetBSD 7.99.40 (SMSDC) #0: Fri Oct 21 10:12:11 JST 2016 sdhoya@smsdc0.hq.z-planet.co.jp:/export/stage/src/sys/arch/amd64/compile/SMSDC amd64
>Description:
internal compiler error generated after "make build".
cvs update'd in this morning (problematic older sources are lost).
# cd /path/to/src; make -j3 build
$ cat main.c
#include <stdio.h>
int main()
{
printf("compiler ok\n");
return 0;
}
$ make main
cc -O2 -o main main.c
cc: internal compiler error: Segmentation fault (program as received signal 11)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://www.NetBSD.org/support/send-pr.html> for instructions.
*** Error code 4
Stop.
make: stopped in /export/pgsql/work
$ as --version
GNU assembler (NetBSD Binutils nb1) 2.26.1
Copyright (C) 2015 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `x86_64--netbsd'.
$ ld --version
GNU ld (NetBSD Binutils nb1) 2.26.1
Copyright (C) 2015 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
$ gdb /usr/bin/as as.core
GNU gdb (GDB) 7.12
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64--netbsd".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/as...(no debugging symbols found)...done.
[New process 1]
Core was generated by `as'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x000076e5b530c056 in strcmp () from /usr/lib/libc.so.12
(gdb) bt
#0 0x000076e5b530c056 in strcmp () from /usr/lib/libc.so.12
#1 0x000000002b03b358 in md_begin ()
#2 0x000000002b05df26 in main ()
(gdb) quit
>How-To-Repeat:
unknown
>Fix:
unknown
>Release-Note:
>Audit-Trail:
From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: bin/51586: internal compiler error
Date: Mon, 31 Oct 2016 03:54:19 +0000
On Mon Oct 31 03:45:00 +0000 2016 DOYASHIKI Shinichi wrote:
> int main()
> {
> printf("compiler ok\n");
> return 0;
> }
> $ make main
> cc -O2 -o main main.c
> cc: internal compiler error: Segmentation fault (program as received signal 11)
>
> :
>
> (gdb) bt
> #0 0x000076e5b530c056 in strcmp () from /usr/lib/libc.so.12
> #1 0x000000002b03b358 in md_begin ()
> #2 0x000000002b05df26 in main ()
Curious... can you extract the generated assembly, and find the exact
way it's invoking as? If you run as directly on the assembly file with
the same arguments, does it still crash?
(use -S to compile to assembly, -v to show the invocation)
--
David A. Holland
dholland@netbsd.org
From: sdhoya <sdhoya@z-planet.co.jp>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: bin/51586: internal compiler error
Date: Mon, 31 Oct 2016 18:15:23 +0900
On Mon, 31 Oct 2016 03:55:02 +0000 (UTC)
David Holland <dholland-bugs@netbsd.org> wrote:
> Curious... can you extract the generated assembly, and find the exact
> way it's invoking as? If you run as directly on the assembly file with
> the same arguments, does it still crash?
>
> (use -S to compile to assembly, -v to show the invocation)
thank you, result follows...
$ cat Makefile
PROG=main
SRCS=main.c
NOMAN=1
DBG+=-v
.include <bsd.prog.mk>
main.s: main.c
gcc -O2 -v -fPIE -std=gnu99 -S main.c
main.o: main.s
gcc -v -fPIE -std=gnu99 -c main.s
$ cat main.c
#include <stdio.h>
int main()
{
printf("compiler ok\n");
return 0;
}
$ make
rm -f .gdbinit
touch .gdbinit
gcc -O2 -v -fPIE -std=gnu99 -S main.c
Using built-in specs.
COLLECT_GCC=gcc
Target: x86_64--netbsd
Configured with: /usr/src/tools/gcc/../../external/gpl3/gcc/dist/configure --target=x86_64--netbsd --enable-long-long --enable-threads --with-bugurl=http://www.NetBSD.org/Misc/send-pr.html --with-pkgversion='NetBSD nb1 20160606' --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-time=rt --enable-libstdcxx-threads --with-tune=nocona --with-diagnostics-color=auto-if-env --with-mpc-lib=/var/obj/mknative/amd64-x86_64/usr/src/external/lgpl3/mpc/lib/libmpc --with-mpfr-lib=/var/obj/mknative/amd64-x86_64/usr/src/external/lgpl3/mpfr/lib/libmpfr --with-gmp-lib=/var/obj/mknative/amd64-x86_64/usr/src/external/lgpl3/gmp/lib/libgmp --with-mpc-include=/usr/src/external/lgpl3/mpc/dist/src --with-mpfr-include=/usr/src/external/lgpl3/mpfr/dist/src --with-gmp-include=/usr/src/external/lgpl3/gmp/lib/libgmp/arch/x86_64 --enable-tls --disable-multilib --disable-symvers --disable-libstdcxx-pch --build=x86_64-unknown-netbsd7.0 --host=x86_64--netbsd --with-sysroot=/var/obj/mknative/amd64-x86
_64/usr/src/destdir.amd64
Thread model: posix
gcc version 5.4.0 (nb1 20160606)
COLLECT_GCC_OPTIONS='-O2' '-v' '-fPIE' '-std=gnu99' '-S' '-mtune=nocona' '-march=x86-64'
/usr/libexec/cc1 -quiet -v main.c -quiet -dumpbase main.c -mtune=nocona -march=x86-64 -auxbase main -O2 -std=gnu99 -version -fPIE -o main.s
GNU C99 (nb1 20160606) version 5.4.0 (x86_64--netbsd)
compiled by GNU C version 5.4.0, GMP version 5.1.3, MPFR version 3.1.2, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
#include "..." search starts here:
#include <...> search starts here:
/usr/include/gcc-5
/usr/include
End of search list.
GNU C99 (nb1 20160606) version 5.4.0 (x86_64--netbsd)
compiled by GNU C version 5.4.0, GMP version 5.1.3, MPFR version 3.1.2, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: c65940dbff8f1f236f75b65716e6d605
COMPILER_PATH=/usr/libexec/
LIBRARY_PATH=/usr/lib/
COLLECT_GCC_OPTIONS='-O2' '-v' '-fPIE' '-std=gnu99' '-S' '-mtune=nocona' '-march=x86-64'
gcc -v -fPIE -std=gnu99 -c main.s
Using built-in specs.
COLLECT_GCC=gcc
Target: x86_64--netbsd
Configured with: /usr/src/tools/gcc/../../external/gpl3/gcc/dist/configure --target=x86_64--netbsd --enable-long-long --enable-threads --with-bugurl=http://www.NetBSD.org/Misc/send-pr.html --with-pkgversion='NetBSD nb1 20160606' --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-time=rt --enable-libstdcxx-threads --with-tune=nocona --with-diagnostics-color=auto-if-env --with-mpc-lib=/var/obj/mknative/amd64-x86_64/usr/src/external/lgpl3/mpc/lib/libmpc --with-mpfr-lib=/var/obj/mknative/amd64-x86_64/usr/src/external/lgpl3/mpfr/lib/libmpfr --with-gmp-lib=/var/obj/mknative/amd64-x86_64/usr/src/external/lgpl3/gmp/lib/libgmp --with-mpc-include=/usr/src/external/lgpl3/mpc/dist/src --with-mpfr-include=/usr/src/external/lgpl3/mpfr/dist/src --with-gmp-include=/usr/src/external/lgpl3/gmp/lib/libgmp/arch/x86_64 --enable-tls --disable-multilib --disable-symvers --disable-libstdcxx-pch --build=x86_64-unknown-netbsd7.0 --host=x86_64--netbsd --with-sysroot=/var/obj/mknative/amd64-x86
_64/usr/src/destdir.amd64
Thread model: posix
gcc version 5.4.0 (nb1 20160606)
COLLECT_GCC_OPTIONS='-v' '-fPIE' '-std=gnu99' '-c' '-mtune=nocona' '-march=x86-64'
as -v -o main.o main.s
GNU assembler version 2.26.1 (x86_64--netbsd) using BFD version (NetBSD Binutils nb1) 2.26.1
gcc: internal compiler error: Segmentation fault (program as received signal 11)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://www.NetBSD.org/support/send-pr.html> for instructions.
*** Error code 4
Stop.
make: stopped in /export/stage/main
$ gdb /usr/bin/as as.core
GNU gdb (GDB) 7.12
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64--netbsd".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/as...(no debugging symbols found)...done.
[New process 1]
Core was generated by `as'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x000071a148d0c056 in strcmp () from /usr/lib/libc.so.12
(gdb) bt
#0 0x000071a148d0c056 in strcmp () from /usr/lib/libc.so.12
#1 0x00000000b8a3b358 in md_begin ()
#2 0x00000000b8a5df26 in main ()
(gdb) quit
$ cat main.s
.file "main.c"
.section .rodata.str1.1,"aMS",@progbits,1
.LC0:
.string "compiler ok"
.section .text.unlikely,"ax",@progbits
.LCOLDB1:
.section .text.startup,"ax",@progbits
.LHOTB1:
.globl main
.type main, @function
main:
.LFB3:
.cfi_startproc
subq $8, %rsp
.cfi_def_cfa_offset 16
leaq .LC0(%rip), %rdi
call puts@PLT
xorl %eax, %eax
addq $8, %rsp
.cfi_def_cfa_offset 8
ret
.cfi_endproc
.LFE3:
.size main, .-main
.section .text.unlikely
.LCOLDE1:
.section .text.startup
.LHOTE1:
.ident "GCC: (nb1 20160606) 5.4.0"
$ as -v -o main.o main.s
GNU assembler version 2.26.1 (x86_64--netbsd) using BFD version (NetBSD Binutils nb1) 2.26.1
[1] Segmentation fault (core dumped) as -v -o main.o main.s
$ ldd /usr/bin/as
/usr/bin/as:
-lopcodes.7 => /usr/lib/libopcodes.so.7
-lc.12 => /usr/lib/libc.so.12
-lbfd.14 => /usr/lib/libbfd.so.14
-lz.1 => /usr/lib/libz.so.1
-lintl.1 => /usr/lib/libintl.so.1
-lm.0 => /usr/lib/libm.so.0
----
DOYASHIKI Shinichi <sdhoya@z-planet.co.jp>
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: sdhoya@z-planet.co.jp
Subject: Re: bin/51586: internal compiler error
Date: Mon, 31 Oct 2016 11:44:52 +0100
gcc: internal compiler error: Segmentation fault (program as received signal
11)
I saw exactly that with a semi-updated current. Finalizing the installation
(so as becomes 2.27) fixed it.
How did you update this machine? Something is wrong, you still have the
old binutils version (but probably new libbfd or something).
Martin
From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org,
sdhoya@z-planet.co.jp
Cc:
Subject: Re: bin/51586: internal compiler error
Date: Mon, 31 Oct 2016 10:22:11 -0400
On Oct 31, 10:35am, sdhoya@z-planet.co.jp (sdhoya) wrote:
-- Subject: Re: bin/51586: internal compiler error
| The following reply was made to PR bin/51586; it has been noted by GNATS.
|
| From: sdhoya <sdhoya@z-planet.co.jp>
| To: gnats-bugs@NetBSD.org
| Cc:
| Subject: Re: bin/51586: internal compiler error
| Date: Mon, 31 Oct 2016 18:15:23 +0900
|
| On Mon, 31 Oct 2016 03:55:02 +0000 (UTC)
| David Holland <dholland-bugs@netbsd.org> wrote:
|
| > Curious... can you extract the generated assembly, and find the exact
| > way it's invoking as? If you run as directly on the assembly file with
| > the same arguments, does it still crash?
| >
| > (use -S to compile to assembly, -v to show the invocation)
|
| thank you, result follows...
Did you build the toolchain yourself, or is this with a downloaded binary?
I can't reproduce this.
christos
From: Patrick Welche <prlw1@cam.ac.uk>
To: gnats-bugs@NetBSD.org
Cc: prlw1@cam.ac.uk
Subject: Re: bin/51586: internal compiler error
Date: Mon, 31 Oct 2016 15:45:07 +0000
On Mon, Oct 31, 2016 at 02:25:00PM +0000, Christos Zoulas wrote:
> The following reply was made to PR bin/51586; it has been noted by GNATS.
>
> From: christos@zoulas.com (Christos Zoulas)
> To: gnats-bugs@NetBSD.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org,
> sdhoya@z-planet.co.jp
> Cc:
> Subject: Re: bin/51586: internal compiler error
> Date: Mon, 31 Oct 2016 10:22:11 -0400
>
> On Oct 31, 10:35am, sdhoya@z-planet.co.jp (sdhoya) wrote:
> -- Subject: Re: bin/51586: internal compiler error
>
> | The following reply was made to PR bin/51586; it has been noted by GNATS.
> |
> | From: sdhoya <sdhoya@z-planet.co.jp>
> | To: gnats-bugs@NetBSD.org
> | Cc:
> | Subject: Re: bin/51586: internal compiler error
> | Date: Mon, 31 Oct 2016 18:15:23 +0900
> |
> | On Mon, 31 Oct 2016 03:55:02 +0000 (UTC)
> | David Holland <dholland-bugs@netbsd.org> wrote:
> |
> | > Curious... can you extract the generated assembly, and find the exact
> | > way it's invoking as? If you run as directly on the assembly file with
> | > the same arguments, does it still crash?
> | >
> | > (use -S to compile to assembly, -v to show the invocation)
> |
> | thank you, result follows...
>
> Did you build the toolchain yourself, or is this with a downloaded binary?
> I can't reproduce this.
I just built a fresh release with this morning's HEAD on a working
-current/amd64 box. That box has
GNU assembler (NetBSD Binutils nb1) 2.26.1
I unpacked the comp.tgz which it generated on the broken -current/amd64 box
I mentioned on current-users, and
$ gcc -v -o hellow hellow.c -Wall
...
gcc version 5.4.0 (nb1 20160606)
...
COLLECT_GCC_OPTIONS='-v' '-o' 'hellow' '-Wall' '-mtune=nocona' '-march=x86-64'
as -v -o /var/tmp//ccsSnHDU.o /var/tmp//ccuDqDqB.s
GNU assembler version 2.27 (x86_64--netbsd) using BFD version (NetBSD Binutils nb1) 2.27
...
COLLECT_GCC_OPTIONS='-v' '-o' 'hellow' '-Wall' '-mtune=nocona' '-march=x86-64'
ld -plugin /usr/libexec/liblto_plugin.so -plugin-opt=/usr/libexec/lto-wrapper -plugin-opt=-fresolution=/var/tmp//ccrSXbZ4.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --eh-frame-hdr -dc -dp -e _start -dynamic-linker /usr/libexec/ld.elf_so -o hellow /usr/lib/crt0.o /usr/lib/crti.o /usr/lib/crtbegin.o /var/tmp//ccsSnHDU.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/crtend.o /usr/lib/crtn.o
gcc: internal compiler error: Segmentation fault (program ld received signal 11)
Please submit a full bug report,
I have as.core and ld.core in the build directory.
From: DOYASHIKI Shinichi <sdhoya@z-planet.co.jp>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: bin/51586: internal compiler error
Date: Tue, 1 Nov 2016 12:56:13 +0900
On Mon, 31 Oct 2016 14:25:00 +0000 (UTC)
christos@zoulas.com (Christos Zoulas) wrote:
> The following reply was made to PR bin/51586; it has been noted by GNATS.
>
> From: christos@zoulas.com (Christos Zoulas)
> To: gnats-bugs@NetBSD.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org,
> sdhoya@z-planet.co.jp
> Cc:
> Subject: Re: bin/51586: internal compiler error
> Date: Mon, 31 Oct 2016 10:22:11 -0400
>
> On Oct 31, 10:35am, sdhoya@z-planet.co.jp (sdhoya) wrote:
> -- Subject: Re: bin/51586: internal compiler error
>
> | The following reply was made to PR bin/51586; it has been noted by GNATS.
> |
> | From: sdhoya <sdhoya@z-planet.co.jp>
> | To: gnats-bugs@NetBSD.org
> | Cc:
> | Subject: Re: bin/51586: internal compiler error
> | Date: Mon, 31 Oct 2016 18:15:23 +0900
> |
> | On Mon, 31 Oct 2016 03:55:02 +0000 (UTC)
> | David Holland <dholland-bugs@netbsd.org> wrote:
> |
> | > Curious... can you extract the generated assembly, and find the exact
> | > way it's invoking as? If you run as directly on the assembly file with
> | > the same arguments, does it still crash?
> | >
> | > (use -S to compile to assembly, -v to show the invocation)
> |
> | thank you, result follows...
>
> Did you build the toolchain yourself, or is this with a downloaded binary?
> I can't reproduce this.
>
> christos
>
i usualy run "make build" instead of "build.sh release", and no fetching
official snapshot binaries.
i learned the libbfd library was not major bumped on current,
and this is the way of today's NetBSD-current.
so i backouted binaries on the machine from backup tarball,
and rebuilding (running "build.sh release") now.
problematic binaries are kept yet to anothor dir for chroot.
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: bin/51586: internal compiler error
Date: Tue, 1 Nov 2016 11:25:10 +0100
On Tue, Nov 01, 2016 at 04:00:01AM +0000, DOYASHIKI Shinichi wrote:
> i learned the libbfd library was not major bumped on current,
> and this is the way of today's NetBSD-current.
We should belatedly bump it. It is definitely not compatible
with the old one, and other third party/pkgsrc binaries may be affected.
Martin
From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org,
sdhoya@z-planet.co.jp
Cc:
Subject: Re: bin/51586: internal compiler error
Date: Tue, 1 Nov 2016 08:11:47 -0400
On Nov 1, 10:30am, martin@duskware.de (Martin Husemann) wrote:
-- Subject: Re: bin/51586: internal compiler error
| The following reply was made to PR bin/51586; it has been noted by GNATS.
|
| From: Martin Husemann <martin@duskware.de>
| To: gnats-bugs@NetBSD.org
| Cc:
| Subject: Re: bin/51586: internal compiler error
| Date: Tue, 1 Nov 2016 11:25:10 +0100
|
| On Tue, Nov 01, 2016 at 04:00:01AM +0000, DOYASHIKI Shinichi wrote:
| > i learned the libbfd library was not major bumped on current,
| > and this is the way of today's NetBSD-current.
|
| We should belatedly bump it. It is definitely not compatible
| with the old one, and other third party/pkgsrc binaries may be affected.
Yes, I will do it.
christos
From: matthew green <mrg@eterna.com.au>
To: gnats-bugs@NetBSD.org
Cc: gnats-admin@netbsd.org, netbsd-bugs@netbsd.org,
sdhoya@z-planet.co.jp
Subject: re: bin/51586: internal compiler error
Date: Wed, 09 Nov 2016 06:43:30 +1100
> We should belatedly bump it. It is definitely not compatible
> with the old one, and other third party/pkgsrc binaries may be affected.
there is little to zero chance of 3rd party apps failing -- we don't
install the headers so there is no easy way to access it.
.mrg.
State-Changed-From-To: open->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Wed, 17 Jan 2018 00:27:50 +0000
State-Changed-Why:
It was libbfd that was belatedly major bump (and unlikely others that haven't run into it will do now).
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.