[Boost-bugs] [Boost C++ Libraries] #9439: boost::spawn core dump

Subject: [Boost-bugs] [Boost C++ Libraries] #9439: boost::spawn core dump
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-11-27 03:30:43


#9439: boost::spawn core dump
-------------------------+------------------------------
 Reporter: ybb198602@… | Type: Bugs
   Status: new | Milestone: To Be Determined
Component: None | Version: Boost 1.54.0
 Severity: Problem | Keywords:
-------------------------+------------------------------
 My program generate an core dump when I create 50000 coroutines.The number
 of coroutines is too big?

 gcc version 3.4.5 20051201 (Red Hat 3.4.5-2)

 My program is:
 #include <boost/bind.hpp>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/ip/tcp.hpp>
 #include <boost/asio/spawn.hpp>
 #include <boost/asio/steady_timer.hpp>
 #include <boost/asio/write.hpp>
 #include <iostream>
 #include <memory>
 #include <sys/time.h>
 #include <sys/resource.h>
 #include <unistd.h>

 using boost::asio::ip::tcp;

 void do_echo(boost::asio::yield_context yield,
     boost::asio::io_service *io_service) {
   for (; ;) {
     try {
       tcp::socket sock(*io_service);
       tcp::endpoint ep(boost::asio::ip::address::from_string("127.0.0.1"),
 19011);
       sock.async_connect(ep, yield);
       std::cout<< 1 <<std::endl ;
     }
     catch (...) {
       std::cout<<"test";
     }
   }
 }

 int main(int argc, char* argv[]) {
   try {
     boost::asio::io_service io_service;
     for (int i=0; i<50000; ++i) {
       boost::asio::spawn(io_service, boost::bind(&do_echo, _1,
 &io_service));
     }
     io_service.run();

   } catch(...) {
     std::cerr << "Exception:\n";
   }
   return 0;
 }

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9439>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:14 UTC