[asio-users] bug in asio?
Brought to you by:
chris_kohlhoff
From: Vlad <vl...@gm...> - 2006-12-16 13:55:59
|
Hello All! Few days ago i've developed simple single-threaded socks proxy using asio. It worked fine so i tried to make stress-test to test how many connections it will serve at once. At this moment i started to receive segfault-s. On high loads (few thousand clients per second) my server makes a segfault with following backtrace: *** glibc detected *** double free or corruption (fasttop): 0x09bb4330 *** Program received signal SIGABRT, Aborted. 0x080e42a1 in kill () (gdb) bt #0 0x080e42a1 in kill () #1 0x080da90b in pthread_kill (thread=16384, signo=6) at signals.c:69 #2 0x080da93b in __pthread_raise (sig=6) at signals.c:200 #3 0x080e455b in abort () #4 0x080f14cf in __libc_message () #5 0x080f56f9 in malloc_printerr () #6 0x080f6b96 in free () #7 0x080ca601 in operator delete () #8 0x080538eb in __gnu_cxx::new_allocator<std::_List_node<std::pair<int const, asio::detail::reactor_op_queue<int>::op_base*> > >::deallocate (this=0x9643b28, __p=0x9bb4330) at /usr/lib/gcc/i486-linux-gnu/4.0.4/../../../../include/c++/4.0.4/ext/new_allocator.h:94 #9 0x08053910 in std::_List_base<std::pair<int const, asio::detail::reactor_op_queue<int>::op_base*>, std::allocator<std::pair<int const, asio::detail::reactor_op_queue<int>::op_base*> > >::_M_put_node (this=0x9643b28, __p=0x9bb4330) at /usr/lib/gcc/i486-linux-gnu/4.0.4/../../../../include/c++/4.0.4/bits/stl_list.h:317 #10 0x08053971 in std::list<std::pair<int const, asio::detail::reactor_op_queue<int>::op_base*>, std::allocator<std::pair<int const, asio::detail::reactor_op_queue<int>::op_base*> > >::_M_erase (this=0x9643b28, __position={_M_node = 0x9bb4330}) at /usr/lib/gcc/i486-linux-gnu/4.0.4/../../../../include/c++/4.0.4/bits/stl_list.h:1163 #11 0x080539a3 in std::list<std::pair<int const, asio::detail::reactor_op_queue<int>::op_base*>, std::allocator<std::pair<int const, asio::detail::reactor_op_queue<int>::op_base*> > >::erase (this=0x9643b28, __position={_M_node = 0x9bb4330}) at /usr/lib/gcc/i486-linux-gnu/4.0.4/../../../../include/c++/4.0.4/bits/list.tcc:98 #12 0x08053b30 in asio::detail::hash_map<int, asio::detail::reactor_op_queue<int>::op_base*>::erase (this=0x9643b28, it={_M_node = 0x9bb4330}) at /usr/local/include/asio/detail/hash_map.hpp:168 #13 0x08053c50 in asio::detail::reactor_op_queue<int>::dispatch_all_operations ( this=0x9643b24, descriptor=319, result=@0xbfe704ec) at /usr/local/include/asio/detail/reactor_op_queue.hpp:163 #14 0x08054a79 in asio::detail::epoll_reactor<false>::run (this=0x9641af0, block=false) at /usr/local/include/asio/detail/epoll_reactor.hpp:405 #15 0x0806270d in asio::detail::task_io_service<asio::detail::epoll_reactor<false> >::do_one (this=0x954a7a8, lock=@0xbfe70600, this_idle_thread=0xbfe705ac) at /usr/local/include/asio/detail/task_io_service.hpp:245 #16 0x0806291e in asio::detail::task_io_service<asio::detail::epoll_reactor<false> >::run (this=0x954a7a8) at /usr/local/include/asio/detail/task_io_service.hpp:87 #17 0x080629c4 in asio::io_service::run (this=0xbfe706c8) at /usr/local/include/asio/impl/io_service.ipp:48 #18 0x0805f712 in main (argc=3, argv=0xbfe70934) at main/main.cpp:38 (gdb) ----------------------------------------------------------------------- As you can see, asio tries to free memory twice. About program: i'm using timers to make timeouts on client/server requests. I'm profiled my proggie with valgrind, but it didn't found any errors except this. btw. i've maked my software by modifying example from asio distribution (http_server). Please help! thanks! |