Boost logo

Boost Users :

Subject: Re: [Boost-users] Trouble with asio using lib pion and boost.function
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-11-26 12:56:25


AMDG

Stephan Menzel wrote:
> 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.
>

a) Is the error on the static_cast or on reading the function pointer?
b) does it happen consistently?

> Can anyone help shed some light on this?
>

This could be the 1.36 Boost.Function thread safety regression.
There is a race condition that can prevent invoker from being
properly initialized before it is used.

In Christ,
Steven Watanabe


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