Bug #2478

GCC47 and simple C++ program

Added by yellowrabbit2010 almost 2 years ago. Updated over 1 year ago.

Status:ClosedStart date:12/24/2012
Priority:NormalDue date:
Assignee:dragonflybsd1% Done:

0%

Category:-
Target version:-

Description

Fresh installed DragogonFlyBSD 3.2.2 (http://mirror-master.dragonflybsd.org/iso-images/dfly-x86_64-3.2.2_REL.iso.bz2).

Simple C++ file:
==== test.c++ ====
#include <iostream>

using namespace std;

int
main(int argc, char *argv[])
{
int r;

cin >> r;
return(r);
}
====

Build and run with default compiler:
dfly322# g++ -g -o test44 test.c++
dfly322# ./test44
12

Build and run with GCC47:
dfly322# env CCVER=gcc47 g++ -g -o test47 test.c++
dfly322# ./test47
12
Segmentation fault (core dumped)

Cal trace:
dfly322# gdb test47 -c test47.core
GNU gdb (GDB) 7.4.1
Copyright (C) 2012 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-dragonfly".
For bug reporting instructions, please see:
<http://bugs.dragonflybsd.org/&gt;...
Reading symbols from /root/var/test-c++/test47...done.
[New <main task>]
Core was generated by `test47'.
Program terminated with signal 11, Segmentation fault.
#0 0x00000008008be3db in std::istream::sentry::sentry(std::istream&, bool) ()
from /usr/lib/gcc47/libstdc++.so.9
(gdb) bt
#0 0x00000008008be3db in std::istream::sentry::sentry(std::istream&, bool) ()
from /usr/lib/gcc47/libstdc++.so.9
#1 0x00000008008bf48e in std::istream::operator>>(int&) ()
from /usr/lib/gcc47/libstdc++.so.9
#2 0x0000000000400e20 in main (argc=1, argv=0x7ffffffff990) at test.c++:10
(gdb) q

History

#1 Updated by marino almost 2 years ago

  • Assignee set to dragonflybsd1

I'll take it.

#2 Updated by marino over 1 year ago

This might be the source of the problem:
/usr/include/c++/4.7/bits/istream.tcc

Also available in: Atom PDF