0
我试图编译并在Ubuntu 10.10升压HTTP服务器实例崩溃时的boost ::在Ubuntu 10.10线程
http://www.boost.org/doc/libs/1_47_0/doc/html/boost_asio/example/http/server3/
运行下面的例子,但它崩溃的:
// Create a pool of threads to run all of the io_services.
std::vector<boost::shared_ptr<boost::thread> > threads;
for (std::size_t i = 0; i < thread_pool_size_; ++i)
{
boost::shared_ptr<boost::thread> thread(new boost::thread(
boost::bind(&boost::asio::io_service::run, &io_service_)));
threads.push_back(thread);
}
调用堆栈:
Thread [1] 573 [core: 0] (Suspended : Signal : SIGSEGV:Segmentation fault)
boost::thread::start_thread() at 0x8064a64
boost::thread::thread<boost::_bi::bind_t<unsigned int, boost::_mfi::mf0<unsigned int, boost::asio::io_service>, boost::_bi::list1<boost::_bi::value<boost::asio::io_service*> > > >() at thread.hpp:204 0x805e8c6
http::server3::server::run() at server.cpp:57 0x8059cbf
main() at HttpServer3.cpp:38 0x8048522
但是,它不会崩溃在Ubuntu 11.04,出于同样的ECL ipse CDT项目。
有什么建议吗?
我最初的猜测是Boost.Thread在10.10安装中没有正确构建。 – ildjarn
我在10.10上成功构建了boost lib。有趣的是在11.04,我确实遇到了一些错误,但它可以正常工作。 –
你可能是对的。看到我自己的答案。 –