This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
ofstream crash with libstdc++
- From: Mahmood Naderan <nt_mahmood at yahoo dot com>
- To: "libc-help at sourceware dot org" <libc-help at sourceware dot org>
- Date: Tue, 19 Feb 2013 02:52:21 -0800 (PST)
- Subject: ofstream crash with libstdc++
- Reply-to: Mahmood Naderan <nt_mahmood at yahoo dot com>
Hi
I have wrote a code that contains
??? .....
???? std::string f;
???? std::fstream
fout;
???? f = "filter";
???? fout.open(f.c_str(), std::fstream::app | std::fstream::out);
???? fout << "--------------------messages format--------------------------\n";? // LINE 207
???? ....
At the last line, gdb reports a crash with this information
???? Program received signal SIGSEGV, Segmentation fault.
0x00000037e2492912 in std::basic_ostream<char,
std::char_traits<char> >& std::__ostream_insert<char,
std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&, char const*, long) ()
???? from /usr/lib64/libstdc++.so.6
???? (gdb) bt
#0? 0x00000037e2492912 in std::basic_ostream<char,
std::char_traits<char> >& std::__ostream_insert<char,
std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&, char
const*, long) ()
???? from /usr/lib64/libstdc++.so.6
???? #1?
0x00000037e2492b8f in std::basic_ostream<char,
std::char_traits<char> >& std::operator<<
<std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&, char const*) () from
/usr/lib64/libstdc++.so.6
???? #2? 0x00007f1a306e5b2d in nCache::CacheComponent::initialize (this=0x19c2940) at CacheImpl.cpp:207
What can be wrong with that fout? It seems that there is an issue with libstdc++ but I don't how to debug further.Any reply is appreciated.
Regards,
Mahmood????????