nebuladream
unread,Oct 24, 2009, 5:57:08 AM10/24/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to 高性能服务器研发与运营邮件列表
下面是我们使用GDB调试的代码:
Breakpoint 1, CProxy (this=0x7fffa648b4e0, filename=0x7fffa648bbe5
"config.txt") at proxy.cpp:51
51 pIConnect pcconnect(new CCconnect(&ioOwn,
ip.c_str(), port.c_str
(), this, regist,response));
(gdb) s
CCconnect (this=0x149f8060, pio=0x7fffa648b4ec, host=
{static npos = 18446744073709551615, _M_dataplus =
{<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No
data fields>}, <No data fields>}, _M_p = 0x7fffa648b440
"\030\200\237\024"}}, port=
{static npos = 18446744073709551615, _M_dataplus =
{<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No
data fields>}, <No data fields>}, _M_p = 0x7fffa648b450 "H
\200\237\024"}}, ph=0x7fffa648b4e0,
msg_register={len = 0, cmd = 32, res = 0}, msg_response={len = 0,
cmd = 33, res = 0}) at cconnect.cpp:17
17 ,m_is_informed
(-1)
(gdb) s
CInterfaceConnect (this=0x149f8060) at interfaceconnect.h:35
35 CInterfaceConnect(){}
(gdb) s
enable_shared_from_this (this=0x149f806c) at /root/boost_1_39_0/
boost/
smart_ptr/enable_shared_from_this.hpp:29
29 {
(gdb) s
weak_ptr (this=0x149f806c) at /root/boost_1_39_0/boost/smart_ptr/
weak_ptr.hpp:39
39 weak_ptr(): px(0), pn() // never throws in 1.30+
(gdb) s
weak_count (this=0x149f8074) at /root/boost_1_39_0/boost/smart_ptr/
detail/shared_count.hpp:313
313 weak_count(): pi_(0) // nothrow
(gdb) s
318 }
(gdb) s
weak_ptr (this=0x149f806c) at /root/boost_1_39_0/boost/smart_ptr/
weak_ptr.hpp:40
40 {
(gdb) s
basic_stream_socket (this=0x149f807c, io_service=@0x7fffa648b4ec)
at /root/boost_1_39_0/boost/asio/basic_stream_socket.hpp:70
70 : basic_socket<Protocol, StreamSocketService>(io_service)
(gdb) s
basic_socket (this=0x149f807c, io_service=@0x7fffa648b4ec)
at /root/boost_1_39_0/boost/asio/basic_socket.hpp:67
67 : basic_io_object<SocketService>(io_service)
(gdb) s
basic_io_object (this=0x149f807c, io_service=@0x7fffa648b4ec)
at /root/boost_1_39_0/boost/asio/basic_io_object.hpp:72
72 : service(boost::asio::use_service<IoObjectService>
(io_service))
(gdb) s
noncopyable (this=0x149f807c) at /root/boost_1_39_0/boost/
noncopyable.hpp:24
24 noncopyable() {}
(gdb) s
boost::asio::use_service<boost::asio::stream_socket_service<boost::asio::ip ::tcp>
> (ios=@0x7fffa648b4ec)
at /root/boost_1_39_0/boost/asio/impl/io_service.ipp:195
195 return ios.service_registry_->template use_service<Service>
();
(gdb) s
boost::asio::detail::service_registry::use_service<boost::asio::stream_sock
et_service<boost::asio::ip::tcp>
(this=0x149f3010) at /root/boost_1_39_0/boost/asio/detail/
service_registry.hpp:94
94 boost::asio::detail::mutex::scoped_lock lock(mutex_);
(gdb) s
scoped_lock (this=0x7fffa648b000, m=@0x149f3014) at /root/
boost_1_39_0/
boost/asio/detail/scoped_lock.hpp:34
34 : mutex_(m)
(gdb) s
noncopyable (this=0x7fffa648b000) at /root/boost_1_39_0/boost/
noncopyable.hpp:24
24 noncopyable() {}
(gdb) s
scoped_lock (this=0x7fffa648b000, m=@0x149f3014) at /root/
boost_1_39_0/
boost/asio/detail/scoped_lock.hpp:36
36 mutex_.lock();
(gdb) s
boost::asio::detail::posix_mutex::lock (this=0x149f3014)
at /root/boost_1_39_0/boost/asio/detail/posix_mutex.hpp:71
71 int error = ::pthread_mutex_lock(&mutex_);
(gdb) s
72 if (error != 0)
(gdb) s
80 }
(gdb) s
scoped_lock (this=0x7fffa648b000, m=@0x149f3014) at /root/
boost_1_39_0/
boost/asio/detail/scoped_lock.hpp:37
37 locked_ = true;
(gdb) s
boost::asio::detail::service_registry::use_service<boost::asio::stream_sock
et_service<boost::asio::ip::tcp>
(this=0x149f3010) at /root/boost_1_39_0/boost/asio/detail/
service_registry.hpp:97
97 boost::asio::io_service::service* service =
first_service_;
(gdb) s
98 while (service)
(gdb) s
100 if (service_id_matches(*service, Service::id))
(gdb) s
boost::asio::detail::service_registry::service_id_matches<boost::asio::stre
am_socket_service<boost::asio::ip::tcp>
> (service=@0x149f306000007fff) at /root/boost_1_39_0/boost/asio/
detail/service_registry.hpp:208
208 && *service.type_info_ == typeid
(typeid_wrapper<Service>);
(gdb) s
Program received signal SIGSEGV, Segmentation fault.
0x000000000044c97a in
boost::asio::detail::service_registry::service_id_matches<boost::asio::stre
am_socket_service<boost::asio::ip::tcp>
> (service=@0x149f306000007fff)
at /root/boost_1_39_0/boost/asio/detail/service_registry.hpp:208
208 && *service.type_info_ == typeid
(typeid_wrapper<Service>);