ofstream crash with libstdc++

Siddhesh Poyarekar siddhesh.poyarekar@gmail.com
Tue Feb 19 12:13:00 GMT 2013


On 19 February 2013 17:38, Mahmood Naderan <nt_mahmood@yahoo.com> wrote:
> Sorry for spamming! I have narrowed the search space and found this:
>
> #include <fstream>
> using namespace std;
> int main()
> {
>    ofstream fout ("test.txt", fstream::out);
>    return 0;
> }
>
> [mahmood@localhost ~]$ /opt/gcc-4.1.2-built/bin/g++ -g -ggdb -o test test.cpp
> [mahmood@localhost ~]$ gdb test
> GNU gdb (GDB) Red Hat Enterprise Linux (7.2-56.el6)
> Copyright (C) 2010 Free Software Foundation, Inc.
> ...
> Reading symbols from /home/mahmood/test...done.
> (gdb) r
> Starting program: /home/mahmood/test
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x00000037e26f22d0 in ?? () from /usr/lib64/libstdc++.so.6
> Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.80.el6_3.5.x86_64 libgcc-4.4.6-4.el6.x86_64 libstdc++-4.4.6-4.el6.x86_64
> (gdb) bt
> #0  0x00000037e26f22d0 in ?? () from /usr/lib64/libstdc++.so.6
> #1  0x0000000000000000 in ?? ()
> (gdb)
>

This may be due to a broken ABI between 4.1.2 and 4.4.  The best place
to ask this question (now that you have narrowed it down) is the
gcc-help list:

[1] http://gcc.gnu.org/ml/gcc-help/

I'd suggest you also file a bug with SL.

-- 
http://siddhesh.in



More information about the Libc-help mailing list