Bug #2478

GCC47 and simple C++ program

Added by yellowrabbit2010 almost 4 years ago. Updated over 3 years ago.

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


Target version:-


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;

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

cin >> r;

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

Build and run with GCC47:
dfly322# env CCVER=gcc47 g++ -g -o test47 test.c++
dfly322# ./test47
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:
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


#1 Updated by marino almost 4 years ago

  • Assignee set to dragonflybsd1

I'll take it.

#2 Updated by marino over 3 years ago

This might be the source of the problem:

Also available in: Atom PDF