Boost logo

Boost Users :

Subject: [Boost-users] Problem in running blocking_udp_echo_client on MacOSX
From: n179911 (n179911_at_[hidden])
Date: 2009-07-25 16:28:35


I am trying to run blocking_udp_echo_client on MacOS X
http://www.boost.org/doc/libs/1_35_0/doc/html/boost_asio/example/echo/blocking_udp_echo_client.cpp

I run it with argument 'localhost 9000'

But the program crashes and this is the line in the source which crashes:
udp::socket s(io_service, udp::endpoint(udp::v4(), 0));

this is the stack trace:
#0 0x918c3e42 in __kill
#1 0x918c3e34 in kill$UNIX2003
#2 0x9193623a in raise
#3 0x91942679 in abort
#4 0x940d96f9 in __gnu_debug::_Error_formatter::_M_error
#5 0x0000e76e in
__gnu_debug::_Safe_iterator<__gnu_norm::_List_iterator<std::pair<int,
boost::asio::detail::reactor_op_queue<int>::op_base*> >,
__gnu_debug_def::list<std::pair<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>,
std::allocator<std::pair<int,
boost::asio::detail::reactor_op_queue<int>::op_base*> > >
>::_Safe_iterator at safe_iterator.h:124
#6 0x00014729 in boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type::bucket_type
at hash_map.hpp:277
#7 0x00019e97 in std::_Construct<boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type,
boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type> at
stl_construct.h:81
#8 0x0001a457 in
std::__uninitialized_fill_n_aux<__gnu_cxx::__normal_iterator<boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type*,
__gnu_norm::vector<boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type,
std::allocator<boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type> >
>, unsigned long, boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type> at
stl_uninitialized.h:194
#9 0x0001a4e1 in
std::uninitialized_fill_n<__gnu_cxx::__normal_iterator<boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type*,
__gnu_norm::vector<boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type,
std::allocator<boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type> >
>, unsigned long, boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type> at
stl_uninitialized.h:218
#10 0x0001a509 in
std::__uninitialized_fill_n_a<__gnu_cxx::__normal_iterator<boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type*,
__gnu_norm::vector<boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type,
std::allocator<boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type> >
>, unsigned long, boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type,
boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type> at
stl_uninitialized.h:310
#11 0x0001aa34 in
__gnu_norm::vector<boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type,
std::allocator<boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type>
>::_M_fill_insert at vector.tcc:365
#12 0x0001acda in
__gnu_norm::vector<boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type,
std::allocator<boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type>
>::insert at stl_vector.h:658
#13 0x0001ad81 in
__gnu_norm::vector<boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type,
std::allocator<boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type>
>::resize at stl_vector.h:427
#14 0x0001ae3a in
__gnu_debug_def::vector<boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type,
std::allocator<boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type>
>::resize at vector:169
#15 0x0001b7be in boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::rehash at
hash_map.hpp:221
#16 0x0001bbeb in boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::hash_map at
hash_map.hpp:67
#17 0x0001bc74 in
boost::asio::detail::reactor_op_queue<int>::reactor_op_queue at
reactor_op_queue.hpp:42
#18 0x0001bd24 in
boost::asio::detail::kqueue_reactor<false>::kqueue_reactor at
kqueue_reactor.hpp:86
#19 0x0001c000 in
boost::asio::detail::service_registry::use_service<boost::asio::detail::kqueue_reactor<false>
> at service_registry.hpp:109
#20 0x0001c14d in
boost::asio::use_service<boost::asio::detail::kqueue_reactor<false> >
at io_service.ipp:195
#21 0x0001c26d in
boost::asio::detail::reactive_socket_service<boost::asio::ip::udp,
boost::asio::detail::kqueue_reactor<false> >::reactive_socket_service
at reactive_socket_service.hpp:111
#22 0x0001c344 in
boost::asio::detail::service_registry::use_service<boost::asio::detail::reactive_socket_service<boost::asio::ip::udp,
boost::asio::detail::kqueue_reactor<false> > > at
service_registry.hpp:109
#23 0x0001c491 in
boost::asio::use_service<boost::asio::detail::reactive_socket_service<boost::asio::ip::udp,
boost::asio::detail::kqueue_reactor<false> > > at io_service.ipp:195
#24 0x0001c4d5 in
boost::asio::datagram_socket_service<boost::asio::ip::udp>::datagram_socket_service
at datagram_socket_service.hpp:95
#25 0x0001c59e in
boost::asio::detail::service_registry::use_service<boost::asio::datagram_socket_service<boost::asio::ip::udp>
> at service_registry.hpp:109
#26 0x0001c6eb in
boost::asio::use_service<boost::asio::datagram_socket_service<boost::asio::ip::udp>
> at io_service.ipp:195
#27 0x0001c711 in
boost::asio::basic_io_object<boost::asio::datagram_socket_service<boost::asio::ip::udp>
>::basic_io_object at basic_io_object.hpp:72
#28 0x0001c783 in boost::asio::basic_socket<boost::asio::ip::udp,
boost::asio::datagram_socket_service<boost::asio::ip::udp>
>::basic_socket at basic_socket.hpp:108
#29 0x0001c865 in
boost::asio::basic_datagram_socket<boost::asio::ip::udp,
boost::asio::datagram_socket_service<boost::asio::ip::udp>
>::basic_datagram_socket at basic_datagram_socket.hpp:107
#30 0x000027bc in main at main.cpp:32

This is the gdb output:

(gdb) continue
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/debug/safe_iterator.h:127:
    error: attempt to copy-construct an iterator from a singular iterator.

Objects involved in the operation:
iterator "this" @ 0x0x100420 {
type = N11__gnu_debug14_Safe_iteratorIN10__gnu_norm14_List_iteratorISt4pairIiPN5boost4asio6detail16reactor_op_queueIiE7op_baseEEEEN15__gnu_debug_def4listISB_SaISB_EEEEE
(mutable iterator);
  state = singular;
}
iterator "other" @ 0x0xbfffe8a4 {
type = N11__gnu_debug14_Safe_iteratorIN10__gnu_norm14_List_iteratorISt4pairIiPN5boost4asio6detail16reactor_op_queueIiE7op_baseEEEEN15__gnu_debug_def4listISB_SaISB_EEEEE
(mutable iterator);
  state = singular;
}
Program received signal: “SIGABRT”.
(gdb) continue
Program received signal: “?”.

Does someone has any idea why this example does not work on mac osx?
Thank you.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net