SIGSEGV, segmentation fault when using fstream

Hi,
In my application, i used fstream, It is working fine in windows, causing segmentation fault in Linux. Please, give me your suggestions.

The following is the debugger output, gdb o/p for bt
0x4f7f3219 in __gnu_cxx::__exchange_and_add () from /usr/lib/libstdc++.so.6
#1 0x4f792a5c in std::locale::~locale () from /usr/lib/libstdc++.so.6
#2 0x4f7a04a1 in std::basic_filebuf<char, std::char_traits<char> >::~basic_filebuf ()
from /usr/lib/libstdc++.so.6
#3 0x4f7a2dc2 in std::basic_fstream<char, std::char_traits<char> >::~basic_fstream ()
from /usr/lib/libstdc++.so.6
#4 0x0806ab4d in QueueThread (ptr=0x1) at CoreIGW/QueueSwThread.cpp:1913
#5 0x4ecfc2db in start_thread () from /lib/libpthread.so.0
#6 0x4ec5612e in clone () from /lib/libc.so.6


Last edited on
You'll need to post some code that reproduces the problem.
Looks like you may have some memory corruption. Try running it through Valgrind. I recommend dumping its output to a file so you can read it once the program crashes. Oh, can compile with no optimizations and with debug information.
Topic archived. No new replies allowed.