public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/47243] New: [4.6 Regression] Bootstrap fails: Segfault of genmddeps  / COLLECT bug?
@ 2011-01-10 16:00 burnus at gcc dot gnu.org
  2011-01-10 16:09 ` [Bug bootstrap/47243] " hjl.tools at gmail dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-01-10 16:00 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47243

           Summary: [4.6 Regression] Bootstrap fails: Segfault of
                    genmddeps  / COLLECT bug?
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org


As mentioned by me at http://gcc.gnu.org/ml/gcc-patches/2011-01/msg00439.html,
I get the following segfault during building Stage 2:

Starting program: /projects/tob/gcc-git/gcc-build/gcc/build/genmddeps
/projects/tob/gcc-git/gcc/gcc/config/i386/i386.md

Program received signal SIGSEGV, Segmentation fault.

(gdb) run
Starting program: /projects/tob/gcc-git/gcc-build/gcc/build/genmddeps

Breakpoint 5, handle_toplevel_file (handle_directive=0) at
/home/tob/projects/gcc-git/gcc/gcc/read-md.c:991
991       lastsl = strrchr (in_fname, '/');
(gdb) ptype lastsl
type = char *
(gdb) ptype in_fname
type = const char *
(gdb) p in_fname
$1 = 0x4054c9 "<stdin>"
(gdb) p strrchr
$2 = -831647898
(gdb) s

Program received signal SIGSEGV, Segmentation fault.
0x0000000000407510 in strrchr ()

 * * *

Test case:

#include <string.h>
const char *read_md_filename;
const char *in_fname;

int
main ()
{
  char *resstr;
  read_md_filename = "<stdin>";
  in_fname = read_md_filename;
  resstr = strrchr (in_fname, '/');
  return 0;
}


Compiling and linking with the system compiler works:

$ gcc -c -g foo.c
$ gcc foo.o
$ ./a.out

But if I link with the stage 2 compiler, it fails:

$ /home/tob/projects/gcc-git/gcc-build/./prev-gcc/collect2 -plugin
/home/tob/projects/gcc-git/gcc-build/./prev-gcc/liblto_plugin.so
-plugin-opt=/home/tob/projects/gcc-git/gcc-build/./prev-gcc/lto-wrapper
-plugin-opt=-fresolution=/tmp/cc5dUxER.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 -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2
/usr/lib/../lib64/crt1.o /usr/lib/../lib64/crti.o
/home/tob/projects/gcc-git/gcc-build/./prev-gcc/crtbegin.o
-L/home/tob/projects/gcc-git/gcc-build/./prev-gcc -L/lib/../lib64
-L/usr/lib/../lib64 foo.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc
--as-needed -lgcc_s --no-as-needed
/home/tob/projects/gcc-git/gcc-build/./prev-gcc/crtend.o
/usr/lib/../lib64/crtn.o
$ ./a.out
Segmentation fault (core dumped)


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-02-08 18:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-10 16:00 [Bug bootstrap/47243] New: [4.6 Regression] Bootstrap fails: Segfault of genmddeps / COLLECT bug? burnus at gcc dot gnu.org
2011-01-10 16:09 ` [Bug bootstrap/47243] " hjl.tools at gmail dot com
2011-01-10 17:04 ` rguenth at gcc dot gnu.org
2011-01-10 17:15 ` burnus at gcc dot gnu.org
2011-01-10 17:55 ` hjl.tools at gmail dot com
2011-01-11 12:50 ` rguenth at gcc dot gnu.org
2011-01-11 13:22 ` hubicka at ucw dot cz
2011-02-08 14:13 ` rguenth at gcc dot gnu.org
2011-02-08 18:24 ` burnus at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).