This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ofstream crash with libstdc++


Still I am trying to resolve the issue. As I said there is another system which has g++4.1 and the sample code works fine. Using the "strings" command I see that both binary have exactly the same dependencies.

1) on working system
[mahmoodt@srv2~]$ strings test
/lib64/ld-linux-x86-64.so.2
libstdc++.so.6
_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode
__gmon_start__
_Jv_RegisterClasses
__gxx_personality_v0
_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev
libm.so.6
libgcc_s.so.1
libc.so.6
__libc_start_main
CXXABI_1.3
GLIBCXX_3.4
GLIBC_2.2.5
fffff.
l$ L
t$(L
|$0H
test.txt


2) on my system which doesn't work
[mahmood@localhost ~]$ strings test
/lib64/ld-linux-x86-64.so.2
libstdc++.so.6
__gmon_start__
_Jv_RegisterClasses
__gxx_personality_v0
_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev
_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode
libm.so.6
libgcc_s.so.1
libc.so.6
__libc_start_main
CXXABI_1.3
GLIBCXX_3.4
GLIBC_2.2.5
fff.
fffff.
l$ L
t$(L
|$0H
test.txt



?
If someone has an idea, please let me know.


Regards,
Mahmood



----- Original Message -----
From: Siddhesh Poyarekar <siddhesh.poyarekar@gmail.com>
To: Mahmood Naderan <nt_mahmood@yahoo.com>
Cc: Yann Droneaud <yann@droneaud.fr>; "libc-help@sourceware.org" <libc-help@sourceware.org>
Sent: Tuesday, February 19, 2013 3:42 PM
Subject: Re: ofstream crash with libstdc++

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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]