c++ - Segmentation fault using boost::thread -


i've written application using threads boost::thread. compiles , works fine on local machine. problem occurs on 1 of servers. i've send main.cpp file , compiled same way did on local machine:

g++ -g main.cpp -o rdzen -lboost_thread ulimit -c unlimited 

i'm executing with:

./rdzen input.txt dictionary.txt output.txt 

then got:

segmentation fault (core dumped) 

i used gdb find out reason:

gdb rdzen core 

the backtrace is:

#0  0x0804c039 in boost::detail::atomic_exchange_and_add (pw=0x53006d76, dv=-1) @ /usr/local/include/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp:50 #1  0x0804c11a in boost::detail::sp_counted_base::release (this=0x53006d72) @ /usr/local/include/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp:143 #2  0x0804c17c in ~shared_count (this=0xbd928a8c, __in_chrg=<value optimized out>) @ /usr/local/include/boost/smart_ptr/detail/shared_count.hpp:305 #3  0xb2b388e1 in ~shared_ptr (this=0xbd928b3c) @ ./boost/smart_ptr/shared_ptr.hpp:169 #4  boost::shared_ptr<boost::detail::thread_data_base>::operator= (this=0xbd928b3c) @ ./boost/smart_ptr/shared_ptr.hpp:305 #5  boost::thread::start_thread (this=0xbd928b3c) @ libs/thread/src/pthread/thread.cpp:184 #6  0x0805022c in thread<boost::_bi::bind_t<void, void (*)(int, char*, char*, char*, int), boost::_bi::list5<boost::_bi::value<int>, boost::_bi::value<char*>, boost::_bi::value<char*>, boost::_bi::value<char*>, boost::_bi::value<int> > > > (this=0xbd928b3c, f=...) @ /usr/local/include/boost/thread/detail/thread.hpp:205 #7  0x0804a88a in main (argc=4, argv=0xbd928cb4) @ main.cpp:542 

main.cpp:542 is:

boost::thread watek1(boost::bind(&watek, 0, argv[1], argv[2], argv[3], 0)); 

what reason , why same code works on local machine , not on server? in advance help.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -