Bug 12776 - [3.4 Regression] Seg Fault when <iostream> included
Summary: [3.4 Regression] Seg Fault when <iostream> included
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.4.0
: P2 critical
Target Milestone: 3.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2003-10-26 02:54 UTC by James McKelvey
Modified: 2004-01-17 04:22 UTC (History)
3 users (show)

See Also:
Host: alphaev56-unknown-linux-gnu
Target: alphaev56-unknown-linux-gnu
Build: alphaev56-unknown-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2003-10-26 06:39:53


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James McKelvey 2003-10-26 02:54:47 UTC
This program:

#include <iostream>

int

main(int,
     char **)
{
    return 0;
}

compiled via

Reading specs from /usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.4/specs
Configured with: ../gcc/configure --verbose --enable-languages=c++
Thread model: posix
gcc version 3.4 20031023 (experimental)
 /usr/local/libexec/gcc/alphaev56-unknown-linux-gnu/3.4/cc1plus -quiet -v y.cc
-quiet -dumpbase y.cc -mcpu=ev56 -auxbase y -g -version -o /tmp/cceDpqx3.s
ignoring nonexistent directory "NONE/include"
ignoring nonexistent directory
"/usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.4/../../../../alphaev56-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.4/../../../../include/c++/3.4

/usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.4/../../../../include/c++/3.4/alphaev56-unknown-linux-gnu

/usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.4/../../../../include/c++/3.4/backward
 /usr/local/include
 /usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.4/include
 /usr/include
End of search list.
GNU C++ version 3.4 20031023 (experimental) (alphaev56-unknown-linux-gnu)
	compiled by GNU C version 3.4 20031023 (experimental).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096

/usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.4/../../../../alphaev56-unknown-linux-gnu/bin/as
-no-mdebug -o /tmp/ccpT69s7.o /tmp/cceDpqx3.s
 /usr/local/libexec/gcc/alphaev56-unknown-linux-gnu/3.4/collect2 --eh-frame-hdr
-m elf64alpha -O1 -dynamic-linker /lib/ld-linux.so.2 -o y
/usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.4/../../../crt1.o
/usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.4/../../../crti.o
/usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.4/crtbegin.o
-L/usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.4
-L/usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.4/../../../../alphaev56-unknown-linux-gnu/lib
-L/usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.4/../../.. /tmp/ccpT69s7.o
-lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc
/usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.4/crtend.o
/usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.4/../../../crtn.o

seg faults. gdb 5.3 reports:

GNU gdb 5.3
Copyright 2002 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 "alphaev56-unknown-linux-gnu"...

Core was generated by `./y'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/local/lib/libstdc++.so.6...done.
Loaded symbols for /usr/local/lib/libstdc++.so.6
Reading symbols from /lib/libm.so.6.1...done.
Loaded symbols for /lib/libm.so.6.1
Reading symbols from /usr/local/lib/libgcc_s.so.1...done.
Loaded symbols for /usr/local/lib/libgcc_s.so.1
Reading symbols from /lib/libc.so.6.1...done.
Loaded symbols for /lib/libc.so.6.1
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2

warning: Hit heuristic-fence-post without finding

warning: enclosing function for address 0xa09f000000200
This warning occurs if you are debugging a function without any symbols
(for example, in a stripped executable).  In that case, you may wish to
increase the size of the search with the `set heuristic-fence-post' command.

Otherwise, you told GDB there was a function where there isn't one, or
(more likely) you have encountered a bug in GDB.

warning: Hit heuristic-fence-post without finding

warning: enclosing function for address 0xa09f000000200
#0  0x000a09f000000200 in ?? ()
(gdb) bt
#0  0x000a09f000000200 in ?? ()
#1  0x0000020000099d10 in _Impl (this=0x2000013ff80, __refs=2199024562468)
    at ../../../../gcc/libstdc++-v3/src/locale_init.cc:256
#2  0x0000020000099d10 in _Impl (this=Cannot access memory at address 0x18
)
    at ../../../../gcc/libstdc++-v3/src/locale_init.cc:256
Cannot access memory at address 0x40
(gdb) quit
Comment 1 Andrew Pinski 2003-10-26 06:39:52 UTC
Either caused by:
2003-10-17  Benjamin Kosnik  <bkoz@redhat.com>

        * src/Makefile.am: Add new files.
        * src/Makefile.in: Regenerate.
        * src/globals.cc: Split into..
        * src/globals_io.cc: New.
        * src/globals_locale.cc: New.
        * src/ios.cc: Split into...
        * src/ios_init.cc: New.
        * src/ios_locale.cc: New.
        * src/locale-inst.cc: Split into..
        * src/wlocale-inst.cc: New.
        * src/locale-misc-inst.cc: New.
        * src/locale.cc, src/localename: Split into...
        * src/locale_facets.cc: New.
        * src/locale_init.cc: New.
        * src/wstring-inst.cc: Add copyright info.
Or by:
2003-10-02  Petur Runolfsson  <peturr02@ru.is>
	....
        * src/localename.cc (locale::_Impl::_Impl(facet**, size_t, bool)):
        Drop unused parameters, add throw() specifier, don't initialize
        locale::facet::_S_c_locale and _S_c_name.
Comment 2 carlo 2003-10-26 16:18:16 UTC
Subject: Re:  New: Seg Fault when <iostream> included

On Sun, Oct 26, 2003 at 02:54:52AM -0000, mckelvey at maskull dot com wrote:
> Reading symbols from /usr/local/lib/libstdc++.so.6...done.

Is that the correct libstdc++?
You should link with the one that comes with the compiler.
Perhaps this is one from an old installation?

Please explain if you compiled this compiler yourself,
and if so, how you amde sure that the correct libstdc++ is
being used.

Comment 3 James McKelvey 2003-10-27 01:46:31 UTC
Subject: Re:  [3.4 Regression] Seg Fault when <iostream> included

On Sunday 26 October 2003 08:18 am, you wrote:
> PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12776
>
>
>
> ------- Additional Comments From carlo at alinoe dot com  2003-10-26 16:18
> ------- Subject: Re:  New: Seg Fault when <iostream> included
>
> On Sun, Oct 26, 2003 at 02:54:52AM -0000, mckelvey at maskull dot com wrote:
> > Reading symbols from /usr/local/lib/libstdc++.so.6...done.
>
> Is that the correct libstdc++?
> You should link with the one that comes with the compiler.
> Perhaps this is one from an old installation?
>
> Please explain if you compiled this compiler yourself,
> and if so, how you amde sure that the correct libstdc++ is
> being used.
>

Yes, I built it myself, and the date of the compiler matches the date of 
libstdc++.so.6. The bug has been promoted to NEW, so I'm assuming that 
someone else has confirmed it.
Comment 4 Andrew Pinski 2003-10-27 07:01:09 UTC
Actually this was not caused by these patches at all but really a miscompiling of a file, 
see <http://gcc.gnu.org/ml/gcc-patches/2003-10/msg02371.html>.
This is fixed by that patch:
        * config/alpha/alpha.md (attr cannot_copy): New.
        (call_osf_2_er, call_value_osf_2_er, ldgp_er_1, ldgp_er_2,
        prologue_ldgp_er_2, prologue_ldgp_1): Set it.
        * config/alpha/alpha.c (alpha_cannot_copy_insn_p): Test it.