C++ 在MacOSX上运行boost eample blocking_udp_echo_客户端时出现问题

C++ 在MacOSX上运行boost eample blocking_udp_echo_客户端时出现问题,c++,macos,boost,C++,Macos,Boost,我正在尝试在MacOS X上运行blocking_udp_echo_客户端 我使用参数“localhost 9000”运行它 但是程序崩溃了,这是源代码中崩溃的一行: `udp::套接字s(io_服务,udp::端点(udp::v4(),0));' 这是堆栈跟踪: #0 0x918c3e42 in __kill #1 0x918c3e34 in kill$UNIX2003 #2 0x9193623a in raise #3 0x91942679 in a

我正在尝试在MacOS X上运行blocking_udp_echo_客户端

我使用参数“localhost 9000”运行它

但是程序崩溃了,这是源代码中崩溃的一行: `udp::套接字s(io_服务,udp::端点(udp::v4(),0));'

这是堆栈跟踪:

#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::op_base*> >, __gnu_debug_def::list::op_base*>, std::allocator::op_base*> > > >::_Safe_iterator at safe_iterator.h:124 #6 0x00014729 in boost::asio::detail::hash_map::op_base*>::bucket_type::bucket_type at hash_map.hpp:277 #7 0x00019e97 in std::_Construct::op_base*>::bucket_type, boost::asio::detail::hash_map::op_base*>::bucket_type> at stl_construct.h:81 #8 0x0001a457 in std::__uninitialized_fill_n_aux::op_base*>::bucket_type*, __gnu_norm::vector::op_base*>::bucket_type, std::allocator::op_base*>::bucket_type> > >, unsigned long, boost::asio::detail::hash_map::op_base*>::bucket_type> at stl_uninitialized.h:194 #9 0x0001a4e1 in std::uninitialized_fill_n::op_base*>::bucket_type*, __gnu_norm::vector::op_base*>::bucket_type, std::allocator::op_base*>::bucket_type> > >, unsigned long, boost::asio::detail::hash_map::op_base*>::bucket_type> at stl_uninitialized.h:218 #10 0x0001a509 in std::__uninitialized_fill_n_a::op_base*>::bucket_type*, __gnu_norm::vector::op_base*>::bucket_type, std::allocator::op_base*>::bucket_type> > >, unsigned long, boost::asio::detail::hash_map::op_base*>::bucket_type, boost::asio::detail::hash_map::op_base*>::bucket_type> at stl_uninitialized.h:310 #11 0x0001aa34 in __gnu_norm::vector::op_base*>::bucket_type, std::allocator::op_base*>::bucket_type> >::_M_fill_insert at vector.tcc:365 #12 0x0001acda in __gnu_norm::vector::op_base*>::bucket_type, std::allocator::op_base*>::bucket_type> >::insert at stl_vector.h:658 #13 0x0001ad81 in __gnu_norm::vector::op_base*>::bucket_type, std::allocator::op_base*>::bucket_type> >::resize at stl_vector.h:427 #14 0x0001ae3a in __gnu_debug_def::vector::op_base*>::bucket_type, std::allocator::op_base*>::bucket_type> >::resize at vector:169 #15 0x0001b7be in boost::asio::detail::hash_map::op_base*>::rehash at hash_map.hpp:221 #16 0x0001bbeb in boost::asio::detail::hash_map::op_base*>::hash_map at hash_map.hpp:67 #17 0x0001bc74 in boost::asio::detail::reactor_op_queue::reactor_op_queue at reactor_op_queue.hpp:42 #18 0x0001bd24 in boost::asio::detail::kqueue_reactor::kqueue_reactor at kqueue_reactor.hpp:86 #19 0x0001c000 in boost::asio::detail::service_registry::use_service > at service_registry.hpp:109 #20 0x0001c14d in boost::asio::use_service > at io_service.ipp:195 #21 0x0001c26d in boost::asio::detail::reactive_socket_service >::reactive_socket_service at reactive_socket_service.hpp:111 #22 0x0001c344 in boost::asio::detail::service_registry::use_service > > at service_registry.hpp:109 #23 0x0001c491 in boost::asio::use_service > > at io_service.ipp:195 #24 0x0001c4d5 in boost::asio::datagram_socket_service::datagram_socket_service at datagram_socket_service.hpp:95 #25 0x0001c59e in boost::asio::detail::service_registry::use_service > at service_registry.hpp:109 #26 0x0001c6eb in boost::asio::use_service > at io_service.ipp:195 #27 0x0001c711 in boost::asio::basic_io_object >::basic_io_object at basic_io_object.hpp:72 #28 0x0001c783 in boost::asio::basic_socket >::basic_socket at basic_socket.hpp:108 #29 0x0001c865 in boost::asio::basic_datagram_socket >::basic_datagram_socket at basic_datagram_socket.hpp:107 #30 0x000027bc in main at main.cpp:32 #0 0x918c3e42英寸压井 #压井$UNIX2003中的1 0x918c3e34 #2 0x9193623a处于上升状态 #3 0x91942679处于中止状态 #4 0x940d96f9在u_gnu__调试::_错误_格式化程序::_M_错误 #5 0x0000e76e英寸 __gnu调试::_Safe_迭代器::op_base*>>, __gnu_debug_def::list::op_base*>, std::分配器::op_base*>> >::_Safe_iterator at Safe_iterator.h:124 #boost中的6 0x00014729::asio::detail::hash_map::op_base*>::bucket_类型::bucket_类型 在hash_地图上,水电站:277 #标准中的7 0x00019e97::_构造::op_基*>::桶类型, boost::asio::detail::hash_map::op_base*>::bucket_type>at stl_Construction.h:81 #8 0x0001a457英寸 标准::uu未初始化u填充u n_u辅助::操作u基础*>::桶类型*, __gnu_norm::vector::op_base*>::bucket_类型, std::分配器::op_base*>::bucket_type>> >,无符号长,boost::asio::detail::hash_map::op_base*>::bucket_type>at stl_未初始化。h:194 #9 0x0001a4e1英寸 std::未初始化的\u填充\u n::op\u base*>::bucket\u type*, __gnu_norm::vector::op_base*>::bucket_类型, std::分配器::op_base*>::bucket_type>> >,无符号长,boost::asio::detail::hash_map::op_base*>::bucket_type>at stl_未初始化。h:218 #10 0x0001a509英寸 std::\u未初始化\u填充\u n\u a::op\u base*>::桶类型*, __gnu_norm::vector::op_base*>::bucket_类型, std::分配器::op_base*>::bucket_type>> >,无符号长,boost::asio::detail::hash_map::op_base*>::bucket_type, boost::asio::detail::hash_map::op_base*>::bucket_type>at stl_未初始化。h:310 #11 0x0001aa34英寸 __gnu_norm::vector::op_base*>::bucket_类型, std::分配器::op_base*>::bucket_type> >:_M_fill_insert at vector.tcc:365 #12 0x0001acda输入 __gnu_norm::vector::op_base*>::bucket_类型, std::分配器::op_base*>::bucket_type> >::在stl_向量处插入。h:658 #13 0x0001ad81英寸 __gnu_norm::vector::op_base*>::bucket_类型, std::分配器::op_base*>::bucket_type> >::在stl_矢量处调整大小。h:427 #14 0x0001ae3a英寸 __gnu_debug_def::vector::op_base*>::bucket_type, std::分配器::op_base*>::bucket_type> >::在向量处调整大小:169 #boost中的15 0x0001b7be::asio::detail::hash_map::op_base*>::在 hash_地图,水电站:221 #boost::asio::detail::hash_map::op_base*>::hash_map at hash_map.水电站:67 #17 0x0001bc74英寸 boost::asio::detail::reactor_op_队列::reactor_op_队列位于 反应堆运行队列。水电站:42 #18 0x0001bd24英寸 boost::asio::detail::kqueue_reactor::kqueue_reactor at KU反应堆,水电站:86 #19 0x0001c000英寸 boost::asio::detail::服务\注册表::使用\服务 >在服务登记处。水电站:109 #20 0x0001c14d英寸 boost::asio::使用\u服务> 在io_服务,ipp:195 #21 0x0001c26d英寸 boost::asio::detail::reactive\u socket\u service>::reactive\u socket\u service 在无功插座供电时,水电站:111 #22 0x0001c344英寸 boost::asio::detail::service\u注册表::在 服务注册处.水电站:109 #23 0x0001c491英寸 boost::asio::使用io服务>>在io服务上。ipp:195 #24 0x0001c4d5英寸 boost::asio::数据报\u套接字\u服务::数据报\u套接字\u服务 在数据报服务中。hpp:95 #25 0x0001c59e英寸 boost::asio::detail::服务\注册表::使用\服务 >在服务登记处。水电站:109 #26 0x0001c6eb英寸 boost::asio::使用\u服务 >在io_服务,ipp:195 #27 0x0001c711英寸 boost::asio::基本io对象 >::基本对象在基本对象上。hpp:72 #boost::asio::basic_插槽中的28 0x0001c783 >::基本插座位于基本插座处。hpp:108 #29 0x0001c865英寸 boost::asio::基本数据报\u套接字 >::基本数据报插槽位于基本数据报插槽。hpp:107 #30 0x000027bc在主管道的主管道中。cpp:32 这是gdb输出:

(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: “?”. (gdb)继续 /Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/debug/safe_iterator.h:127: 错误:尝试从单个迭代器复制构造迭代器。 操作中涉及的对象: 迭代器“this”@0x100420{ type=N11\u gnu调试14\u安全迭代器n10\u gnu规范列表迭代器4配对boost4 asio6详细信息16反应堆操作队列操作基础een15\u gnu调试定义列表b\u SaISB\eeee (可变迭代器); 状态=单数; } 迭代器“其他”@0xBFFFE8A4{ type=N11\u gnu调试14\u安全迭代器n10\u gnu规范列表迭代器4配对boost4 asio6详细信息16反应堆操作队列操作基础een15\u gnu调试定义列表b\u SaISB\eeee (可变迭代器); 状态=单数; } 程序收到信号:“SIGABRT”。 (gdb)继续 程序接收到信号:“?”。 有人知道为什么这个例子在MacOSX上不起作用吗?
谢谢。

看起来像boost::asio库中的一个bug。是相应的错误报告