Re: [Boost-users] Boost::Asio on ARMV5TE
Hi, after some debugging and testing i track down the problem to epoll. I don't known if it is a wrong usage by boost::asio or a bug inside the kernel. I've changed epoll_reactor.ipp with some debugging output and a memset. 226 void epoll_reactor::run(bool block, op_queue& ops) ... 239 epoll_event events[128]; 240+ ::memset(events, 0XEE, sizeof(events)); 241 int num_events = epoll_wait(epoll_fd_, events, 128, timeout); In case there are more events then one reported by epoll_wait, only the first epoll_event structure is filled with information. All following structures includes garbage or 0xEE set by memset befor calling epoll_wait. Debug output: Count events: 2 ---------------------------------------- EPOLL[0].data.ptr = 0x1ce8b0 EPOLL[1].data.ptr = 0xeeeeeeee So a workaround is to set maxevents to one. Like this: 226 void epoll_reactor::run(bool block, op_queue& ops) ... 240 int num_events = epoll_wait(epoll_fd_, events, 1, timeout); Is there a known bug about epoll on ARM? Or had boost::asio a bug? With best regards Peter
-----Original Message----- From: Peter Meyer [mailto:r...@xmail.net] Sent: Friday, February 11, 2011 7:57 AM To: boost-users@lists.boost.org Subject: [Boost-users] Boost::Asio on ARMV5TE
Hi,
i've wrote a litte proxy using boost::asio (boost 1.45). Program runs well on Intel (Linux kernel 2.6.35.10 and gcc 4.5.1). Same code cross compiled for ARMV5TE (Linux 2.6.24.4 and GCC 4.1.2 or GCC 3.4.3) crashes always at the same point. Stacktrace looks like this
Program terminated with signal 11, Segmentation fault. #0 0x400e3e20 in ?? () (gdb) backtrace #0 0x400e3e20 in ?? () #1 0x0001cfb0 in boost::asio::detail::posix_mutex::lock (this=0x7d) at /usr/armv5tel-redhat-linux-gnueabi/sys-root/usr/local/include/boost/asio /detail/posix_mutex.hpp:52 #2 0x0001cfe6 in scoped_lock (this=0xbe8a98d0, m=@0x7d) at /usr/armv5tel-redhat-linux-gnueabi/sys-root/usr/local/include/boost/asio /detail/scoped_lock.hpp:36 #3 0x00069bf4 in boost::asio::detail::epoll_reactor::run (this=0x191538, block=true, ops=@0xbe8a994c) at /usr/armv5tel-redhat-linux-gnueabi/sys-root/usr/local/include/boost/asio /detail/impl/epoll_reactor.ipp:275 #4 0x0006a06c in boost::asio::detail::task_io_service::do_one (this=0x1914e0, lock=@0xbe8a99d4, this_idle_thread=0xbe8a9990) at /usr/armv5tel-redhat-linux-gnueabi/sys-root/usr/local/include/boost/asio /detail/impl/task_io_service.ipp:264 #5 0x0006a33c in boost::asio::detail::task_io_service::run (this=0x1914e0, ec=@0xbe8a9a0c) at /usr/armv5tel-redhat-linux-gnueabi/sys-root/usr/local/include/boost/asio /detail/impl/task_io_service.ipp:130 #6 0x0006a426 in boost::asio::io_service::run (this=0xbe8a9bc4) at /usr/armv5tel-redhat-linux-gnueabi/sys-root/usr/local/include/boost/asio /impl/io_service.ipp:57 #7 0x00073504 in proxy::Server::run (this=0xbe8a9bb4) at server.cpp:71 #8 0x0004e2a4 in main (argc=3, argv=0xbe8a9da4) at proxy.cpp:111
It looks like the internal epoll_events data structure (descriptior_state) is corrupted.
Any advice is welcome.
With best regards Peter
------------------------------------------------------------------------------------
participants (1)
-
Peter Meyer