Boost logo

Boost Users :

Subject: [Boost-users] Trouble with asio using lib pion and boost.function
From: Stephan Menzel (stephan.menzel_at_[hidden])
Date: 2008-11-26 06:57:39


Hi there,

I'm not actually sure this is a boost problem but I'll give it a try and ask for your opinion. Boost version is 1.36

I have a daemon here realising a web interface using pion and asio. Pion is also using asio. On Linux everything runs fine and I have my web interface, but using the same code on windows / vs 2005 I get the weirdest errors such as

" Unhandled exception at 0x1004e55d in myapp.exe: 0xC0000005: Access violation reading location 0xcdcdcdd1."

The debugger tells me this happens in function_template.hpp:

#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
  template<typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS>
  typename BOOST_FUNCTION_FUNCTION<
      R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS>::result_type
   BOOST_FUNCTION_FUNCTION<R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS>
  ::operator()(BOOST_FUNCTION_PARMS) const
  {
    if (this->empty())
      boost::throw_exception(bad_function_call());

    return static_cast<vtable_type*>(vtable)->invoker
             (this->functor BOOST_FUNCTION_COMMA BOOST_FUNCTION_ARGS);
  }
#endif

It says the static_cast rises the exception (?!) Damn MS.
Anyway, I debugged into it and the last thing the debugger stepped into was in asio:

 size_t run(boost::system::error_code& ec)
  {
    if (::InterlockedExchangeAdd(&outstanding_work_, 0) == 0)
    {
      ec = boost::system::error_code();
      return 0;
    }

    call_stack<win_iocp_io_service>::context ctx(this);

    size_t n = 0;
    while (do_one(true, ec))
      if (n != (std::numeric_limits<size_t>::max)())
        ++n;
    return n;
  }

I don't know which line though.

Can anyone help shed some light on this?

Thanks and greetings...

Stephan


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