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]

ofstream crash with libstdc++


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????????


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