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

* [Bug bootstrap/47243] [4.6 Regression] Bootstrap fails: Segfault of genmddeps  / COLLECT bug?
  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 ` hjl.tools at gmail dot com
  2011-01-10 17:04 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2011-01-10 16:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> 2011-01-10 16:00:45 UTC ---
Since you use LTO, you should try the Linux binutils 2.21.51.0.5.


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

* [Bug bootstrap/47243] [4.6 Regression] Bootstrap fails: Segfault of genmddeps  / COLLECT bug?
  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
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-01-10 17:04 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.6.0

--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-01-10 17:01:44 UTC ---
HJ, your comment doesn't make sense, there is no LTO bytecode involved, so
we shouldn't use the plugin linker (nor should it break anything).

See also PR47244.


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

* [Bug bootstrap/47243] [4.6 Regression] Bootstrap fails: Segfault of genmddeps  / COLLECT bug?
  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
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-01-10 17:15 UTC (permalink / raw)
  To: gcc-bugs

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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu.org

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-01-10 17:12:03 UTC ---
Worked with: r168582 (2011-01-07)
Fails with:  r168598 (2011-01-08)

My guess is that Honza's r168593 exposes the issue. I now try to build without
--enable-gold --with-plugin-ld=/usr/bin/gold.

The failure occurred with both the 2.20.0.20100122-42 build of openSUSE factory
and with a stock binutils-2.21.


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

* [Bug bootstrap/47243] [4.6 Regression] Bootstrap fails: Segfault of genmddeps  / COLLECT bug?
  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
                   ` (2 preceding siblings ...)
  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
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2011-01-10 17:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from H.J. Lu <hjl.tools at gmail dot com> 2011-01-10 17:49:23 UTC ---
(In reply to comment #3)
> Worked with: r168582 (2011-01-07)
> Fails with:  r168598 (2011-01-08)
> 
> My guess is that Honza's r168593 exposes the issue. I now try to build without
> --enable-gold --with-plugin-ld=/usr/bin/gold.
> 
> The failure occurred with both the 2.20.0.20100122-42 build of openSUSE factory
> and with a stock binutils-2.21.

If you want to use BFD linker for LTO plugin, you need the Linux binutils
2.21.51.0.5. LTO plugin support in binutils-2.21 is incomplete.


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

* [Bug bootstrap/47243] [4.6 Regression] Bootstrap fails: Segfault of genmddeps  / COLLECT bug?
  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
                   ` (3 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-01-11 12:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-01-11 12:44:57 UTC ---
(In reply to comment #4)
> (In reply to comment #3)
> > Worked with: r168582 (2011-01-07)
> > Fails with:  r168598 (2011-01-08)
> > 
> > My guess is that Honza's r168593 exposes the issue. I now try to build without
> > --enable-gold --with-plugin-ld=/usr/bin/gold.
> > 
> > The failure occurred with both the 2.20.0.20100122-42 build of openSUSE factory
> > and with a stock binutils-2.21.
> 
> If you want to use BFD linker for LTO plugin, you need the Linux binutils
> 2.21.51.0.5. LTO plugin support in binutils-2.21 is incomplete.

I hope it will be fixed on the 2.21 branch.  Using linux binutils isn't
possible.


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

* [Bug bootstrap/47243] [4.6 Regression] Bootstrap fails: Segfault of genmddeps  / COLLECT bug?
  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
                   ` (4 preceding siblings ...)
  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
  7 siblings, 0 replies; 9+ messages in thread
From: hubicka at ucw dot cz @ 2011-01-11 13:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jan Hubicka <hubicka at ucw dot cz> 2011-01-11 13:06:18 UTC ---
> > If you want to use BFD linker for LTO plugin, you need the Linux binutils
> > 2.21.51.0.5. LTO plugin support in binutils-2.21 is incomplete.
> 
> I hope it will be fixed on the 2.21 branch.  Using linux binutils isn't
> possible.

I am using slightly pre 2.21 GNU LD and it works for me for bootstrap.
It has the TLS bug for Mozilla.  I think we should analyze the PR and
fill in binutils bug if it apply, but this looks more like a GCC bug.

Honza


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

* [Bug bootstrap/47243] [4.6 Regression] Bootstrap fails: Segfault of genmddeps  / COLLECT bug?
  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
                   ` (5 preceding siblings ...)
  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
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-02-08 14:13 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2011.02.08 14:05:51
     Ever Confirmed|0                           |1

--- Comment #7 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-02-08 14:05:51 UTC ---
I can't reproduce it (neither with nor without -flto).  Please specify your
target, your binutils version and how you configured GCC.  Or close the bug
if it no longer reproduces for you.


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

* [Bug bootstrap/47243] [4.6 Regression] Bootstrap fails: Segfault of genmddeps  / COLLECT bug?
  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
                   ` (6 preceding siblings ...)
  2011-02-08 14:13 ` rguenth at gcc dot gnu.org
@ 2011-02-08 18:24 ` burnus at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-02-08 18:24 UTC (permalink / raw)
  To: gcc-bugs

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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |FIXED

--- Comment #8 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-02-08 18:01:31 UTC ---
Seems to be fixed. I think it was fixed by the patch for PR 47244 - sorry for
forgetting to update this PR.


^ 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).