[Boost-bugs] [Boost C++ Libraries] #7275: SIGSEGV in boost::asio::connect when compiled with g++ -std=c++0x

Subject: [Boost-bugs] [Boost C++ Libraries] #7275: SIGSEGV in boost::asio::connect when compiled with g++ -std=c++0x
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-08-24 15:48:51


#7275: SIGSEGV in boost::asio::connect when compiled with g++ -std=c++0x
-------------------------------------------------------+--------------------
 Reporter: Alan Yuelkenbeck <ayuelkenbeck@…> | Owner: chris_kohlhoff
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: asio
  Version: Boost 1.50.0 | Severity: Problem
 Keywords: |
-------------------------------------------------------+--------------------
 Works fine when not compiled with -std=c++0x.
 GCC v. 4.6.3 on ubuntu 12.04
 Linking to static libboost_thread, libboost_system (1.50.0 release config)
 Does not matter if server code is listening or not.

 Minimal reproducible code below:

 int main(int argc, char *argv[])
 {
     boost::asio::io_service service;

     using namespace boost::asio::ip;

     tcp::resolver resolver(service);
     tcp::resolver::query query(tcp::v4(), "127.0.0.1", "50001");
     tcp::resolver::iterator itr = resolver.resolve(query);

     if (itr != tcp::resolver::iterator())
     {
         tcp::socket s(service);
         boost::asio::connect(s, itr); // Segmentation Fault Here
     }
 }

 Callstack:

 #0 0x8054d6e
 boost::asio::detail::reactive_socket_service_base::close(this=0x16,
 impl=..., ec=...) (reactive_socket_service_base.ipp:103)
 #1 0x8058f1a
 boost::asio::stream_socket_service<boost::asio::ip::tcp>::close(this=0x2,
 impl=..., ec=...) (stream_socket_service.hpp:151)
 #2 0x80589d5 boost::asio::basic_socket<boost::asio::ip::tcp,
 boost::asio::stream_socket_service<boost::asio::ip::tcp>
>::close(this=0xbffff318, ec=...) (basic_socket.hpp:339)
 #3 0x8058186 boost::asio::connect<boost::asio::ip::tcp,
 boost::asio::stream_socket_service<boost::asio::ip::tcp>,
 boost::asio::ip::basic_resolver_iterator<boost::asio::ip::tcp>,
 boost::asio::detail::default_connect_condition>(s=..., begin=..., end=...,
 connect_condition=..., ec=...) (connect.hpp:120)
 #4 0x80578a5 boost::asio::connect<boost::asio::ip::tcp,
 boost::asio::stream_socket_service<boost::asio::ip::tcp>,
 boost::asio::ip::basic_resolver_iterator<boost::asio::ip::tcp> >(s=...,
 begin=..., ec=...) (connect.hpp:56)
 #5 0x8056dd2 boost::asio::connect<boost::asio::ip::tcp,
 boost::asio::stream_socket_service<boost::asio::ip::tcp>,
 boost::asio::ip::basic_resolver_iterator<boost::asio::ip::tcp> >(s=...,
 begin=...) (connect.hpp:47)
 #6 0x8052f41 main(argc=1, argv=0xbffff874) (main.cpp:27)

 Thank you.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7275>
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:10 UTC